Перейти к содержимому
Открыта пилотная программа: 14 дней бесплатно для автопарка до 5 грузовиковПодать заявку
Preview

The Rigsight API, webhooks and embed agent are in private beta. Request access at hello@rigsight.uz or book a demo.

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.

Shell
curl https://api.rigsight.uz/v1/usage \
  -H "Authorization: Bearer rs_live_4QmT…"
PrefixEnvironmentBehaviour
rs_live_…ProductionReal inspections. Counts towards your plan and usage.
rs_test_…SandboxSame 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.

ScopeAllows
ptis:writeCreate PTIs, request upload URLs, submit.
ptis:readRead PTIs, results, media URLs and lists.
reviews:writeRecord human review decisions and repair certifications.
trucks:readList trucks and their defects.
trucks:writeCreate and update trucks.
webhooks:manageCreate, update and delete webhook endpoints.
embed:issueIssue rs_pub_… tokens for the embed agent.
usage:readRead 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:

  1. Create a new key with the same scopes. Both keys are now valid.
  2. Deploy the new key to every service that calls Rigsight.
  3. Check that the old key is no longer used (its “last used” time stops changing).
  4. 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.

Shell
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, not 403, 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.