openapi: 3.0.3
tags:
  - name: Login Configuration
    description: Defining customer and non-customer organizations for login purposes.
x-tagGroups:
  - name: LOGIN
    tags:
      - Login Configuration
info:
  title: Login API
  version: 0.0.1
  description: APIs for the Login service of TonicDM
  contact:
    name: Reg Prentice
    url: https://developers-internal.tonicdm.com
    email: apisupport@tonicdm.com
  termsOfService: http://www.tonicdm.com/terms
  license:
    name: Proprietary
    url: https://www.tonicdm.com/license-api
servers:
  - url: https://us-api.tonicdm.com
    description: Server located in the USA
  - url: https://de-api.tonicdm.com
    description: Server located in Germany
  - url: https://ie-api.tonicdm.com
    description: Server located in Ireland
security:
  - OAuth2:
      - read
      - write
  - apiKeyAuth: []
paths:
  /login/tenants:
    description: |
      The login endpoints. 
                
    patch:
      summary: Edit login endpoint
      x-internal: true
      tags:
        - Login Configuration
      operationId: patch-login-configuration
      description: Edit Login Configuration
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Login'
      responses:
        '200':
          description: >-
            Successfully read the resource you requested. One or more records
            are returned in the form of an array.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Login'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/AuthenticationError'
        '403':
          $ref: '#/components/responses/NoAccessError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/UnexpectedError'
components:
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://example.com/oauth/authorize
          tokenUrl: https://example.com/oauth/token
          scopes:
            read: Read access to protected resources
            write: Write access to protected resources
    apiKeyAuth:
      type: apiKey
      in: query
      name: X-API-KEY
  schemas:
    Login:
      title: Login
      type: object
      description: One Login Configuration for TonicDM
      properties:
        domain:
          type: string
        slug:
          type: string
        emailPattern:
          type: string
        industryRole:
          type: string
        brandColor:
          type: string
        logoUrl:
          type: string
        nameLong:
          type: string
        nameShort:
          type: string
        nameInitials:
          type: string
      required:
        - domain
    Errors:
      title: Errors
      type: object
      required:
        - errors
      properties:
        errors:
          description: x
          type: array
          minItems: 1
          items:
            required:
              - code
              - message
            properties:
              code:
                description: x
                type: string
              message:
                description: x
                type: string
              source:
                description: x
                title: ErrorSource
                required:
                  - location
                  - name
                properties:
                  location:
                    description: x
                    type: string
                    enum:
                      - path
                      - query
                      - body
                      - header
                  name:
                    type: string
                    description: The name of the property or parameter causing the error
                  path:
                    type: string
                    description: >-
                      JSON path targeting the source of error (only used when
                      location is `body`)
  responses:
    BadRequestError:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
    AuthenticationError:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
    NoAccessError:
      description: >-
        Authentication succeeded, but the user does not have access to the
        resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
    NotFoundError:
      description: The resource cannot be found, client-side error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
    UnexpectedError:
      description: Unexpected error. Consumer may try to send the request again.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
