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

# Exchange Platform key for JWT token

> Client-credentials grant. Unauthenticated (credentials are in the body). Rate-limited to 20 req/min. `scope`/`projectIds` only narrow the key's own grants — they cannot widen them.

Exchange a platform API key for a short-lived Bearer JWT.


## OpenAPI

````yaml agent-platform/api-specs/project-deploy-promote.yaml post /api/cicd/v1/oauth/token
openapi: 3.1.0
info:
  title: Public Project Deploy & Promote API
  version: 1.0.0
  description: >-
    The public, platform-API-key-usable path to deploy a project's CURRENT
    content to an environment and promote it through higher environments, with
    no Studio/user login and no Git dependency. Canonical source:
    docs/api/artemis-cicd-openapi.yaml (full CI/CD API — git, webhooks, eval
    gates, rollback, audit packs). This file is a focused subset for the "import
    -> release -> deploy -> promote" flow:

      1. Move project content between workspaces with the Public Project
         Import/Export API (docs/specs/public-project-import-export-api.openapi.yaml).
      2. Build an immutable release from the imported project's CURRENT content
         with source.kind="project_snapshot".
      3. Deploy that release to an environment, then promote it to a higher one.

    Auth differs from the Import/Export API: there is no raw `x-api-key``
    header. A platform key (`client_secret``) is exchanged for a short-lived
    Bearer JWT via the OAuth2 client-credentials grant below, and that JWT is
    sent as `Authorization: Bearer <token>` on every other call.
servers:
  - url: /
security: []
paths:
  /api/cicd/v1/oauth/token:
    post:
      summary: Exchange a platform API key for a short-lived Bearer JWT.
      description: >-
        Client-credentials grant. Unauthenticated (credentials are in the body).
        Rate-limited to 20 req/min. `scope`/`projectIds` only narrow the key's
        own grants — they cannot widen them.
      operationId: exchangePlatformKeyForToken
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OAuthTokenRequest'
      responses:
        '200':
          description: Token issued
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthTokenResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    OAuthTokenRequest:
      type: object
      required:
        - grant_type
        - client_id
        - client_secret
      additionalProperties: false
      properties:
        grant_type:
          type: string
          enum:
            - client_credentials
        client_id:
          type: string
          description: Public client id (`plt-…`).
        client_secret:
          type: string
          description: The raw platform API key (`abl_…`).
        scope:
          type: array
          items:
            type: string
        projectIds:
          type: array
          items:
            type: string
    OAuthTokenResponse:
      type: object
      required:
        - access_token
        - token_type
        - expires_in
      properties:
        access_token:
          type: string
        token_type:
          type: string
          enum:
            - Bearer
        expires_in:
          type: integer
          description: Default 900s.
        scope:
          type: string
          description: Space-delimited granted scopes.
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
      description: Plain error envelope used for 401/500 across this API.
  responses:
    Unauthorized:
      description: Authentication failure
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.