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

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

API reference

REST API

Base URL https://api.rigsight.uz/v1. All requests need Authorization: Bearer rs_live_… (see Authentication). Bodies are JSON; errors follow the common error format.

PTIs

A PTI (pre-trip, post-trip or arrival inspection) moves through awaiting_upload → processing → completed (or failed). Create it, upload media to the signed URLs, submit, then read the result or wait for a webhook.

Create a PTI

POST/v1/ptis

Starts an inspection and reserves one signed upload URL per media file you declare. The PTI stays in awaiting_upload until you call submit. Upload URLs are valid for 15 minutes.

A PTI needs 5–40 photos and at most 10 videos of up to 2 minutes each. Exact limits depend on your plan; requests outside them return 422.

Body parameters

truckstringRequired
Truck unit number (e.g. 1045) or truck id (trk_…). Unknown unit numbers return 404; create the truck first.
trailerstringOptional
Trailer number, if a trailer is part of the inspection.
typeenumRequired
pre_trip, post_trip or arrival.
driver_idstringOptional
Your own driver identifier. Stored and returned as-is.
mediaarrayRequired
One entry per file you will upload (see below).

media[] object

kindenumRequired
photo or video.
content_typestringRequired
image/jpeg, image/png, image/heic, video/mp4 or video/quicktime.
size_bytesintegerRequired
Exact file size. The upload is rejected if the size differs.
sha256stringOptional
Hex SHA-256 of the file. If given, storage verifies the upload against it.
Request · Shell
curl https://api.rigsight.uz/v1/ptis \
  -H "Authorization: Bearer rs_live_…" \
  -H "Content-Type: application/json" \
  -H "Accept-Language: en" \
  -H "Idempotency-Key: 7c1e0a52-2f7e-4c8e-9a51-0f3b1d6e2a10" \
  -d '{
    "truck": "1045",
    "trailer": "T-220",
    "type": "pre_trip",
    "driver_id": "drv_88",
    "media": [
      { "kind": "photo", "content_type": "image/jpeg", "size_bytes": 2483021 },
      { "kind": "video", "content_type": "video/mp4", "size_bytes": 48210233 }
    ]
  }'
Response 201 · JSON
{
  "id": "pti_9f2c41d7",
  "state": "awaiting_upload",
  "type": "pre_trip",
  "truck": { "id": "trk_12", "unit_number": "1045" },
  "trailer": "T-220",
  "driver_id": "drv_88",
  "created_at": "2026-11-28T09:12:44Z",
  "uploads": [
    {
      "media_id": "med_01a7",
      "upload_url": "https://media.rigsight.uz/u/med_01a7?sig=…",
      "method": "PUT",
      "headers": { "Content-Type": "image/jpeg" },
      "expires_at": "2026-11-28T09:27:44Z"
    },
    {
      "media_id": "med_01a8",
      "upload_url": "https://media.rigsight.uz/u/med_01a8?sig=…",
      "method": "PUT",
      "headers": { "Content-Type": "video/mp4" },
      "expires_at": "2026-11-28T09:27:44Z"
    }
  ]
}

Possible errors

  • 400invalid_requestMalformed JSON or a missing required field.
  • 401unauthorizedMissing, invalid or revoked API key.
  • 403forbiddenThe key does not have the ptis:write scope.
  • 404not_foundThe truck does not exist in your fleet.
  • 409conflictSame Idempotency-Key reused with a different body.
  • 413too_largeA declared file exceeds the size limit.
  • 422unprocessableToo few/many photos or videos for your plan, or an unsupported content_type.
  • 429rate_limitedToo many requests; wait for Retry-After seconds.

Upload media

PUT{upload_url}

Upload the raw file bytes directly to storage using the upload_url, method and headers from uploads[]. Do not send your API key: the URL is already signed. The body is the file itself, not JSON or multipart form data. Uploads do not count towards the API rate limit.

If a URL expires before you finish, call POST /v1/ptis again (a new PTI) — expired uploads cannot be resumed in the preview.

Request

Content-TypeheaderRequired
Must equal the content_type declared for this media.
bodybinaryRequired
The file bytes. Length must equal size_bytes.
Request · Shell
curl -X PUT "https://media.rigsight.uz/u/med_01a7?sig=…" \
  -H "Content-Type: image/jpeg" \
  --data-binary @left-front-tire.jpg
