Aidelly Docs
REST API

Error Catalog

Machine-readable error codes returned by the Aidelly API.

Use error.code as your primary branching signal — it is stable across API versions. error.message is human-readable and may change.

Auth and scope errors

CodeStatusMeaningTypical CauseRetry
PUBLIC_API_AUTH_REQUIRED401Missing bearer tokenAuthorization header missing or malformedNon-retryable until auth fixed
PUBLIC_API_KEY_INVALID401API key not recognizedWrong key, revoked key, typo, wrong environmentNon-retryable until key fixed
PUBLIC_API_KEY_EXPIRED401API key expiredKey has expires_at in the pastNon-retryable until key rotated
PUBLIC_API_SCOPE_FORBIDDEN403Key lacks required scope(s)Missing scopes during key creationNon-retryable until scope/key fixed
PUBLIC_API_WORKSPACE_FORBIDDEN403Workspace access deniedHeader scope does not match key or ownershipNon-retryable until scope/key fixed
PUBLIC_API_BRAND_FORBIDDEN403Brand access deniedHeader scope does not match key or ownershipNon-retryable until scope/key fixed
PUBLIC_API_CONTEXT_ERROR500Scope resolution failed server-sideTemporary DB/service failureRetry with backoff
PUBLIC_API_AUTH_ERROR500Key validation failed server-sideTemporary DB/service failure during key lookupRetry with backoff

Request, rate limit, and idempotency errors

CodeStatusMeaningTypical CauseRetry
PUBLIC_API_RATE_LIMITED429Rate limit exceededBurst exceeded plan windowRetry using Retry-After header
PUBLIC_API_IDEMPOTENCY_REQUIRED400Missing Idempotency-Key on writeHeader omitted on POST endpointRetry same payload with a key
PUBLIC_API_IDEMPOTENCY_CONFLICT409Reused key with different payloadSame key sent for a different logical writeGenerate a new key for the new write
PUBLIC_API_BODY_INVALID400Invalid JSON or schema validation errorMalformed body or invalid fieldsNon-retryable until payload fixed
PUBLIC_API_QUERY_INVALID400Invalid query parametersDatetime format / enum / limit mismatchNon-retryable until query fixed

Endpoint-specific errors

POST /media/upload-url

CodeStatusMeaningRetry
PUBLIC_API_MEDIA_CREATE_FAILED500Media record could not be createdRetry with backoff
PUBLIC_API_UPLOAD_URL_FAILED500Signed upload URL generation failedRetry with backoff

GET /posts

CodeStatusMeaningRetry
PUBLIC_API_POST_LIST_FAILED500Post listing query failedRetry with backoff

POST /posts

CodeStatusMeaningRetry
PUBLIC_API_POST_CREATE_FAILED500Post persistence failedRetry with same idempotency key
PUBLIC_API_PUBLISH_FAILED422Provider publish failed but post state persistedUsually non-retryable; inspect returned post and decide on new write

GET /posts/{id}

CodeStatusMeaningRetry
PUBLIC_API_POST_FETCH_FAILED500Post fetch query failedRetry with backoff
PUBLIC_API_POST_NOT_FOUND404Post does not exist or is inaccessibleNon-retryable unless ID/scope corrected

POST /posts/{id}/cancel

CodeStatusMeaningRetry
PUBLIC_API_POST_FETCH_FAILED500Failed to load post before cancelRetry with backoff
PUBLIC_API_POST_NOT_FOUND404Target post not foundNon-retryable unless ID/scope corrected
PUBLIC_API_POST_CANCEL_INVALID_STATE409Post is already terminal (completed, failed, canceled)Non-retryable; no action needed
PUBLIC_API_POST_CANCEL_FAILED500Post cancel update failedRetry with same idempotency key

GET /social-connections

CodeStatusMeaningRetry
PUBLIC_API_CONNECTIONS_FETCH_FAILED500Connection listing query failedRetry with backoff

POST /webhooks

CodeStatusMeaningRetry
PUBLIC_API_WEBHOOK_CREATE_FAILED500Webhook create insert failedRetry with same idempotency key

GET /usage

CodeStatusMeaningRetry
PUBLIC_API_USAGE_FETCH_FAILED500Usage aggregation query failedRetry with backoff

Retry strategy

Retryable (with backoff):

  • 429PUBLIC_API_RATE_LIMITED (use Retry-After header)
  • 5xx family — *_FAILED, PUBLIC_API_CONTEXT_ERROR, PUBLIC_API_AUTH_ERROR

Non-retryable (fix the request first):

  • 400 — validation errors
  • 401 / 403 — auth or scope errors
  • 404 — resource not found or inaccessible
  • 409 — idempotency conflict or invalid state transition
  • 422 — publish failure without payload or state changes

Logging recommendations

Persist these fields for each API call:

  • request_id (from response envelope)
  • Endpoint path + HTTP method
  • error.code (if failure)
  • Idempotency key (for writes)
  • X-RateLimit-* response headers