All Other Endpoints

Every other endpoint is rate limited and will return a HTTP 429 when the limit is reached.

If this response code is returned, your API call was not executed due to temporary rate limiting. In addition to HTTP 429, we will also return a X-RateLimit-Reset HTTP header. This contains a timestamp after which your rate limit should be cleared; this time is represented as a UNIX timestamp (also known as an Epoch timestamp).

Default Rate Limits

⚠️ Please note that Rate limts are subject to change. You should expect and handle an HTTP 429 response for each request to Bandwidth's API.

Endpoint Limit Time Period (ms)
/account 1 1000
/applications 1 1000
/availableNumbers 1 1000
/bridges 1 1000
/calls

⚠️ For outbound calls see the call rate limit doc
1 1000
/conferences 1 1000
/domains 1 1000
/endpoints 1 1000
/errors 1 1000
/media 1 1000
/messages

⚠️ For sending messages message rate limit doc
1 1000
/numberInfo 1 1000
/phoneNumbers 1 1000
/recordings 1 1000
/recordings/{id}/transcriptions 1 1000

Sample HTTP 429 Response

Status: 429 Too Many Requests
X-RateLimit-Reset: 1479308598680
Content-Type: application/json

{
  "category": "too-many-requests",
  "code": "rate-limit-reached",
  "details": [
    {
      "name": "rateLimitResetTime",
      "value": "1479308598680"
    },
    {
      "name": "requestMethod",
      "value": "GET"
    },
    {
      "name": "remoteAddress",
      "value": "0:0:0:0:0:0:0:1"
    },
    {
      "name": "requestPath",
      "value": "users/{{userId}}/account"
    }
  ]
}

Handling 429 Errors - X-RateLimit-Reset

Bandwidth recommends retry logic based on the X-RateLimit-Reset value passed in the header. The high-level logic looks something like:

  1. Try to fetch account transactions
  2. If success: 🎉
  3. If 429:
  4. Calculate the current Epoch Time
  5. Calculate the time to wait in MS (X-RateLimit-Reset - Current-Time = Time-to-Wait)
  6. Wait the calculated time
  7. Go back to step #1

results matching ""

    No results matching ""