> ## Documentation Index
> Fetch the complete documentation index at: https://ayrshare.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Fix 502 Bad Gateway & 504 Errors | Ayrshare API Docs

> Understand what 502 Bad Gateway and 504 Gateway Timeout errors mean from the Ayrshare API, why they happen, and how to retry your requests safely.

If you've encountered:

* A 502 or 504 HTTP error with a "Bad Gateway" message
* A timeout while trying to post a large media file
* An HTML CloudFlare response

Please try sending the post again using `api.ayrshare.com` as your base endpoint. See the [/post](/apis/post/post) endpoint for details.

`https://api.ayrshare.com/api/{endpoint name}`

For example, instead of `https://app.ayrshare.com/api/post`, use `https://api.ayrshare.com/api/post`

You may also use `api.ayrshare.com` for the `/post` endpoint or any other endpoint.