Response 200 · HTTP
HTTP/1.1 200 OK
ETag: "5d41402abc4b2a76b9719d911017c592"

Possible errors

  • 400invalid_requestContent-Type or size does not match the declaration, or sha256 mismatch.
  • 403forbiddenThe signature is invalid or the URL has expired (after 15 minutes).
  • 413too_largeThe body is larger than the declared size_bytes.

Submit a PTI

POST/v1/ptis/{id}/submit

Tells Rigsight that all uploads have finished and starts the analysis. The PTI moves to processing; a typical result is ready in 1–3 minutes. You are notified by the pti.completed webhook, or you can poll GET /v1/ptis/{id} (no more than once every 5 seconds).

Path parameters

idstringRequired
PTI id (pti_…).
Request · Shell
curl -X POST https://api.rigsight.uz/v1/ptis/pti_9f2c41d7/submit \
  -H "Authorization: Bearer rs_live_…"
Response 200 · JSON
{
  "id": "pti_9f2c41d7",
  "state": "processing",
  "submitted_at": "2026-11-28T09:15:02Z"
}

Possible errors

  • 401unauthorizedMissing, invalid or revoked API key.
  • 403forbiddenThe key does not have the ptis:write scope.
  • 404not_foundNo PTI with this id in your fleet.
  • 409conflictThe PTI was already submitted, or is completed/failed.
  • 422unprocessableNot all declared media have been uploaded (missing media ids are listed in the message).
  • 429rate_limitedToo many requests; wait for Retry-After seconds.

Retrieve a PTI

GET/v1/ptis/{id}

Returns the state and, once completed, the full result of an inspection.

  • state: awaiting_upload | processing | completed | failed.
  • status: PASS | NEEDS_REPAIR | OUT_OF_SERVICE; null until the state is completed. This is the AI recommendation, not a final decision.
  • defects[]: id, component, severity (critical | major | minor), description, recurring (seen in a previous PTI and not certified as repaired) and image_ids (media showing the defect).
  • unclear_components[]: parts the AI could not judge from the media (blurry, dark, not shown). Ask the driver for a re-take or inspect manually.
  • media[]: each file with a signed url valid for 10 minutes. Fetch the PTI again for fresh URLs.
  • review: null until a person decides, then { decision, user, comment, created_at }.
  • requires_human_review is always true. Internal processing cost is never exposed.

If state is failed, the failure_reason field explains why (for example, unusable media). Failed PTIs are not billed.

Path parameters

idstringRequired
PTI id (pti_…).
Request · Shell
curl https://api.rigsight.uz/v1/ptis/pti_9f2c41d7 \
  -H "Authorization: Bearer rs_live_…" \
  -H "Accept-Language: en"
Response 200 · JSON
{
  "id": "pti_9f2c41d7",
  "state": "completed",
  "type": "pre_trip",
  "truck": { "id": "trk_12", "unit_number": "1045" },
  "trailer": "T-220",
  "driver_id": "drv_88",
  "status": "OUT_OF_SERVICE",
  "summary": "Left front tire tread is below the legal minimum. Brake chamber on axle 2 shows an air leak indicator.",
  "defects": [
    {
      "id": "def_7781",
      "component": "left front tire",
      "severity": "critical",
      "description": "Tread below 4/32\"",
      "recurring": false,
      "image_ids": ["med_01a7"]
    },
    {
      "id": "def_7782",
      "component": "axle 2 right brake chamber",
      "severity": "major",
      "description": "Possible air leak: pushrod stroke indicator visible",
      "recurring": true,
      "image_ids": ["med_01b2", "med_01b3"]
    }
  ],
  "unclear_components": ["fifth wheel locking jaws"],
  "media": [
    {
      "id": "med_01a7",
      "kind": "photo",
      "content_type": "image/jpeg",
      "url": "https://media.rigsight.uz/m/med_01a7?sig=…",
      "url_expires_at": "2026-11-28T09:28:10Z"
    }
  ],
  "review": null,
  "requires_human_review": true,
  "created_at": "2026-11-28T09:12:44Z",
  "submitted_at": "2026-11-28T09:15:02Z",
  "completed_at": "2026-11-28T09:16:51Z"
}

