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

# Create a provisioning token

> Creates a new provisioning token that can be used to onboard edge devices. The raw token is only returned once and should be saved securely.



## OpenAPI

````yaml /api-spec.json post /provisioning-tokens
openapi: 3.0.0
info:
  contact:
    name: Acusight API Support
  description: >-
    Acusight platform API - custom endpoints + Portainer proxy routes for edge
    AI deployments
  title: Acusight API
  version: 1.0.0
servers:
  - url: https://acusight.io/api
    description: AcuSight Cloud (hosted)
security: []
tags:
  - name: Devices & provisioning
    description: Register, provision, and manage edge devices and their agents.
  - name: Virtual devices
    description: Create and drive simulated devices for testing and demos.
  - name: Alerts & telemetry
    description: Model alerts, alert rules, and product telemetry.
  - name: Organization
    description: Organization-level settings.
  - name: Datasets & data
    description: Projects, batches, datasets, images, annotations, and drift.
  - name: Models & training
    description: Model registry, training jobs, exports, and inference.
  - name: Pipeline data
    description: Detection time-series and aggregated pipeline analytics.
paths:
  /provisioning-tokens:
    post:
      tags:
        - Devices & provisioning
      summary: Create a provisioning token
      description: >-
        Creates a new provisioning token that can be used to onboard edge
        devices. The raw token is only returned once and should be saved
        securely.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/handlers.CreateProvisioningTokenRequest'
        description: Token configuration
        required: true
      responses:
        '201':
          description: Token created successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/types.APIResponse'
                  - properties:
                      data:
                        $ref: >-
                          #/components/schemas/handlers.CreateProvisioningTokenResponse
                    type: object
        '400':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/types.APIResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/types.APIResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/types.APIResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    handlers.CreateProvisioningTokenRequest:
      properties:
        expires_in_days:
          description: 'optional, default: 30, null for never'
          example: 30
          type: integer
        name:
          example: Production Line 1
          type: string
        single_use:
          description: true = auto-revoke after first provisioning
          example: false
          type: boolean
      required:
        - name
      type: object
    types.APIResponse:
      properties:
        data: {}
        error:
          $ref: '#/components/schemas/types.APIError'
        meta:
          $ref: '#/components/schemas/types.APIMeta'
        success:
          type: boolean
      type: object
    handlers.CreateProvisioningTokenResponse:
      properties:
        created_at:
          example: '2024-01-15T10:30:00Z'
          type: string
        expires_at:
          example: '2024-02-14T10:30:00Z'
          type: string
        id:
          example: 550e8400-e29b-41d4-a716-446655440000
          type: string
        name:
          example: Production Line 1
          type: string
        setup_command:
          example: >-
            curl -sSL https://api.acusight.io/setup | sudo sh -s --
            apt_abc123...
          type: string
        single_use:
          example: false
          type: boolean
        token:
          example: apt_abc123...
          type: string
      type: object
    types.APIError:
      properties:
        code:
          type: string
        details:
          type: string
        message:
          type: string
      type: object
    types.APIMeta:
      properties:
        count:
          type: integer
        limit:
          type: integer
        offset:
          type: integer
        total:
          type: integer
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT access token. Paste the token only; the Bearer prefix is added
        automatically.

````