Errors

All errors share one JSON format and a stable error.code. Handle errors by code, not by the message text.

{
  "error": {
    "code": "invalid_request",
    "message": "\"url\" must be a valid absolute URL.",
    "status": 400,
    "details": { "field": "url" }
  },
  "requestId": "req_3f9a1c7e5b2d4a6f80"
}

Codes

StatuscodeWhat to do
400invalid_request, invalid_jsonfix the request; details.field names the field
401missing_api_key, invalid_api_key, api_key_revoked, api_key_expiredcheck or renew the key
403insufficient_scopecreate a key with the scope in details.requiredScope
403content_policy_requiredaccept the content policy once in the dashboard
403verification_requiredthe account needs additional verification; complete it in the dashboard
403account_inactive, api_key_suspended, ip_not_allowedcontact support or check the IP list
404not_foundthe link does not exist or belongs to another account
409title_taken, short_code_takenuse another title or short code
422url_not_allowed, url_shortener_not_resolveddestination not allowed
429rate_limited, daily_quota_exceededwait for Retry-After
5xxinternal_error, upstream_unavailable, service_unavailableretry with backoff; if it persists, contact support with the requestId

Pagination

Lists use a cursor: pass nextCursor as cursor to get the next page; it is null when there are no more. limit accepts 1 to 100 (default 20).