Errors
Every failure returns JSON in the same shape, whatever went wrong.
{
"error": {
"code": "invalid_request",
"message": "accountId must be a valid UUID",
"details": [{ "path": ["accountId"], "message": "Invalid uuid" }]
}
}code is stable and safe to branch on. message is written for a human reading
a log and may change. details is present only when there is something more to
say — validation issues, or the per-account errors array from an aggregate
read.
Status codes
| Status | When |
|---|---|
200 | Success, or an aggregate read where every provider succeeded. |
201 | A resource was created — an Instagram post, a message, a connection session. |
202 | A TikTok or YouTube publish, or a Facebook video, was accepted. It is not published yet; poll for status. |
207 | An aggregate read where some providers succeeded and some failed. |
400 | The request is malformed: bad JSON, a failed schema check, a non-UUID identifier, or no profile named (profile_required). |
402 | The workspace's plan doesn't cover it: billing_required when a connect doesn't fit the plan (see Billing), usage_limit_reached when the workspace has sent its plan's posts, comments or messages (see Billing), plan_required when Free reads analytics, or x_billing_required when Free uses X (see X API pricing). |
403 | A healthy connection lacks a permission or provider-confirmed resource the feature needs: permission_required. Details include exact requirements and a restart-OAuth action. |
404 | The resource does not exist, or it exists but your key cannot reach it. |
413 | The request body is too large. |
415 | Content-Type is neither application/json nor multipart/form-data. |
422 | The request is well-formed but the operation is not possible: an unsupported platform, an expired connection, invalid media, a deferred feature. |
429 | The provider is throttling this account or app (TikTok), the account hit TikTok's daily posting limit, or YouTube's shared daily quota is spent. Retry later. |
502 | Every attempted provider failed, or a database read failed. Provider details are sanitized away. |
503 | X is unavailable to Adeli for a while: temporarily_unavailable. Retry later. |
404 covers authorization, on purpose
Supplying a profileId or accountId that belongs to another organization
returns 404, not 403. The API will not confirm that a resource exists
outside your key's organization. A profileId and accountId that disagree
also return 404 account_not_found, the same answer as an unknown account.
Error codes
Authentication and scope
unauthorized401- The Authorization header is missing, malformed, or names a key that has been deleted.
profile_required400- A profile-scoped request named no profile. Pass
profileId, or anaccountIdthat belongs to a profile.GETandPOST /api/v1/profiles,GET /api/v1/accounts, andGET /api/v1/usage/xneed neither. profile_not_found404- The
profileIddoes not exist, or it belongs to another organization.
Billing
billing_required402- Starting a connection doesn't fit the workspace's plan: on Free, a third profile, a third account on a profile, or a WhatsApp or Bluesky account; on Starter, a sixth account on a profile.
details.billingUrlis where the workspace owner chooses or upgrades a plan. The same check runs again when the connection finishes, so a connection session started with room to spare can endfailedwith thiserror.code. See Billing. usage_limit_reached402- The workspace has sent its plan's limit of the kind in
details.kind(post,messageorcomment): Free's lifetime total, or Starter's monthly one.detailsalso carrieslimit,usedandbillingUrl, and on StarterresetsAt. Free's limits never reset, soresetsAtis absent there. Don't retry: it clears once a plan is chosen or upgraded, or on Starter atresetsAt. See Billing. plan_required402- Analytics need a paid plan, and the workspace is on Free.
details.billingUrlis where the workspace owner chooses one. See Billing.
Request validation
invalid_request400 / 413- Malformed JSON, a schema failure, a non-UUID identifier, or a body over the size limit. Check
details. invalid_profile400- Profile fields failed their own checks — for example
metadataover 16 KiB. invalid_redirect_uri400- The connect
redirectUrlis malformed, insecure, or does not exactly match a URI registered under the API key organization's Settings → OAuth. See OAuth setup. unsupported_media_type415Content-Typemust beapplication/jsonormultipart/form-data.
Conflicts
profile_name_conflict409- Another profile already uses this name.
details.existingProfileIdnames it. profile_external_id_conflict409- Another profile already uses this
externalId.details.existingProfileIdnames it. idempotency_conflict409- The
Idempotency-Keywas already used with a different request body.
Accounts and connections
account_not_found404- No connected account with that id in your key's organization, or it is not on the
profileIdyou also passed. connection_session_not_found404- No connection session with that id for this profile.
connection_expired422- The stored provider token has expired or was revoked. Missing feature authorization uses permission_required instead.
permission_required403- The credential is healthy but the feature lacks a permission or provider-confirmed resource.
detailsnames required/missing items and arestart_oauthaction. connection_unavailable—- Appears inside an aggregate errors array when one account's credentials could not be used for that read.
provider_not_configured422- This Adeli deployment has no credentials for that provider.
provider_not_supported422- The provider cannot do this. WhatsApp and Google Business Profile connect sessions, and TikTok and YouTube messaging, land here.
invalid_handle400- A Bluesky
handledid not resolve to an account, when starting a connect or as a connect session'serror.code. x_billing_required402- X is billed per call and needs a paid plan. Connecting, posting, deleting, and listing X posts all return it on Free. See X API pricing.
reconnect_required409- Turning on an X capability needs a permission the connection was not granted.
details.missingScopeslists them.
Publishing
unsupported_platform422- The endpoint does not serve that platform — listing posts covers Instagram, Facebook, TikTok, YouTube, X, and Bluesky, and messages are Instagram, Facebook, or WhatsApp only.
unsupported_feature422- Scheduling, queueing, and background uploads are deferred.
scheduled_date,add_to_queue, andasync_uploadare rejected. invalid_image422- The image is not decodable, not a supported format, or over the size limit.
invalid_video422- The video is not a usable MP4, is over the size limit, or exceeds the creator's maximum duration.
privacy_level_unsupported422- A TikTok video asked for a
privacy_levelother thanPUBLIC_TO_EVERYONE. TikTok videos publish publicly; sendpost_mode: "MEDIA_UPLOAD"for a draft instead. invalid_post_settings422- The requested privacy, comment, duet, or stitch setting is not available to this creator, or branded content was requested without public visibility.
media_url_unverified422- TikTok has not verified this deployment's media URL prefix, which it must before any TikTok post works.
upload_limit_exceeded422- The YouTube channel has reached YouTube's own upload limit. Try again later.
provider_rejected422- The provider refused the post's content or metadata, such as a YouTube category_id that does not exist.
duplicate_post409- X refused the post because the account published the same text recently.
invalid_media422- An X media item is not valid base64, does not match its content_type, is over its size limit, or X could not process it.
Comments
post_not_found404- The
postIdis not one of this account's posts. comment_not_owned422- TikTok deletes only comments the account itself wrote. Hide other people's comments instead.
not_supported422- The platform cannot do this: liking a comment outside TikTok, or
cursorpaging outside TikTok and YouTube.
Upstream
provider_error502- The provider request failed. The upstream body is deliberately not passed through.
rate_limited429- TikTok is throttling this account (40 requests a minute per endpoint) or the app, or YouTube is throttling per-second. Retry with backoff.
quota_exhausted429- YouTube's daily API quota, shared by every Adeli customer, is used up. The message says when it resets, at midnight Pacific; retrying before then fails.
provider_unavailable502- Every attempted provider failed for mixed reasons.
detailscarries the per-account errors. temporarily_unavailable503- X is unavailable to Adeli for a while. Retry later.
database_error502- Adeli could not read or write its own store. Safe to retry.
result_limit—- Appears inside an aggregate
errorsarray when a collection was truncated at 10,000 records, which makes the response207.
Handling errors
Branch on code, not on message, and treat 207 as its own case.
const response = await fetch(`${BASE}/accounts?profileId=${profileId}`, { headers });
const body = await response.json();
if (!response.ok) {
switch (body.error.code) {
case "unauthorized":
throw new Error("Adeli key is invalid or revoked");
case "connection_expired":
return promptCustomerToReconnect();
default:
throw new Error(`${body.error.code}: ${body.error.message}`);
}
}
// 200 and 207 both land here.
if (body.status === "partial") {
console.warn("Incomplete result", body.errors);
}
return body.accounts;Retry 502, 429, and database_error with backoff. Do not retry 4xx — the request
will fail the same way — and be careful retrying a publish that timed out, since
there is no idempotency key.
permission_required
A healthy connection can be missing authorization for one feature. That feature returns HTTP 403 and error.code: "permission_required"; this is different from an expired or revoked credential. error.details names the provider, account/profile, capability, required and missing permissions/resources, and a structured reconnect action with action: "restart_oauth", method: "POST", and the profile connect endpoint. Restart the existing OAuth flow and grant the listed access—do not build a provider scope URL yourself. Aggregate endpoints keep successful provider results and include these details in the failed account's error record.