Overview
Creates a new API key for the current tenant. API keys are used to authenticate webhook deliveries and API requests that cannot use a JWT token.
Required role: admin or owner
The plaintextKey is returned only once in this response. Store it securely immediately. If you lose the key, revoke it and create a new one — there is no way to recover the plaintext value after this request completes.
Request body
A descriptive name for the key to help identify its purpose. Example: "Datadog webhook" or "Production monitoring".
Response
Returns 201 Created with the new API key details, including the plaintext key.
{
"keyId": "key_01HX9VTPQR3KF8MZWBYD5N6JCE",
"name": "Datadog webhook",
"prefix": "cflo_abc",
"plaintextKey": "cflo_abc_live_sk_01HX9VTPQR3KF8MZWBYD5N6JCE_secret"
}
| Field | Type | Description |
|---|
keyId | string | Unique identifier for the API key |
name | string | The descriptive name you provided |
prefix | string | The first few characters of the key, used to identify it in the dashboard |
plaintextKey | string | The full API key value. Returned only once — store this immediately and securely. |
Error responses
| Status | Error code | Description |
|---|
400 | validation_error | The name field is missing or fails validation |
403 | forbidden | The authenticated user does not have admin or owner role |
Examples
curl https://api.causeflow.ai/v1/api-keys \
-X POST \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Datadog webhook"
}'