AdminProvision a key for any tenant

Provision a key for any tenant

Provision a key for any tenant — superadmin only. Accepts the same name, scope, and expires_days fields as POST /v1/keys.

curl -X POST "https://api.autopil.ai/v1/admin/tenants/example_string/keys" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
  "name": "John Doe",
  "scope": "admin",
  "expires_days": 42
}'
{
  "key_id": "example_string",
  "name": "John Doe",
  "key": "example_string",
  "scope": "admin",
  "expires_at": "2024-12-25T10:00:00Z",
  "created_at": "2024-12-25T10:00:00Z"
}
POST
/v1/admin/tenants/{tenant_id}/keys
POST
Base URLstring

Target server for requests. Edit to use your own host.

API Key (header: X-API-Key)
X-API-Keystring
Required

API key with admin, read, or evaluate scope. Missing key → 401; invalid or revoked key → 403.

API key with admin, read, or evaluate scope. Missing key → 401; invalid or revoked key → 403.
Content-Typestring
Required

The media type of the request body

Options: application/json
scopestring
Options: admin, read, evaluate
Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-API-Keystring
Required

API Key for authentication. API key with admin, read, or evaluate scope. Missing key → 401; invalid or revoked key → 403.

Path Parameters

Body

application/json
scopestring
Allowed values:adminreadevaluate

Responses