API Keys
Create, list, archive and reactivate API keys
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /organizations/api-keys | List all keys (active and optionally archived) |
| POST | /organizations/api-keys | Create a new key — raw value returned once |
| DELETE | /organizations/api-keys/{id} | Archive a key (soft delete — reversible) |
| PUT | /organizations/api-keys/{id}/reactivate | Reactivate an archived key |
List Keys
GET
/organizations/api-keysList all keys (active and optionally archived)
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
include_archived | boolean | Optional | Include archived keys in results.Default: false |
Response
json
{
"api_keys": [
{
"id": 42,
"name": "Production",
"prefix": "sk_live_abc1",
"created_at": "2026-06-01T10:00:00Z",
"last_used_at": "2026-06-26T14:22:00Z",
"archived_at": null
}
]
}Create a Key
POST
/organizations/api-keysCreate a new key — raw value returned once
Request Body
json
{ "name": "Production" }Response
json
{
"id": 42,
"name": "Production",
"prefix": "sk_live_abc1",
"key": "sk_live_abc1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"created_at": "2026-06-26T10:00:00Z",
"last_used_at": null
}The
key field contains the raw secret and is shown exactly once. Store it securely immediately — it cannot be recovered.Archive a Key
DELETE
/organizations/api-keys/{id}Archive a key (soft delete — reversible)
This is a soft delete — the key is archived, not permanently removed. All existing requests using the key will fail with
401. The key can be reactivated.Reactivate a Key
PUT
/organizations/api-keys/{id}/reactivateReactivate an archived key
Restores a previously archived key to active status. No request body required.
Best Practices
- Use one key per integration — easier to audit and revoke per service
- Name keys descriptively:
"Claude Desktop","n8n Production","Staging" - Store keys in environment variables, never in source code
- Archive, don't delete — preserves the audit history (
last_used_at) for security reviews - Review
last_used_atperiodically to identify stale keys
Was this page helpful?
Open Dashboard →