API keys
Create an API key
Mints a key, optionally scoped to specific profiles. The secret is returned once and cannot be retrieved later.
Required permission: `connections:write`
POST
/v1/api-keysconnections:writeRequest
Authorization
Send your API key as a Bearer token in the Authorization header.
Headers
Idempotency-KeystringoptionalA unique key so a retried request is not applied twice. Stored for 24 hours.
Request body
namestringrequiredLabel shown in the dashboard.
profileIdsstring[]optionalRestrict the key to these profiles. Omit for access to every profile in the account.
expiresInintegeroptionalDays until the key expires. Omit for no expiry.
allowedAccountIdsstring[]optionalRestrict the key to these connected accounts.
maxPostsPerDayintegeroptionalCap usage per UTC day with this key.
Response
Returns 201.
ApiKeyrequired
secretstringrequiredThe only time the full key is returned.
messagestringrequiredErrors
Failures use the standard error format.
| Status | Code | When it happens |
|---|---|---|
| 400 | invalid_request | The request body or query string failed validation. The message names the offending field. |
| 401 | invalid_api_key | The key does not exist, was revoked, or is malformed. Keys start with cdyn_live_. |
| 403 | insufficient_permission | The key is missing the scope this endpoint needs, for example posts:write on a readonly key. |
| 403 | profile_not_accessible | The requested profile is outside this key’s scope, or belongs to another account. |
| 429 | rate_limit_exceeded | Too many requests for this key. Honour the Retry-After header before retrying. |
| 500 | internal_error | Something failed on our side. Retry with the same Idempotency-Key; report the requestId if it persists. |