Skip to content
MothershipDevelopers

API referenceGetting started

Rate limiting

Request limits per organization, the rate limit headers, and what to do when you hit a limit.

2 min read

Default rate limits

Every organization has a per-minute request limit and a daily allowance. Once an organization uses up its daily allowance, its per-minute limit drops until the allowance resets, a day after the first request that counted toward it. The X-RateLimit-* response headers show the limit that applies to a request and how much of it is left. If your organization needs higher limits, contact us at developers@mothership.com.

Two endpoints have their own, lower limits on top of these.

EndpointLimit
Create a quoteA per-minute limit that drops after a burst of quotes, until a few hours after the first quote in the burst.
Create a shipmentA per-minute limit.

These endpoint limits only count requests that pass validation, so a malformed request doesn't use up your quota. A quote that fails before any carrier is rated, such as one whose address can't be found or that we can't ship, doesn't count toward the quote limit either. Sandbox requests are counted separately from production.

Response headers

Every API response includes the following rate limiting headers. On the two endpoints above, a request that counts toward the endpoint limit gets headers that describe it.

HeaderDescription
X-RateLimit-LimitThe maximum number of requests for the current time window.
X-RateLimit-RemainingThe number of requests remaining for the current time window.
X-RateLimit-ResetA unix timestamp, in seconds, of when the request counter resets.

Limit exceeded

If you exceed your rate limit, the API will respond with HTTP status code 429 and the header Retry-After. Retry-After is the length of the window you exceeded, in seconds. To wait no longer than needed, wait until the time in X-RateLimit-Reset.

HTTP/1.1 429 Too Many Requests
Content-Type: application/json
Retry-After: 60
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1773939660
LimitMessage
Per minuteYou have reached your minutely limit. Please try again in the next minute.
Daily allowance used upYou have reached your daily limit. Your per-minute limit is lower until it resets. Please try again in the next minute.
QuotesYou have hit your quote rate limit
ShipmentsYou have hit your shipping rate limit