Possible errors

  • 401unauthorizedMissing, invalid or revoked API key.
  • 403forbiddenThe key does not have the ptis:read scope.
  • 404not_foundNo PTI with this id in your fleet.
  • 429rate_limitedToo many requests; wait for Retry-After seconds.

List PTIs

GET/v1/ptis?truck=&status=&from=&to=&cursor=&limit=

Returns PTIs newest first, with cursor pagination. Pass next_cursor from the previous page as cursor to get the next page; next_cursor is null on the last page. List items contain the result fields but not media.

Query parameters

truckstringOptional
Filter by unit number or truck id.
statusenumOptional
PASS, NEEDS_REPAIR or OUT_OF_SERVICE.
fromdatetimeOptional
Created at or after (ISO 8601, e.g. 2026-11-01T00:00:00Z).
todatetimeOptional
Created before (ISO 8601).
cursorstringOptional
Opaque cursor from a previous response.
limitintegerOptional
Items per page, 1–100. Default 25.
Request · Shell
curl "https://api.rigsight.uz/v1/ptis?truck=1045&status=OUT_OF_SERVICE&limit=2" \
  -H "Authorization: Bearer rs_live_…"
Response 200 · JSON
{
  "data": [
    {
      "id": "pti_9f2c41d7",
      "state": "completed",
      "type": "pre_trip",
      "truck": { "id": "trk_12", "unit_number": "1045" },
      "status": "OUT_OF_SERVICE",
      "summary": "Left front tire tread is below the legal minimum.",
      "defect_count": 2,
      "review": null,
      "created_at": "2026-11-28T09:12:44Z"
    }
  ],
  "next_cursor": "eyJjIjoiMjAyNi0xMS0yOCJ9"
}

Possible errors

  • 400invalid_requestInvalid filter value or malformed cursor.
  • 401unauthorizedMissing, invalid or revoked API key.
  • 403forbiddenThe key does not have the ptis:read scope.
  • 429rate_limitedToo many requests; wait for Retry-After seconds.

Record a review decision

POST/v1/ptis/{id}/review

Records the decision of a qualified person (dispatcher, safety manager or mechanic) on a completed PTI. Each decision is written to the audit log with the user and the time; a later review replaces the current decision but the history is kept. Triggers the pti.reviewed webhook.

Path parameters

idstringRequired
PTI id (pti_…).

Body parameters

decisionenumRequired
approved (truck may operate), repair (repair before or after dispatch per your policy) or oos (out of service).
commentstringOptional
Free text, up to 2,000 characters. Required by policy in many fleets when overriding the AI recommendation.
userstringOptional
Your identifier of the reviewer (e.g. email). Defaults to the API key name.

AI only recommends

Rigsight never grounds or clears a truck automatically. The status of a PTI is a recommendation; the decision recorded here is what your systems should act on.
Request · Shell
curl https://api.rigsight.uz/v1/ptis/pti_9f2c41d7/review \
  -H "Authorization: Bearer rs_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "decision": "oos",
    "comment": "Confirmed tread depth 3/32\" with gauge. Tire replacement booked.",
    "user": "safety@fleet.example"
  }'
Response 200 · JSON
{
  "id": "pti_9f2c41d7",
  "review": {
    "decision": "oos",
    "user": "safety@fleet.example",
    "comment": "Confirmed tread depth 3/32\" with gauge. Tire replacement booked.",
    "created_at": "2026-11-28T09:21:30Z"
  }
}

Possible errors

  • 400invalid_requestUnknown decision value.
  • 401unauthorizedMissing, invalid or revoked API key.
  • 403forbiddenThe key does not have the reviews:write scope.
  • 404not_foundNo PTI with this id in your fleet.
  • 409conflictThe PTI is not completed yet.
  • 429rate_limitedToo many requests; wait for Retry-After seconds.

Trucks & defects

Trucks are the units you inspect. Defects stay open until a repair is certified.

List trucks

GET/v1/trucks?cursor=&limit=

Returns the trucks in your fleet, sorted by unit number, with the same cursor pagination as PTIs.

