Errors & limits
Errors, limits and versioning
How the API reports problems, how much you can call it, how to retry safely, and how it will change over time.
Error format
Every error response has a non-2xx status and the same JSON shape. code is stable and safe to branch on; message is for humans, may change, and follows Accept-Language.
{
"error": {
"code": "unprocessable",
"message": "A PTI needs at least 5 photos; 3 were declared."
}
}Every response also has an X-Request-Id header. Include it when contacting support.
HTTP status codes
| Status | code | Meaning | Retry? |
|---|---|---|---|
| 400 | invalid_request | Malformed JSON, missing or invalid parameter. | No — fix the request. |
| 401 | unauthorized | Missing, invalid or revoked API key or token. | No |
| 403 | forbidden | The key or token lacks the required scope, or a signed URL expired. | No |
| 404 | not_found | The object does not exist in your fleet. | No |
| 409 | conflict | State conflict (e.g. PTI already submitted) or Idempotency-Key reused with a different body. | No |
| 413 | too_large | Request body or declared file is larger than allowed. | No |
| 422 | unprocessable | Valid JSON but breaks a rule (media limits, plan limits, missing uploads). | No |
| 429 | rate_limited | Rate limit exceeded. Wait for the number of seconds in Retry-After. | Yes, after Retry-After |
| 500 | internal_error | Unexpected error on our side. | Yes, with backoff |
| 503 | unavailable | Temporarily overloaded or in maintenance. May include Retry-After. | Yes, with backoff |
Rate limits
- 120 requests per minute per API key (sliding window). Test and live keys have separate limits.
- Media uploads to signed URLs are not counted.
- Responses include
X-RateLimit-Limit,X-RateLimit-RemainingandX-RateLimit-Reset(Unix seconds). - When you get
429, waitRetry-Afterseconds before retrying. Prefer webhooks over polling to stay well below the limit.
HTTP/1.1 429 Too Many Requests
Retry-After: 12
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 0
{ "error": { "code": "rate_limited", "message": "Rate limit of 120 requests per minute exceeded." } }Idempotency
Network failures happen. To retry a POST safely, send an Idempotency-Key header with a unique value (a UUID v4 is ideal). If Rigsight has already processed a request with that key in the last 24 hours, it returns the original response instead of creating a second PTI, truck or review.
curl https://api.rigsight.uz/v1/ptis \
-H "Authorization: Bearer rs_live_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 7c1e0a52-2f7e-4c8e-9a51-0f3b1d6e2a10" \
-d '{ "truck": "1045", "type": "pre_trip", "media": [ … ] }'- Reusing a key with a different body returns
409 conflict. GET,PATCHandDELETEare already idempotent and ignore the header.- Keys are scoped to your API key and expire after 24 hours.
Versioning
The version is part of the URL: /v1. Within a version we only make additive, backwards-compatible changes — new endpoints, new optional parameters, new response fields, new event types and new enum values. Build your client to ignore fields it does not know.
Breaking changes (removing or renaming fields, changing types or behaviour) only ship in a new version such as /v2, announced to integrators by email well in advance, with both versions running side by side during the migration period.
Preview caveat
Changelog
2026-11
v1 preview
First public description of the REST API (PTIs, signed uploads, review, trucks, defects, repairs, usage, webhooks, embed tokens), signed webhooks and the
<rigsight-pti>embed agent. Available to private beta partners.