Rate limiting
MaintainX®'s API enforces rate limiting to protect its infrastructure and to ensure all users can access the API fairly.
Rate Limit Headers​
Each call to MaintainX's API returns three rate limiting headers. We highly recommend checking these headers because it keeps you compatible and ensures you will automatically benefit from any limit increase we can give you.
- The
X-Rate-Limit-Limitheader shows your cap allowed for the current timeframe (this usually doesn't change unless we increase your cap). -
- The
X-Rate-Limit-Remainingheader indicates how many requests you can still make within the current rate limit window. When the value reaches0, the API returns a429 Too Many Requestsresponse until the rate limit window resets. For example, if a response returns1for this header, you can make one more request before subsequent requests receive a429 Too Many Requestsresponse.
- The
-
- The
X-Rate-Limit-Resetheader indicates how many seconds remain until the current rate limit window resets. When the value reaches0, a new rate limit window begins and theX-Rate-Limit-Remainingvalue resets to your configured request limit.
- The
To optimize your HTTP client, use X-Rate-Limit-Remaining to automatically wait before sending a new request to our API when the header value reaches 0. Then, use the X-Rate-Limit-Reset header value to schedule when you'll start sending requests again. Following this solution should allow you to always benefit from the maximum allowed number of requests for your organization or user.
Make sure to still handle the scenario of receiving a 429 Too Many Requests HTTP status code in your code. This could still happen if you run into a concurrency edge case. In those scenarios, make your client wait for the X-Rate-Limit-Remaining period in seconds, and add a small time buffer as a security measure.
Default Rate Limits​
| Scope | Rate Limit |
|---|---|
| User across all organizations | 100 requests / 60 seconds |
| User on a single organization | 100 requests / 60 seconds |
| All users within one organization | 500 requests / 60 seconds |
Automated and IoT meter readings on /meterreadings endpoint | 100 requests / 60 seconds |
Automated and IoT meter readings on /meter/{meterId}/readings endpoint (not recommended) | 1 request / 10 seconds |
| Manual meter readings across all endpoints | 10 requests / 24 hours |