Skip to main content
POST
/
core
/
provisioning-tokens
curl -X POST https://acusight.io/api/provisioning-tokens \
  -H "Authorization: Bearer <TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production Line 1",
    "expires_in_days": 7,
    "single_use": true
  }'
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Production Line 1",
    "token": "apt_a1b2c3d4e5f6...",
    "single_use": true,
    "created_at": "2024-01-15T10:30:00Z",
    "expires_at": "2024-01-22T10:30:00Z",
    "setup_command": "curl -sSL https://acusight.io/setup | sh -s -- apt_a1b2c3d4e5f6..."
  }
}
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.
The token field is only returned at creation time. Store it immediately or use the setup_command on your device right away.

Request Body

name
string
required
A descriptive name for the token (e.g., “Production Line 1”)
expires_in_days
integer
default:"30"
Number of days until the token expires. Set to null for no expiration.
single_use
boolean
default:"false"
If true, the token will be automatically revoked after the first successful device provisioning.

Response

id
string
Unique identifier for the token
name
string
The name provided when creating the token
token
string
The raw provisioning token (format: apt_<hex>). Only returned once!
single_use
boolean
Whether the token will auto-revoke after first use
created_at
string
ISO 8601 timestamp of creation
expires_at
string
ISO 8601 timestamp when the token expires (null if never)
setup_command
string
Ready-to-use shell command for device setup
curl -X POST https://acusight.io/api/provisioning-tokens \
  -H "Authorization: Bearer <TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production Line 1",
    "expires_in_days": 7,
    "single_use": true
  }'
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Production Line 1",
    "token": "apt_a1b2c3d4e5f6...",
    "single_use": true,
    "created_at": "2024-01-15T10:30:00Z",
    "expires_at": "2024-01-22T10:30:00Z",
    "setup_command": "curl -sSL https://acusight.io/setup | sh -s -- apt_a1b2c3d4e5f6..."
  }
}