Errors and rate limits

Error format (RFC 7807)

Every error response is a problem document with content type
application/problem+json, following RFC 7807.
The shape is consistent, so you can handle errors generically:

{
  "type": "https://docs.montavire.com/reference/errors#validation",
  "title": "Validation failed",
  "status": 400,
  "detail": "Request constraints were violated.",
  "errors": [
    { "field": "contact_email", "message": "must be a valid email address" }
  ]
}
  • type, title, status, and detail are always present.
  • The type URL deep-links to this errors page. Known type slugs are
    validation, bad-request, conflict, not-found, and forbidden.
  • On validation failures, an errors array lists the offending fields so you can
    surface field-level messages to users.

Status codes you will see

StatusMeaningWhat to do
400 Bad RequestMalformed request or failed validationRead the errors array and fix the body
401 UnauthorizedMissing or invalid X-API-KeyCheck the key and environment prefix
403 ForbiddenKey lacks the required scopeGrant the scope, or use a key that has it
404 Not FoundNo such resource in your tenantCheck the id
409 ConflictIdempotency-key reused with a different body, or a state conflictUse a fresh key, or reconcile state
429 Too Many RequestsRate limit exceededBack off using the headers below
5xxServer errorRetry with backoff; the request may be safe to replay with the same Idempotency-Key

Rate limits

Requests are throttled per key on rolling minute, hour, and day
windows. Every response carries your current standing so you can pace yourself
before hitting a limit:

HeaderMeaning
X-RateLimit-LimitCanonical (per-minute) ceiling
X-RateLimit-Limit-Minute / -Hour / -DayCeiling for each window
X-RateLimit-Remaining-Minute / -Hour / -DayRequests left in each window

When you exceed a limit you get 429 Too Many Requests with:

HeaderMeaning
Retry-AfterSeconds to wait before retrying (standard HTTP header)
X-RateLimit-Retry-After-SecondsSame value, explicit name

Recommended client behaviour

  • Read X-RateLimit-Remaining-* and slow down as it approaches zero.
  • On 429, sleep for Retry-After seconds, then retry. Add jitter if you run
    many workers.
  • Prefer webhooks over tight polling loops: let Montavire push state
    changes to you instead of asking repeatedly.

Did this page help you?