> ## Documentation Index
> Fetch the complete documentation index at: https://developer.communicate.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Exchange API-key client credentials for an access token

> Uses HTTP Basic authentication where the API key ID is the client ID and the one-time `ck_` token is the client secret. Requested scopes must be a subset of the API key scope ceiling.



## OpenAPI

````yaml https://app.communicate.so/api/v1/openapi.json post /oauth/token
openapi: 3.1.0
info:
  title: Communicate Public REST API
  version: 1.0.0
  summary: >-
    Workspace-scoped agent listing and chat operations with least-privilege
    OAuth scopes.
  description: >-
    Canonical external schema for the non-streaming public REST API. Exchange a
    workspace API-key client ID and secret for a short-lived OAuth access token,
    or use the `ck_` key directly for backward compatibility. `requestId` is
    optional but, when supplied, becomes the idempotency key for retries of the
    same chat input.
servers:
  - url: https://app.communicate.so/api/v1
    description: Canonical external base URL served through the Next.js /api/v1 rewrite.
security:
  - oauth2: []
  - bearerAuth: []
paths:
  /oauth/token:
    post:
      tags:
        - Authentication
      summary: Exchange API-key client credentials for an access token
      description: >-
        Uses HTTP Basic authentication where the API key ID is the client ID and
        the one-time `ck_` token is the client secret. Requested scopes must be
        a subset of the API key scope ceiling.
      operationId: createAccessToken
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - grant_type
              properties:
                grant_type:
                  type: string
                  enum:
                    - client_credentials
                scope:
                  type: string
                  description: Space-delimited subset of `agents:read` and `chat:write`.
                resource:
                  type: string
                  format: uri
                  enum:
                    - https://app.communicate.so/api/v1
                    - https://app.communicate.so/mcp
                  default: https://app.communicate.so/api/v1
                  description: >-
                    RFC 8707 resource audience. MCP tokens accept only
                    `agents:read`.
      responses:
        '200':
          description: Short-lived scoped bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthTokenResponse'
        '400':
          description: Unsupported grant or invalid scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthErrorResponse'
        '401':
          description: Invalid or revoked client credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthErrorResponse'
        '429':
          description: Token request rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthErrorResponse'
      security: []
components:
  schemas:
    OAuthTokenResponse:
      type: object
      additionalProperties: false
      required:
        - access_token
        - token_type
        - expires_in
        - scope
      properties:
        access_token:
          type: string
        token_type:
          type: string
          enum:
            - Bearer
        expires_in:
          type: integer
          const: 3600
        scope:
          type: string
    OAuthErrorResponse:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          type: string
  securitySchemes:
    oauth2:
      type: oauth2
      description: >-
        OAuth 2.0 client-credentials tokens bounded by the source API key scope
        ceiling.
      flows:
        clientCredentials:
          tokenUrl: https://app.communicate.so/api/v1/oauth/token
          scopes:
            agents:read: List agents in the authenticated workspace.
            chat:write: Create chat turns with an agent in the authenticated workspace.
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: Workspace API key token with the `ck_` prefix.

````