API reference

POST/v1/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`

Base URL
https://api.cutedyno.com
Permission
connections:write
Idempotency
Send an Idempotency-Key header so a retry cannot apply twice. How it works

Request

curl -X POST "https://api.cutedyno.com/v1/api-keys" \
  -H "Authorization: Bearer $CUTEDYNO_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Acme Corp",
  "profileIds": [
    "string"
  ],
  "expiresIn": 0,
  "allowedAccountIds": [
    "string"
  ],
  "maxPostsPerDay": 0,
  "requireApproval": false
}'

Headers

Idempotency-Keystringoptional

A unique key so a retried request is not applied twice. Stored for 24 hours.

Body

namestringrequired

Label shown in the dashboard.

scopeobjectoptional

Defaults to full.

profileIdsstring[]optional

Restrict the key to these profiles. Omit for access to every profile in the account.

expiresInintegeroptional

Days until the key expires. Omit for no expiry.

allowedAccountIdsstring[]optional

Restrict the key to these connected accounts.

maxPostsPerDayintegeroptional

Cap posts created per UTC day with this key.

requireApprovalbooleanoptional

Force posts from this key through approval.

Response

Returns 201 with the following body.

ApiKeyrequired
secretstringrequired

The only time the full key is returned.

messagestringrequired

Example

{
  "key": {
    "id": "a1b2c3d4-0000-4000-8000-000000000000",
    "name": "Acme Corp",
    "keyPrefix": "string",
    "scope": "full",
    "profileIds": [
      "string"
    ],
    "expiresAt": "string",
    "createdAt": "string"
  },
  "secret": "whsec_2f8a...",
  "message": "Shipping today."
}

Errors

Failures use the standard error envelope. Branch on code, never on the message.

StatusCodeWhen it happens
400invalid_requestThe request body or query string failed validation. The message names the offending field.
401invalid_api_keyThe key does not exist, was revoked, or is malformed. Keys start with cdyn_live_.
403insufficient_permissionThe key is missing the scope this endpoint needs, for example posts:write on a readonly key.
403profile_not_accessibleThe requested profile is outside this key’s scope, or belongs to another account.
429rate_limit_exceededToo many requests for this key. Honour the Retry-After header before retrying.
500internal_errorSomething failed on our side. Retry with the same Idempotency-Key; report the requestId if it persists.