Skip to main content
POST
/
v1
/
api-keys
Create API key
curl --request POST \
  --url https://api.example.com/v1/api-keys \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>"
}
'

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

name
string
required
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"
}
FieldTypeDescription
keyIdstringUnique identifier for the API key
namestringThe descriptive name you provided
prefixstringThe first few characters of the key, used to identify it in the dashboard
plaintextKeystringThe full API key value. Returned only once — store this immediately and securely.

Error responses

StatusError codeDescription
400validation_errorThe name field is missing or fails validation
403forbiddenThe 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"
  }'