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

# Create review API token

> Create a company-scoped review API token with read and write scopes.

<Warning>
  This endpoint returns the raw token value once. Store it securely when you create it.
</Warning>


## OpenAPI

````yaml POST /v1/auth/tokens
openapi: 3.1.0
info:
  title: Propel API
  description: >-
    API for managing review API tokens and running asynchronous diff-based code
    reviews.
  version: 1.0.0
servers:
  - url: https://api.propelcode.ai
    description: Production
  - url: http://localhost:6060
    description: Local
security: []
paths:
  /v1/auth/tokens:
    post:
      summary: Create review API token
      description: Creates a company-scoped review API token.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateReviewTokenRequest'
      responses:
        '201':
          description: Token created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateReviewTokenResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - jwtAuth: []
components:
  schemas:
    CreateReviewTokenRequest:
      type: object
      required:
        - name
        - scopes
      properties:
        name:
          type: string
          description: Token display name.
        scopes:
          type: array
          minItems: 1
          items:
            type: string
            enum:
              - reviews:read
              - reviews:write
        expires_in_days:
          type: integer
          minimum: 1
          maximum: 365
          description: Optional token lifetime in days.
      additionalProperties: false
    CreateReviewTokenResponse:
      type: object
      required:
        - token_id
        - token
        - name
        - scopes
      properties:
        token_id:
          type: integer
        token:
          type: string
        name:
          type: string
        scopes:
          type: array
          items:
            type: string
        expires_at:
          type: string
          format: date-time
      additionalProperties: false
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        message:
          type: string
      additionalProperties: true
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      description: Dashboard authentication token.

````