Authentication
API keys and access
Every request to the Rigsight API is authenticated with a secret API key that belongs to one fleet (tenant). Keys are scoped, can be rotated without downtime, and must only ever live on your servers.
API keys
Send your key in the Authorization header as a Bearer token on every request. Requests without a valid key return 401 unauthorized.
curl https://api.rigsight.uz/v1/usage \
-H "Authorization: Bearer rs_live_4QmT…"| Prefix | Environment | Behaviour |
|---|---|---|
rs_live_… | Production | Real inspections. Counts towards your plan and usage. |
rs_test_… | Sandbox | Same API and webhooks, separate data. Never billed, never mixed with live data. |
rs_pub_… | Browser (embed) | Short-lived (15 min) token for the embed agent only. Created by your server with POST /v1/embed-tokens. |
Keys are shown once
A secret key is displayed exactly once, when it is created. Rigsight stores only a salted hash of it, so neither you nor the Rigsight team can read it back later. If you lose a key, create a new one and revoke the old one. Store keys in a secrets manager or an environment variable, not in source control.
Scopes
Give each key the smallest set of scopes it needs. A request outside a key's scopes returns 403 forbidden.
| Scope | Allows |
|---|---|
ptis:write | Create PTIs, request upload URLs, submit. |
ptis:read | Read PTIs, results, media URLs and lists. |
reviews:write | Record human review decisions and repair certifications. |
trucks:read | List trucks and their defects. |
trucks:write | Create and update trucks. |
webhooks:manage | Create, update and delete webhook endpoints. |
embed:issue | Issue rs_pub_… tokens for the embed agent. |
usage:read | Read monthly usage. |
Key rotation
Keys do not expire, but you should rotate them regularly and immediately if one may have leaked. Rotation has no downtime:
- Create a new key with the same scopes. Both keys are now valid.
- Deploy the new key to every service that calls Rigsight.
- Check that the old key is no longer used (its “last used” time stops changing).
- Revoke the old key. Revocation takes effect within seconds.
Never expose secret keys in browsers
Secret keys are server-side only
Never put an rs_live_… or rs_test_… key in front-end code, a mobile app bundle, a URL or a public repository. Anyone who has it can act on your whole fleet.
For browsers, your backend calls POST /v1/embed-tokens and hands the page a 15-minute rs_pub_… token limited to one truck and specific scopes. See the Embed agent guide.
Report language
Use the Accept-Language header to choose the language of human-readable fields such as summary and defect description. Supported values are en, ru and uz; anything else falls back to en. Enum values like OUT_OF_SERVICE or critical are never translated.
curl https://api.rigsight.uz/v1/ptis/pti_9f2c… \
-H "Authorization: Bearer rs_live_…" \
-H "Accept-Language: uz"The language used to create a PTI is also used for its webhook payloads.
Tenant isolation
- Each key belongs to exactly one fleet account. It can only see trucks, PTIs, media and webhooks of that fleet.
- Requesting an object that belongs to another fleet returns
404 not_found, not403, so ids cannot be probed. - Media is stored per tenant and is only reachable through short-lived signed URLs.
- Integrators serving several fleets use one key per fleet.