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

# Create a personal access token

> Create a customer token with an interactive user JWT. The token value is returned once; preserve it before leaving the response.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/users/{user_id}/personal-access-tokens
openapi: 3.1.0
info:
  title: Synth API Reference
  version: 2026-08-23.alpha
  description: HTTP API for your account, tasks, datasets, agent runs and usage.
servers:
  - url: https://sprites-gateway.api.synthlabs.ai
    description: Synth API
security: []
tags:
  - name: Identity
    description: Manage customer tokens without exposing internal service credentials.
  - name: Registry
    description: >-
      Create, discover, set visibility, version, execute, and inspect results
      for Harbor-compatible tasks and datasets.
  - name: Managed execution
    description: Validate, run, observe, and retrieve Harbor-compatible managed work.
  - name: Usage
    description: Inspect authoritative current rolling quota.
paths:
  /api/v1/users/{user_id}/personal-access-tokens:
    post:
      tags:
        - Identity
      summary: Create a personal access token
      description: >-
        Create a customer token with an interactive user JWT. The token value is
        returned once; preserve it before leaving the response.
      operationId: createPersonalAccessToken
      parameters:
        - in: path
          name: user_id
          required: true
          schema:
            format: uuid
            title: User Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PersonalAccessTokenCreate'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PersonalAccessTokenCreateResponse'
          description: Successful Response
        '401':
          description: Interactive login is missing, invalid, or expired
        '403':
          description: >-
            Caller is not the requested user, used a PAT/API key, or no longer
            has active organization membership
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PersonalAccessTokenCreateConflictResponse'
          description: >-
            Active PAT limit reached, or this creation_request_id already
            committed; the latter returns safe revoke-before-retry metadata
            without token material
        '422':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/HTTPValidationError'
                  - properties:
                      detail:
                        title: Detail
                        type: string
                    required:
                      - detail
                    title: PatCreateOrgClaimError
                    type: object
          description: >-
            Request validation failed or the login lacks a top-level
            `organization_id` claim
        '429':
          description: Organization write rate limit exceeded
        '503':
          description: PAT storage is temporarily unavailable
      security:
        - UserBearer: []
components:
  schemas:
    PersonalAccessTokenCreate:
      description: Create a revocable user credential for headless Synth access.
      properties:
        creation_request_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: >-
            Client-generated correlation ID for one logical create. While the
            correlated PAT is active, reuse returns a safe conflict summary for
            revoke-before-retry and never replays the raw token. Recent inactive
            rows remain correlatable until bounded history pruning removes them.
          title: Creation Request Id
        expires_in_days:
          default: 30
          maximum: 365
          minimum: 1
          title: Expires In Days
          type: integer
        name:
          maxLength: 80
          minLength: 1
          title: Name
          type: string
        scopes:
          items:
            const: gateway:user
            enum:
              - gateway:user
            type: string
          maxItems: 1
          minItems: 1
          title: Scopes
          type: array
      required:
        - name
      title: PersonalAccessTokenCreate
      type: object
    PersonalAccessTokenCreateResponse:
      description: Creation response; the raw token appears exactly once.
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        creation_request_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Creation Request Id
        expires_at:
          format: date-time
          title: Expires At
          type: string
        id:
          format: uuid
          title: Id
          type: string
        last_used_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Last Used At
        name:
          title: Name
          type: string
        organization_id:
          format: uuid
          title: Organization Id
          type: string
        revoked_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Revoked At
        scopes:
          items:
            enum:
              - gateway:user
              - inference:invoke
            type: string
          title: Scopes
          type: array
        token:
          pattern: ^synth_pat_[A-Za-z0-9_-]{43}$
          title: Token
          type: string
        token_ref:
          pattern: ^tok_[0-9a-f]{8}$
          title: Token Ref
          type: string
      required:
        - id
        - organization_id
        - name
        - token_ref
        - scopes
        - created_at
        - expires_at
        - token
      title: PersonalAccessTokenCreateResponse
      type: object
    PersonalAccessTokenCreateConflictResponse:
      description: >-
        Safe 409 response; populated recovery fields never contain secret
        material.
      properties:
        creation_request_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Creation Request Id
        detail:
          title: Detail
          type: string
        existing_token:
          anyOf:
            - $ref: '#/components/schemas/PersonalAccessTokenSummary'
            - type: 'null'
        recovery:
          anyOf:
            - enum:
                - revoke_existing_token_before_retry
                - use_new_creation_request_id
              type: string
            - type: 'null'
          title: Recovery
      required:
        - detail
      title: PersonalAccessTokenCreateConflictResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    PersonalAccessTokenSummary:
      description: Safe token metadata; never includes raw or hashed secret material.
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        creation_request_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Creation Request Id
        expires_at:
          format: date-time
          title: Expires At
          type: string
        id:
          format: uuid
          title: Id
          type: string
        last_used_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Last Used At
        name:
          title: Name
          type: string
        organization_id:
          format: uuid
          title: Organization Id
          type: string
        revoked_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Revoked At
        scopes:
          items:
            enum:
              - gateway:user
              - inference:invoke
            type: string
          title: Scopes
          type: array
        token_ref:
          pattern: ^tok_[0-9a-f]{8}$
          title: Token Ref
          type: string
      required:
        - id
        - organization_id
        - name
        - token_ref
        - scopes
        - created_at
        - expires_at
      title: PersonalAccessTokenSummary
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    UserBearer:
      description: Synth customer access token for the current user and organization.
      scheme: bearer
      type: http

````

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