curl "https://developer.encrata.com/api/account/keys" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
[
{
"id": "a1b2c3d4-0000-4000-8000-000000000000",
"name": "Production",
"key_prefix": "enc_0be0a9a0",
"is_active": true,
"disabled_by_admin": false,
"created_at": "2024-01-15T10:00:00Z",
"last_used_at": "2024-03-01T14:30:00Z",
"credits_used": 980,
"credit_limit": null,
"creator_email": "jane@example.com",
"revealable": true
}
]
{
"success": false,
"result": { "code": "unauthorized" },
"message": "Unauthorized",
"request_id": "req_7f3a9c21",
"error": "Unauthorized"
}
API Keys
List API Keys
List the API keys you can see, newest first.
GET
/
api
/
account
/
keys
curl "https://developer.encrata.com/api/account/keys" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
[
{
"id": "a1b2c3d4-0000-4000-8000-000000000000",
"name": "Production",
"key_prefix": "enc_0be0a9a0",
"is_active": true,
"disabled_by_admin": false,
"created_at": "2024-01-15T10:00:00Z",
"last_used_at": "2024-03-01T14:30:00Z",
"credits_used": 980,
"credit_limit": null,
"creator_email": "jane@example.com",
"revealable": true
}
]
{
"success": false,
"result": { "code": "unauthorized" },
"message": "Unauthorized",
"request_id": "req_7f3a9c21",
"error": "Unauthorized"
}
Authentication
Requires an API key in theAuthorization header.
Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Scope depends on your workspace. When a workspace is active, this returns
every key in the workspace, including other members’ keys and their metadata.
Outside a workspace it returns only your own keys.
Request
No request body required.Example request
curl "https://developer.encrata.com/api/account/keys" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Response
Returns a JSON array of API key objects (not wrapped in an object), ordered newest first and capped at 500 entries.The key’s database id. Use this - never
key_prefix - when renaming, toggling, limiting, or revoking a key.Whether the key is currently active. Revoked and disabled keys both return
false, so this field does not distinguish them.Email of the workspace member who created the key. The literal
removed user when that member no longer exists.Errors
Errors return the shared envelope withsuccess, result.code, message, and
request_id. A legacy error key is included alongside it.
| Status | Cause |
|---|---|
401 | Missing or invalid API key |
429 | Rate limit exceeded. See Rate limits |
curl "https://developer.encrata.com/api/account/keys" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
[
{
"id": "a1b2c3d4-0000-4000-8000-000000000000",
"name": "Production",
"key_prefix": "enc_0be0a9a0",
"is_active": true,
"disabled_by_admin": false,
"created_at": "2024-01-15T10:00:00Z",
"last_used_at": "2024-03-01T14:30:00Z",
"credits_used": 980,
"credit_limit": null,
"creator_email": "jane@example.com",
"revealable": true
}
]
{
"success": false,
"result": { "code": "unauthorized" },
"message": "Unauthorized",
"request_id": "req_7f3a9c21",
"error": "Unauthorized"
}
Was this page helpful?