logo
WorkspacesCreate workspace API key

Create workspace API key

Generate a new API key (sk_...) for the workspace. A workspace can only have one API key at a time — returns 409 if one already exists.

Requires a platform API key (sk_user_...). Workspace keys are rejected with 403. Only owners and admins can manage API keys.

curl -X POST "https://api.sendkit.ai/v1/workspaces/example_string/api-key" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_API_KEY"
{
  "success": true,
  "data": {
    "apiKey": "sk_a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4",
    "createdAt": "2025-06-01T10:30:00.000Z",
    "createdBy": "664f0a1b2c3d4e5f6a7b8c9d"
  }
}
POST
/v1/workspaces/{workspaceId}/api-key
POST
API Key (header: X-Api-Key)
X-Api-Keystring
Required

Platform API key (sk_user_...) only. Workspace keys are rejected.

Platform API key (sk_user_...) only. Workspace keys are rejected.
Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-Api-Keystring
Required

API Key for authentication. Platform API key (sk_user_...) only. Workspace keys are rejected.

Path Parameters

Responses