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

# Create Token



## OpenAPI

````yaml post /api/enrollment-tokens
openapi: 3.1.0
info:
  title: Axion Backend API
  description: Backend API for Axion platform with desktop automation capabilities
  version: 1.0.0
servers:
  - url: https://api.getgranite.ai
    description: Production server
  - url: http://localhost:8000
    description: Local development server
security: []
tags:
  - name: Authentication
    description: User authentication and session management
  - name: Organizations
    description: Organization management and membership
  - name: Health
    description: API health and status monitoring
  - name: Automations
    description: Automation planning and execution
  - name: MIG
    description: Managed Instance Group operations
  - name: Agent
    description: Agent execution and streaming
  - name: Onboarding
    description: Organization onboarding flow
  - name: Organization Automations
    description: Organization automation endpoint management
  - name: Organization Endpoints
    description: Public endpoints for organization automations
  - name: Analytics
    description: Analytics and reporting endpoints
paths:
  /api/enrollment-tokens:
    post:
      tags:
        - enrollment
      summary: Create Enrollment Token
      operationId: create_enrollment_token_api_enrollment_tokens_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEnrollmentTokenRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnrollmentTokenResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreateEnrollmentTokenRequest:
      properties:
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description/label for the token
        expires_in_hours:
          type: integer
          title: Expires In Hours
          description: Hours until token expires (default 24)
          default: 24
      type: object
      title: CreateEnrollmentTokenRequest
      description: Request to create an enrollment token for driver registration
    EnrollmentTokenResponse:
      properties:
        token:
          type: string
          title: Token
          description: Enrollment token string
        org_id:
          type: string
          title: Org Id
          description: Organization ID
        expires_at:
          type: string
          format: date-time
          title: Expires At
          description: Token expiration timestamp
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Token description
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Creation timestamp
        used:
          type: boolean
          title: Used
          description: Whether token has been used
        is_valid:
          type: boolean
          title: Is Valid
          description: Whether token is still valid for use
      type: object
      required:
        - token
        - org_id
        - expires_at
        - created_at
        - used
        - is_valid
      title: EnrollmentTokenResponse
      description: Enrollment token details
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````