Query parameters

cursorstringOptional
Opaque cursor from a previous response.
limitintegerOptional
Items per page, 1–100. Default 25.
Request · Shell
curl https://api.rigsight.uz/v1/trucks \
  -H "Authorization: Bearer rs_live_…"
Response 200 · JSON
{
  "data": [
    {
      "id": "trk_12",
      "unit_number": "1045",
      "vin": "1XKYD49X0LJ123456",
      "make": "Kenworth",
      "model": "T680",
      "year": 2021,
      "open_defects": 2,
      "last_pti_at": "2026-11-28T09:16:51Z"
    }
  ],
  "next_cursor": null
}

Possible errors

  • 401unauthorizedMissing, invalid or revoked API key.
  • 403forbiddenThe key does not have the trucks:read scope.
  • 429rate_limitedToo many requests; wait for Retry-After seconds.

Create a truck

POST/v1/trucks

Adds a truck to your fleet. The number of active trucks is limited by your plan (see Usage).

Body parameters

unit_numberstringRequired
Your fleet unit number. Unique within the fleet.
vinstringOptional
17-character VIN.
makestringOptional
e.g. Freightliner.
modelstringOptional
e.g. Cascadia.
yearintegerOptional
Model year.
Request · Shell
curl https://api.rigsight.uz/v1/trucks \
  -H "Authorization: Bearer rs_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "unit_number": "1046", "vin": "3AKJHHDR5NSNA1234", "make": "Freightliner", "model": "Cascadia", "year": 2022 }'
Response 201 · JSON
{
  "id": "trk_13",
  "unit_number": "1046",
  "vin": "3AKJHHDR5NSNA1234",
  "make": "Freightliner",
  "model": "Cascadia",
  "year": 2022,
  "open_defects": 0,
  "last_pti_at": null,
  "created_at": "2026-11-28T10:02:11Z"
}

Possible errors

  • 400invalid_requestMissing unit_number or malformed VIN.
  • 401unauthorizedMissing, invalid or revoked API key.
  • 403forbiddenThe key does not have the trucks:write scope.
  • 409conflictA truck with this unit_number already exists.
  • 422unprocessableYour plan's truck limit has been reached.
  • 429rate_limitedToo many requests; wait for Retry-After seconds.

List a truck's defects

GET/v1/trucks/{id}/defects?state=

Returns defects found on a truck that are still open (not certified as repaired), including recurring ones — defects detected again in a later PTI. Use it to build a maintenance queue.

Path parameters

idstringRequired
Truck id (trk_…) or unit number.

Query parameters

stateenumOptional
open (default), recurring (only recurring) or all (includes repaired).
Request · Shell
curl https://api.rigsight.uz/v1/trucks/trk_12/defects \
  -H "Authorization: Bearer rs_live_…"
Response 200 · JSON
{
  "truck": { "id": "trk_12", "unit_number": "1045" },
  "data": [
    {
      "id": "def_7782",
      "component": "axle 2 right brake chamber",
      "severity": "major",
      "description": "Possible air leak: pushrod stroke indicator visible",
      "recurring": true,
      "occurrences": 3,
      "first_seen_pti": "pti_71aa0c3e",
      "last_seen_pti": "pti_9f2c41d7",
      "first_seen_at": "2026-11-21T06:40:12Z",
      "certified_at": null
    }
  ]
}

Possible errors

  • 401unauthorizedMissing, invalid or revoked API key.
  • 403forbiddenThe key does not have the trucks:read scope.
  • 404not_foundNo truck with this id in your fleet.
  • 429rate_limitedToo many requests; wait for Retry-After seconds.

Certify a repair

POST/v1/defects/{id}/repair

Records that a defect has been repaired (the repair certification step of a DVIR). The defect stops counting as open and is no longer reported as recurring unless it is detected again later.

Path parameters

idstringRequired
Defect id (def_…).

Body parameters

