Docs/API Keys

API Keys

API keys are scoped to a project and control access to the upload API. Each key can be restricted to specific destinations.

Key Format

API keys use the aptr_ prefix followed by a random string. Keys are only shown in full once at creation time.

aptr_{env}_{random}

Important

The plain-text key is only returned when the key is created. Store it securely — it cannot be retrieved again.

List Keys

GET/api/v1/projects/:projectId/keys

Retrieve all API keys for a project.

curl https://api.apertur.ca/api/v1/projects/proj_.../keys \
  -H "Authorization: Bearer aptr_live_xxxx"

Create a Key

POST/api/v1/projects/:projectId/keys

Generate a new API key for a project.

FieldTypeDescription
labelstringHuman-readable label for the key
maxImagesintegerMaximum number of images allowed per session (optional)
curl -X POST https://api.apertur.ca/api/v1/projects/proj_.../keys \
  -H "Authorization: Bearer aptr_live_xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "Production",
    "maxImages": 100
  }'

# Response includes plainTextKey — save it, it is only shown once!
# { "key": { "id": "key_..." }, "plainTextKey": "aptr_live_z9y8x7..." }

Assign Destinations

PUT/api/v1/keys/:keyId/destinations

Bind specific destinations to a key. Sessions created with this key will deliver images only to these destinations. Optionally enable long polling.

curl -X PUT https://api.apertur.ca/api/v1/keys/key_.../destinations \
  -H "Authorization: Bearer aptr_live_xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "destination_ids": ["dest_abc", "dest_def"],
    "long_polling": true
  }'
API Keys | Documentación de la API | Apertur