Clarify API
Api Keys

Create an API key

Creates an API key and returns it as a JSON:API resource whose `cleartext_api_key` holds the secret, shown only this once. Requires a user access token, because an API key cannot create another API key. Only admins can create `workspace` keys.

POST
/workspaces/{workspace}/api-keys
AuthorizationBearer <token>

User access token authentication for endpoints that act across workspaces. Send a WorkOS access token in the Authorization header as: Bearer <token>.

In: header

Path Parameters

workspace*string

The workspace slug — the {slug} segment of your Clarify workspace URL.

Query Parameters

silent?boolean

When true, suppresses in-app and Slack notifications for this mutation.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/workspaces/string/api-keys" \  -H "Content-Type: application/json" \  -d '{    "data": {      "type": "api-key",      "attributes": {        "name": "Acme CRM sync",        "scopes": [],        "actor_type": "user"      }    }  }'
{  "data": {    "type": "api-key",    "id": "4a7c2e9f-6b1d-4e3a-8f5c-0d2b4e6a8c19",    "attributes": {      "_id": "4a7c2e9f-6b1d-4e3a-8f5c-0d2b4e6a8c19",      "name": "Acme CRM sync",      "key_prefix": "3f9a1c7e",      "scopes": [],      "actor": {        "type": "user",        "id": "7d4e2f9a-1b3c-4d5e-8f6a-9c0b2d4e6f81"      },      "on_behalf_of": null,      "hidden": false,      "_created_by": "7d4e2f9a-1b3c-4d5e-8f6a-9c0b2d4e6f81",      "expires_at": null,      "_created_at": "2026-01-15T09:30:00.000Z",      "_updated_at": "2026-01-15T09:30:00.000Z",      "last_used_at": null,      "cleartext_api_key": "example00000000000000000000000000"    }  }}