The Gorgias API is rate-limited using a leaky bucket algorithm, meaning that the number of requests you can make in a period of time is limited.

The Gorgias API has a limit of 2 calls per second per account with a burst of 40s (i.e. 40 calls can be made at second 0, but it would take 20s for the count to reset).

If you exceeded the quota, your request will fail and the API will respond with a 429 Too Many Requests HTTP code.

All responses returned by the API contains rate-limiting headers to enable you to handle this scenario programmatically and retry when you know that your request will succeed:

HTTP Response HeaderDescription
Retry-afterIt contains how many seconds you need to wait before you can retry the request.
E.g: 5. In this case, you need to wait 5 seconds.
X-Gorgias-Account-Api-Call-LimitIt contains the number of requests you made in the current period, and the limit of requests you can make in the current period.
E.g: 10/40. In this case, you made 10 requests, and the limit is 40.