Skip to content

Get started

Errors

Every failure returns the same envelope. Branch on code; messages can change without notice.

{ "error": { "code": "quota_exceeded", "message": "…" } }

Status scheme: 400 malformed JSON, 401 auth, 403 plan or account state, 404 missing or not yours, 422 validation, 429 limits, 503 retryable.

Error catalog#

StatusCodeMeaning
400invalid_jsonRequest body is not valid JSON
401unauthorizedMissing, invalid or revoked API key
403email_unverifiedVerify your account email before using the API
403plan_requiredYour plan does not include API access
403code_limit_reachedPlan code-count limit reached (POST /codes)
404not_foundNo code with that id in your account
422invalid_typetype is not one of the creatable types
422unsupported_typePDF codes need a file upload; create them in the dashboard
422invalid_destinationdestination is not a valid http(s) URL
422unsafe_destinationdestination failed the malware/phishing check
422destination_not_editableOnly url codes have an editable destination
422content_not_editablecontent applies to page codes only
422invalid_statusstatus must be active or paused
422empty_patchPATCH body had no recognized fields
422invalid_codesbulk: codes must be a non-empty array
422batch_too_largebulk: more than 100 specs in one request
429rate_limitedBurst limit: over 60 requests in 10 seconds
429quota_exceededMonthly quota used up; resets on the 1st (UTC)
503slug_unavailableCould not allocate a short link; retry the request

Retries#

Requests are not idempotent. A network retry of a POST can create a duplicate code; on timeout, list your codes before retrying. 503 slug_unavailable is safe to retry after a short delay.