notestringRequired
What was done, e.g. part replaced. Up to 2,000 characters.
proof_media_idstringOptional
Media id (med_…) of a photo of the repair, uploaded through the same signed-URL flow.
userstringOptional
Your identifier of the mechanic certifying the repair.
Request · Shell
curl https://api.rigsight.uz/v1/defects/def_7781/repair \
  -H "Authorization: Bearer rs_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "note": "Replaced left front steer tire (new tread 18/32\").", "proof_media_id": "med_02c4", "user": "mech.akmal" }'
Response 200 · JSON
{
  "id": "def_7781",
  "certified_at": "2026-11-28T13:40:05Z",
  "certified_by": "mech.akmal",
  "note": "Replaced left front steer tire (new tread 18/32\").",
  "proof_media_id": "med_02c4"
}

Possible errors

  • 401unauthorizedMissing, invalid or revoked API key.
  • 403forbiddenThe key does not have the reviews:write scope.
  • 404not_foundNo defect with this id in your fleet.
  • 409conflictThe defect is already certified as repaired.
  • 422unprocessableproof_media_id is unknown, not a photo, or not uploaded yet.
  • 429rate_limitedToo many requests; wait for Retry-After seconds.

Usage

Track plan consumption programmatically.

Get usage

GET/v1/usage

Returns usage for the current calendar month (UTC). Test-key PTIs are not counted.

Request · Shell
curl https://api.rigsight.uz/v1/usage \
  -H "Authorization: Bearer rs_live_…"
Response 200 · JSON
{
  "period": "2026-11",
  "pti_count": 412,
  "truck_count": 38,
  "truck_limit": 50,
  "included_ptis": 1500,
  "overage_ptis": 0
}

Possible errors

  • 401unauthorizedMissing, invalid or revoked API key.
  • 403forbiddenThe key does not have the usage:read scope.
  • 429rate_limitedToo many requests; wait for Retry-After seconds.

Webhook endpoints

Manage where Rigsight sends events.

List webhook endpoints

GET/v1/webhooks

Returns all webhook endpoints of your fleet. Secrets are never included.

Request · Shell
curl https://api.rigsight.uz/v1/webhooks \
  -H "Authorization: Bearer rs_live_…"
Response 200 · JSON
{
  "data": [
    {
      "id": "whk_3b9e",
      "url": "https://tms.example.com/hooks/rigsight",
      "events": ["pti.completed", "pti.out_of_service"],
      "active": true,
      "created_at": "2026-11-28T08:00:00Z"
    }
  ],
  "next_cursor": null
}

Possible errors

  • 401unauthorizedMissing, invalid or revoked API key.
  • 403forbiddenThe key does not have the webhooks:manage scope.
  • 429rate_limitedToo many requests; wait for Retry-After seconds.

Create a webhook endpoint

POST/v1/webhooks

Registers an HTTPS URL to receive events. The response includes the signing secret (whsec_…) exactly once — store it to verify signatures. See Webhooks.

Body parameters

urlstringRequired
Public HTTPS URL. Private IPs and plain HTTP are rejected.
eventsstring[]Required
Any of pti.completed, pti.out_of_service, pti.reviewed, defect.recurring.
activebooleanOptional
Default true. Inactive endpoints receive nothing.
Request · Shell
curl https://api.rigsight.uz/v1/webhooks \
  -H "Authorization: Bearer rs_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://tms.example.com/hooks/rigsight", "events": ["pti.completed", "pti.out_of_service"] }'
Response 201 · JSON
{
  "id": "whk_3b9e",
  "url": "https://tms.example.com/hooks/rigsight",
  "events": ["pti.completed", "pti.out_of_service"],
  "active": true,
  "secret": "whsec_kP2v…",
  "created_at": "2026-11-28T08:00:00Z"
}

Possible errors

  • 400invalid_requestMissing url or events, or an unknown event name.
  • 401unauthorizedMissing, invalid or revoked API key.
  • 403forbiddenThe key does not have the webhooks:manage scope.
  • 422unprocessableURL is not public HTTPS.
  • 429rate_limitedToo many requests; wait for Retry-After seconds.

Retrieve a webhook endpoint

GET/v1/webhooks/{id}

Returns one endpoint, with delivery statistics for the last 24 hours.

Path parameters

idstringRequired
Webhook id (whk_…).
Request · Shell
curl https://api.rigsight.uz/v1/webhooks/whk_3b9e \
  -H "Authorization: Bearer rs_live_…"
