API Keys
API keys provide authentication for the WebAPI external endpoints. Each key is tied to a firm and grants ADMIN-level access for that firm’s resources.Create API Key
Generate a new API key for a firm. Only users withSUPERUSER or WORKFLOW_ENGINEER roles can create keys.
The full API key is returned only once at creation. Store it securely — it cannot be retrieved later.
Request
Body
UUID of the firm to create the key for.
Response 201 Created
How It Works
- Permission check — User must have
SUPERUSERorWORKFLOW_ENGINEERrole - Firm lookup — The firm is found by
firm_uuid - Existing key check — Verifies the firm doesn’t already have an active key
- API user creation — If the firm doesn’t have an API user (
web_api_only = true), one is created withADMINrole - Key generation — Prefix from the first 7 characters of the firm UUID + hashed portion, in format:
{prefix}${hash} - Storage — The key is hashed and saved; only the prefix is stored in plain text
Errors
| Code | Description |
|---|---|
403 Forbidden | Insufficient permissions |
404 Not Found | Firm not found |
409 Conflict | Firm already has an active key |
List API Keys
Retrieve all active API keys (without the full key value).Request
Query Parameters
Page number (starting from 1).
Number of items per page.
Response 200 OK
The full
api_key is never returned in list responses — only the key_prefix.Errors
| Code | Description |
|---|---|
403 Forbidden | Insufficient permissions (requires SUPERUSER) |
Delete API Key
Soft-delete an API key. The key is marked as deleted and disabled.Request
Path Parameters
UUID of the API key to delete.
Response 204 No Content
Empty response body.
How It Works
- Permission check — User must have
SUPERUSERrole - Key lookup — Find the key by UUID
- Soft delete — Sets
deleted_atto current time andenabledtofalse
Errors
| Code | Description |
|---|---|
403 Forbidden | Insufficient permissions |
404 Not Found | Key not found |