Skip to content

Developer portal

POST /admin/tenants/{tenant_id}/keys

Issue a new API key for a tenant with scoped role and optional expiry.

POST /admin/tenants/{tenant_id}/keysAuth: admin

Summary

Issue a new API key for a tenant with scoped role and optional expiry.

Example

Response

{
  "status": "success",
  "key_id": "key_01J9W7T8EJ",
  "api_key": "qt_live_****************",
  "role": "operator"
}

Request body

FieldTypeRequiredDescription
labelstringYes

Human-readable key label for inventory and audits.

e.g. staging-ci

role"viewer" | "operator" | "admin"No (operator)

Role bound to the issued API key.

Errors

CodeMeaningTypical causeSuggested fix
404Not foundScan, schedule, share link, or resource id does not exist or expired.Verify id and tenant scope; share links expire per expiresHours.
422Unprocessable entityInvalid payload shape, unsupported scenario, or infeasible constraints.Fix field errors in response detail; relax constraints and retry.
429Too many requestsPer-key rate limit exceeded (default 300 requests per minute) or public endpoint limit.Backoff with jitter; cache results; request higher limit for production.
500Internal server errorUnexpected backend failure; includes requestId in response.Retry with exponential backoff; contact support with requestId if persistent.

See the full errors reference.