openapi: 3.1.0
info:
  title: Lucca API Authentication
  description: Openapi spec of the Lucca API authentication.
  version: "2024-11-01"
  contact:
    name: API Support
    url: 'https://www.luccasoftware.com'
    email: no-reply@luccasoftware.com
  license:
    name: Apache 2.0
    url: 'https://www.apache.org/licenses/LICENSE-2.0'
servers:
  - url: 'https://accounts.world.luccasoftware.com'
    description: Global auth server.
tags:
  - name: Authentication
    description: Authentication
paths:
  '/connect/token':
    x-provider: Lucca.Identity
    post: 
      operationId: generate-access-token
      summary: Create Access-Token
      description: |-
        Generate a new access-token for a client application (OAuth 2.0 client credentials flow).
      tags: [Authentication]
      x-mint:
        href: /api-reference/latest/create-access-token
      requestBody: 
        content: 
          application/x-www-form-urlencoded:
            schema: 
              type: object
              required: [client_id, client_secret, scope, grant_type]
              properties:
                client_id:
                  type: string
                client_secret:
                  type: string
                scope:
                  description: Space (" ") separated list of OAuth scopes.
                  type: string
                  example: employees.readonly
                grant_type:
                  type: string
                  const: client_credentials
                  enum: [client_credentials]
                  default: client_credentials
      responses:
        '200':
          description: OK
          content: 
            application/json:
              schema: 
                type: object
                required: [access_token, token_type, expires_in]
                properties:
                  access_token:
                    type: string
                  token_type:
                    type: string
                    const: Bearer
                    enum: [Bearer]
                    default: Bearer
                  expires_in:
                    description: Expiration delay in seconds (30 min).
                    type: integer
                    default: 1800
                    minimum: 1