Response 200 · JSON
{
  "id": "whk_3b9e",
  "url": "https://tms.example.com/hooks/rigsight",
  "events": ["pti.completed", "pti.out_of_service"],
  "active": true,
  "created_at": "2026-11-28T08:00:00Z",
  "deliveries_24h": { "succeeded": 57, "failed": 1 }
}

Possible errors

  • 401unauthorizedMissing, invalid or revoked API key.
  • 403forbiddenThe key does not have the webhooks:manage scope.
  • 404not_foundNo webhook with this id in your fleet.
  • 429rate_limitedToo many requests; wait for Retry-After seconds.

Update a webhook endpoint

PATCH/v1/webhooks/{id}

Changes the URL, the subscribed events or the active flag. Send only the fields you want to change. The secret does not change.

Path parameters

idstringRequired
Webhook id (whk_…).

Body parameters

urlstringOptional
New public HTTPS URL.
eventsstring[]Optional
Replaces the event list.
activebooleanOptional
Pause (false) or resume (true) deliveries.
Request · Shell
curl -X PATCH https://api.rigsight.uz/v1/webhooks/whk_3b9e \
  -H "Authorization: Bearer rs_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "events": ["pti.completed", "pti.out_of_service", "pti.reviewed"] }'
Response 200 · JSON
{
  "id": "whk_3b9e",
  "url": "https://tms.example.com/hooks/rigsight",
  "events": ["pti.completed", "pti.out_of_service", "pti.reviewed"],
  "active": true,
  "created_at": "2026-11-28T08:00:00Z"
}

Possible errors

  • 400invalid_requestUnknown event name.
  • 401unauthorizedMissing, invalid or revoked API key.
  • 403forbiddenThe key does not have the webhooks:manage scope.
  • 404not_foundNo webhook with this id in your fleet.
  • 422unprocessableURL is not public HTTPS.
  • 429rate_limitedToo many requests; wait for Retry-After seconds.

Delete a webhook endpoint

DELETE/v1/webhooks/{id}

Deletes the endpoint and stops all pending retries for it. This cannot be undone.

Path parameters

idstringRequired
Webhook id (whk_…).
Request · Shell
curl -X DELETE https://api.rigsight.uz/v1/webhooks/whk_3b9e \
  -H "Authorization: Bearer rs_live_…"
Response 200 · JSON
{ "id": "whk_3b9e", "deleted": true }

Possible errors

  • 401unauthorizedMissing, invalid or revoked API key.
  • 403forbiddenThe key does not have the webhooks:manage scope.
  • 404not_foundNo webhook with this id in your fleet.
  • 429rate_limitedToo many requests; wait for Retry-After seconds.

Embed tokens

Short-lived browser tokens for the embed agent.

Create an embed token

POST/v1/embed-tokens

Server-to-server only. Issues a short-lived rs_pub_… token for the embed agent, limited to one truck and the scopes you choose. The token expires after 15 minutes; issue a new one for each page view.

Body parameters

truckstringRequired
Unit number or truck id the token is limited to.
scopesstring[]Required
upload (driver uploads media), read (view results), review (record decisions). Your key needs embed:issue plus the matching API scopes.
localeenumOptional
en, ru or uz. Default en.
userstringOptional
Who is using the page, e.g. their email or name (max 120). Review decisions made in the component are recorded under it.
Request · Shell
curl https://api.rigsight.uz/v1/embed-tokens \
  -H "Authorization: Bearer rs_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "truck": "1045", "scopes": ["upload", "read"], "locale": "uz" }'
Response 201 · JSON
{
  "token": "rs_pub_Zx81…",
  "truck": { "id": "trk_12", "unit_number": "1045" },
  "scopes": ["upload", "read"],
  "locale": "uz",
  "expires_at": "2026-11-28T09:30:00Z"
}

Possible errors

  • 400invalid_requestUnknown scope or locale.
  • 401unauthorizedMissing, invalid or revoked API key.
  • 403forbiddenThe key does not have the embed:issue (or a scope the key itself lacks) scope.
  • 404not_foundNo truck with this id in your fleet.
  • 429rate_limitedToo many requests; wait for Retry-After seconds.