API Keys
API keys grant programmatic access to your workspace. Each key is scoped to a workspace and inherits the permissions of the creator. Keys can be given an optional expiry date.
Create Key
POST
/workspaces/{wsId}/api-keysCreates a new API key. The secret value is returned only once - store it securely immediately after creation.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | required | Human-readable label for the key (e.g. Production, CI/CD) |
| expiresAt | string (ISO 8601) | optional | Optional expiration timestamp. Key never expires if omitted. |
Response
json
{
"id": "key_01hx...",
"name": "Production key",
"secret": "dor_sk_01hx...",
"prefix": "dor_sk_01hx",
"expiresAt": "2026-01-01T00:00:00Z",
"createdAt": "2025-04-17T12:00:00Z"
}Warning: The
secret field is only returned once. Copy and store it immediately - it cannot be retrieved later.bash
curl -X POST "https://os-develop.dooor.ai/api/v1/workspaces/{wsId}/api-keys" \
-H "Authorization: Bearer dor_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Production key",
"expiresAt": "2026-01-01T00:00:00Z"
}'List Keys
GET
/workspaces/{wsId}/api-keysReturns all active API keys for the workspace. The secret value is never returned in list responses.
Response
json
[
{
"id": "key_01hx...",
"name": "Production key",
"prefix": "dor_sk_01hx",
"lastUsedAt": "2025-04-16T09:30:00Z",
"expiresAt": "2026-01-01T00:00:00Z",
"createdAt": "2025-04-17T12:00:00Z"
}
]bash
curl -X GET "https://os-develop.dooor.ai/api/v1/workspaces/{wsId}/api-keys" \
-H "Authorization: Bearer dor_sk_your_key_here"Revoke Key
DELETE
/workspaces/{wsId}/api-keys/{keyId}Permanently revokes an API key. All subsequent requests using this key will receive 401 Unauthorized. This action cannot be undone.
Response
json
{
"id": "key_01hx...",
"name": "Production key",
"revokedAt": "2025-04-17T15:00:00Z"
}bash
curl -X DELETE "https://os-develop.dooor.ai/api/v1/workspaces/{wsId}/api-keys/{keyId}" \
-H "Authorization: Bearer dor_sk_your_key_here"