curl --request POST \
--url https://api.questra.ai/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Org-Id: <x-org-id>' \
--data '
{
"name": "Production Integration",
"expires_at": "2026-01-15T12:00:00Z"
}
'{
"id": "ak_2xyzABC123",
"name": "Production Integration",
"created_at": "2025-01-15T12:00:00Z",
"expires_at": "2026-01-15T12:00:00Z",
"revoked": false,
"expired": false,
"last_used_at": "2025-06-01T09:30:00Z",
"secret": "sk_live_abc123..."
}Creates a new API key for the authenticated user. The secret field is only returned once in this response — it cannot be retrieved again. Copy it to a secure location immediately.
curl --request POST \
--url https://api.questra.ai/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Org-Id: <x-org-id>' \
--data '
{
"name": "Production Integration",
"expires_at": "2026-01-15T12:00:00Z"
}
'{
"id": "ak_2xyzABC123",
"name": "Production Integration",
"created_at": "2025-01-15T12:00:00Z",
"expires_at": "2026-01-15T12:00:00Z",
"revoked": false,
"expired": false,
"last_used_at": "2025-06-01T09:30:00Z",
"secret": "sk_live_abc123..."
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body for creating a new API key.
A descriptive label for the key — e.g. the application or environment it will be used in.
1"Production Integration"
ISO 8601 datetime at which the key should expire. Must be in the future. Omit to create a non-expiring key.
"2026-01-15T12:00:00Z"
The newly created API key, including its secret.
An API key belonging to the authenticated user.
Unique identifier for the API key.
"ak_2xyzABC123"
The human-readable label you assigned to the key.
"Production Integration"
ISO 8601 timestamp of when the key was created.
"2025-01-15T12:00:00Z"
ISO 8601 timestamp of when the key expires, or null if it never expires.
"2026-01-15T12:00:00Z"
Whether the key has been manually revoked. Revoked keys cannot authenticate requests.
false
Whether the key has passed its expires_at date.
false
ISO 8601 timestamp of the most recent request authenticated with this key, or null if it has never been used.
"2025-06-01T09:30:00Z"
The raw secret value. Only returned when the key is first created — it cannot be retrieved again. Store it somewhere safe immediately.
"sk_live_abc123..."