The REST API will include a response with a list of errors if applicable.Documentation Index
Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Errors have a returned status code of 400, 401, 402, 403, 404, 429, 500, or 502. Success has a returned
status code 200. See here for details.
- The
errorsfield contains the array of errors, one per social network that had an error. - The
actionrefers to the type of error returned. - The top-level
statusfield will be “error” if the API call failed. For example, for a /post call if all social network posting were successful thestatusfield will be “success”, else the status field will be “error”. - The
codefield contains the Ayrshare reference error code. - The
messagefield is the specific details of the error.
Handling Errors
You should handle any error responses and take the appropriate action. An error occurred if:- The response return code is not
200 - The JSON response status is
error
400 Bad Request response code.
400 Bad Request response code:
Instagram-Specific Error Codes
The following error codes provide specific details about Instagram posting failures, replacing the generic error 138 where possible. Code 435 — Instagram Rate Limit (HTTP 429) Instagram professional (Business / Creator) accounts are subject to a 50-post rolling 24-hour limit on Meta’s Content Publishing API (personal accounts cannot publish via API at all and therefore never hit this limit). When the cap is exceeded, Meta returns a rate-limit error. Ayrshare also surfacescode: 435 when Meta’s publish endpoint returns HTTP 429 directly or when the underlying error subcode (1390008) indicates a post / comment throttle.
Retry-After header, the value (in seconds) is passed through on the details field — wait at least that long before resubmitting.
Code 436 — Instagram Media Processing Timeout (HTTP 400)
Instagram took too long to process the uploaded media. This can happen with large video files or during periods of high load on Meta’s servers.
instagramOptions.trialParams is provided on a /post request but graduationStrategy is missing, null, or an empty string. Trial reels require an explicit graduation strategy — see Trial Reels.
instagramOptions.trialParams.graduationStrategy to either "MANUAL" or "SS_PERFORMANCE" and retry, or remove trialParams if you did not intend to publish a trial reel.
Code 448 — Instagram Trial Reels: Invalid graduationStrategy (HTTP 400)
Returned when graduationStrategy is present but is not exactly "MANUAL" or "SS_PERFORMANCE". The check is case-sensitive — values like "manual" or "ss_performance" are rejected. The details field echoes the rejected input (truncated to 64 characters) to aid debugging.
graduationStrategy as exactly "MANUAL" or "SS_PERFORMANCE" (uppercase, string type).
Code 449 — Instagram Trial Reels: Incompatible Media (HTTP 400)
Returned when the media or post shape is not eligible for a trial reel. Trial reels must be a single .mp4 or .mov video — carousels (more than one URL), stories (instagramOptions.stories: true), and non-video extensions are all rejected. The details field disambiguates which sub-case fired.
.mp4 or .mov video URL with no stories: true flag. Drop additional mediaUrls entries, or remove trialParams if you intended a regular carousel/story post.
Retry Available
Sometimes the social networks have a unrecoverable error, such as their are having server issues, and the call ultimately fails even after numerous retries. In those cases, our system will determine if the error is retryable and if so, theretryAvailable field will be true.
X/Twitter BYO Key Errors
The following error codes are specific to X/Twitter BYO (Bring Your Own) key operations: Code 416 — X Credits Depleted (HTTP 402) Your X Developer account has no API credits loaded. All X API calls require credits.x-access-level: read, which confirms your Access Token was generated with read-only permissions.
Action: In the X Developer Console, update your app permissions to Read and write and Direct message, then regenerate your Access Token under Keys and tokens. The new token will inherit the updated permissions. See the X BYO Key Setup Guide for details.
Caption Enhancement Errors
Code 441 — Caption Enhancement Failed (HTTP 502) Returned when a caption enhancement (for exampleshortenLinks) fails for one or more platforms while preparing a post. Each affected platform appears in the errors array with source: "handlePostAdditions" and code: 441.
When only some platforms fail, the other platforms still post successfully and their results appear in postIds. In that case the top-level status is "error" but postIds is non-empty — clients should treat status and errors[] as complementary rather than mutually exclusive.
code: 441 with HTTP 502 and no post is created:
- If
postIdsis non-empty (some platforms posted successfully), do not resubmit the full platform set — that would duplicate the post on the successful platforms. Instead, inspecterrors[]to identify the failed platforms and retry the request with only those platforms, or rely on your own idempotent retry flow. - If
postIdsis empty or missing (total failure at schedule/post time), safely retry the full request. - If the failure persists, submit the post without the enhancement flag (for example, drop
shortenLinks) or contact support.
Media Fetch / Crawler Access Errors
Code 440 — Social Network Could Not Download Media (HTTP 400) Returned when the platform’s publishing crawler cannot download themediaUrl you provided — most commonly because robots.txt or a WAF / bot-fight rule is blocking the crawler (for example, Meta’s facebookexternalhit). The details string comes from the upstream platform and is often the Meta/Instagram error 2207052 text.
details string typically contains "Restricted by robots.txt" or "HTTP error code 403". Code 138 is also used for aspect-ratio / format issues and other generic Instagram errors, so the media-fetch variant is identifiable by the details string.
mediaUrl. The Threads API does not return detail strings, so diagnosis usually requires checking for a co-occurring Instagram 440 or 138 in the same publish.
robots.txt snippets and a verification command.
Facebook Analytics Rate Limit
Code 444 — Facebook Page Analytics Rate Limit (HTTP 429) Returned when a Facebook Page has exceeded Meta’s per-Page rate limit on the analytics endpoint. The underlying Meta error is80001 (“There have been too many calls to this Page account.”). The Page remains linked and publishing continues to work — only the analytics fan-out for that Page is throttled.
When the throttle is detected for a single post in a /history/facebook or analytics response, each affected post carries code: 444 at facebook.code with errCode: 80001:
Image Format Conversion Errors
Ayrshare automatically converts WebP, HEIC, and AVIF images to JPEG before posting to platforms that don’t accept them (Instagram, LinkedIn, TikTok, Google My Business, Threads, and Snapchat for WebP; all platforms for HEIC and AVIF). Conversion runs transparently at send time. The three errors below fire only when the conversion pipeline itself can’t complete; if the source image is already in a supported format, no conversion is attempted and these codes will not surface. Code 450 — Image Format Conversion Failed (HTTP 400) The image was downloaded but could not be re-encoded as JPEG. Most common causes are a corrupt source file, an unexpected internal format inside the container, or an image that exceeds the conversion size cap.mediaUrl directly in a browser to confirm it renders. If it does, re-export the image to a clean JPEG or PNG and retry the post.
Code 451 — Image Download Failed for Conversion (HTTP 400)
The conversion pipeline could not fetch the source image. Typical causes include a 4xx/5xx response from the origin, a network timeout, a redirect chain that exceeds the hop limit, or a URL that resolves to a non-public address (blocked by the SSRF guard). The details field, when present, carries the underlying cause string.
mediaUrl is publicly reachable (no auth, no robots.txt blocks, resolves over HTTPS). If the URL redirects, ensure the final destination is also public and not on a private network.
Code 452 — Converted Image Upload Failed (HTTP 500)
Conversion succeeded but Ayrshare could not stage the converted JPEG to its temporary storage bucket. This is an internal failure on the Ayrshare side and is retryable.
mediaUrl and approximate timestamp.
Error Message Translation
The API error message response can be automatically translated to the language of your choice. This is useful if you want to display the error directly to your user in their preferred language. See here if you want to choose the language of the social linking page. In the header include:Language_Code is one of the available language codes.
For example, the following will translate the error to French.
