Limitations

The Gorgias API limits the number of requests you can make in a period of time using leaky bucket algorithm. The limit is set to 2 calls per second per account with a burst of 40s.
It means that 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 contain rate-limiting headers that enable you to handle this scenario programmatically and retry when you know that your request will succeed:

HTTP Response HeaderDescription
Retry-afterContains how many seconds you need to wait before you can retry the request.
(e.g: 5 means you need to wait 5 seconds)
X-Gorgias-Account-Api-Call-LimitContains 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 means you made 10 requests, and the limit is 40)