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 limit headers. Check these headers to determine how many requests you can make and when you can resume requests after reaching a limit. This lets your client adapt automatically when your rate limit changes.
- The
X-Rate-Limit-Limitheader shows the request limit for the current rate limit window. - 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
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.
Handle Rate Limits​
To ensure you stop sending requests before you reach your rate limit:
- Use the
X-Rate-Limit-Remainingheader to stop sending requests before you receive a429 Too Many Requestsresponse. - When the value reaches
0, use theX-Rate-Limit-Resetheader to schedule when your client resumes requests.
This allows your client to use the maximum available request capacity 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 |