انتقل إلى المحتوى

المطوّرون

مرجع الواجهة

هذا المرجع مأخوذ مباشرة من وصف الواجهة بصيغة OpenAPI، فيبقى مطابقًا لها. نصوصه التقنية بالإنجليزية.

تنزيل وصف الواجهة (OpenAPI) تنزيل مجموعة Postman

GET /accidents

يتطلب مفتاحًا List accidents

Lists your company's recorded accidents, oldest first, one page at a time. Each carries the vehicle, when and where on the map, the kind of party, the source of the report, the share of fault in quarters and the state of the insurance claim. Each also says whether the driver sent it from the app and how many photos it holds. The other party, the driver, the notes, the report and claim numbers, the files themselves and every amount are never shown. Every request is recorded as a read of confidential records. A branch-limited key sees only the accidents of the vehicles that are currently in its branch. Requires the key scope `accidents:read`.

الترويسات

statusOnly accidents whose claim is in this state: none, under_review, accepted, accepted_partly, rejected or received.
vehicleOnly the accidents of this vehicle (its uuid).
updated_sinceOnly accidents changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of accidents.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "5a3c9e12-8d47-4b60-a1f2-7e0b4d9c3a68",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "occurred_at": "2026-05-12T07:48:00Z",
            "lat": 24.7136,
            "lng": 46.6753,
            "party_kind": "vehicle",
            "report_source": "najm",
            "liability_quarters": 2,
            "claim_state": "under_review",
            "from_driver_app": false,
            "photo_count": 0,
            "created_at": "2026-05-12T09:10:12Z",
            "updated_at": "2026-05-12T09:10:12Z",
            "row_version": 2
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /accidents

يتطلب مفتاحًا Record an accident

Records an accident of one of your company's vehicles as the panel does, with its notice to the accident managers: the vehicle, when it happened (ISO 8601 with an offset, not in the future), optionally where on the map, the kind of other party (vehicle, property or none) and the share of fault in quarters. The other party's details, the driver, notes, report and claim numbers, the injury class and files are never accepted: they stay in the panel. A vehicle of another company or branch answers 404 exactly like one that does not exist. A daily cap applies per key and per company. Requires the key scope `fleet:accidents:write`, the company setting for accident writes and an `Idempotency-Key` header. Requires the key scope `fleet:accidents:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

201 The accident that was recorded.
مثال
{
    "success": true,
    "data": {
        "uuid": "5a3c9e12-8d47-4b60-a1f2-7e0b4d9c3a68",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "occurred_at": "2026-05-12T07:48:00Z",
        "lat": 24.7136,
        "lng": 46.6753,
        "party_kind": "vehicle",
        "report_source": "najm",
        "liability_quarters": 2,
        "claim_state": "under_review",
        "from_driver_app": false,
        "photo_count": 0,
        "created_at": "2026-05-12T09:10:12Z",
        "updated_at": "2026-05-12T09:10:12Z",
        "row_version": 2
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /accidents/{uuid}

يتطلب مفتاحًا Read an accident

Reads one of your company's accidents by its uuid. A record of another company or branch answers 404 exactly like one that does not exist. The request is recorded as a read of confidential records. Requires the key scope `accidents:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The accident.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5a3c9e12-8d47-4b60-a1f2-7e0b4d9c3a68",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "occurred_at": "2026-05-12T07:48:00Z",
        "lat": 24.7136,
        "lng": 46.6753,
        "party_kind": "vehicle",
        "report_source": "najm",
        "liability_quarters": 2,
        "claim_state": "under_review",
        "from_driver_app": false,
        "photo_count": 0,
        "created_at": "2026-05-12T09:10:12Z",
        "updated_at": "2026-05-12T09:10:12Z",
        "row_version": 2
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /accidents/{uuid}/claim

يتطلب مفتاحًا Update the claim of an accident

Sets the insurance claim state of one of your company's accidents and its amounts, as the panel does. Send the `row_version` you read; an accident changed meanwhile answers 409. Amounts are text decimals with the currency's places (Arabic digits are read as Latin ones); accepted is not above claimed and received is not above accepted. A received claim is final. A daily cap applies per key and per company. Requires the key scope `fleet:accidents:write`, the company setting for accident writes and an `Idempotency-Key` header. Requires the key scope `fleet:accidents:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The accident with its claim updated.
مثال
{
    "success": true,
    "data": {
        "uuid": "5a3c9e12-8d47-4b60-a1f2-7e0b4d9c3a68",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "occurred_at": "2026-05-12T07:48:00Z",
        "lat": 24.7136,
        "lng": 46.6753,
        "party_kind": "vehicle",
        "report_source": "najm",
        "liability_quarters": 2,
        "claim_state": "under_review",
        "from_driver_app": false,
        "photo_count": 0,
        "created_at": "2026-05-12T09:10:12Z",
        "updated_at": "2026-05-12T09:10:12Z",
        "row_version": 2
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /accidents/{uuid}/clips

يتطلب مفتاحًا Attach a camera clip to an accident

Attaches one camera clip to one of your company's accidents, as the panel does: the clip must be playable, taken by the accident's own vehicle within 6 hours of the accident, and at most 10 clips can be attached. Attaching puts the clip in front of everyone who may open the accident, so the key needs both the scopes `fleet:accidents:write` and `video:events:read`, and its owner must be allowed to view camera events. A clip that does not exist, belongs to another company or another vehicle, or that the key's owner may not view answers 404, all the same. The attachment is recorded and leaves one read of confidential records. A daily cap applies per key and per company. Requires the company setting for accident writes and an `Idempotency-Key` header. Requires the key scope `fleet:accidents:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The accident the clip was attached to.
مثال
{
    "success": true,
    "data": {
        "uuid": "5a3c9e12-8d47-4b60-a1f2-7e0b4d9c3a68",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "occurred_at": "2026-05-12T07:48:00Z",
        "lat": 24.7136,
        "lng": 46.6753,
        "party_kind": "vehicle",
        "report_source": "najm",
        "liability_quarters": 2,
        "claim_state": "under_review",
        "from_driver_app": false,
        "photo_count": 0,
        "created_at": "2026-05-12T09:10:12Z",
        "updated_at": "2026-05-12T09:10:12Z",
        "row_version": 2
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /accidents/{uuid}/clips/{clip}/detach

يتطلب مفتاحًا Detach a camera clip from an accident

Detaches one of the clips already attached to one of your company's accidents. It needs no camera right: removing a clip from view never depends on one. A clip that is not attached to this accident answers 404. The change is recorded. A daily cap applies per key and per company. Requires the key scope `fleet:accidents:write`, the company setting for accident writes and an `Idempotency-Key` header. Requires the key scope `fleet:accidents:write`.

الترويسات

uuid
clip
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The accident the clip was detached from.
مثال
{
    "success": true,
    "data": {
        "uuid": "5a3c9e12-8d47-4b60-a1f2-7e0b4d9c3a68",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "occurred_at": "2026-05-12T07:48:00Z",
        "lat": 24.7136,
        "lng": 46.6753,
        "party_kind": "vehicle",
        "report_source": "najm",
        "liability_quarters": 2,
        "claim_state": "under_review",
        "from_driver_app": false,
        "photo_count": 0,
        "created_at": "2026-05-12T09:10:12Z",
        "updated_at": "2026-05-12T09:10:12Z",
        "row_version": 2
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /alerts

يتطلب مفتاحًا List alerts

Lists your company's alerts (open, acknowledged and closed), oldest first, one page at a time; each carries its kind, severity, vehicle by uuid and times under an opaque ref. A branch-limited key sees only its own branch. Times are UTC; meta.timezone names the platform time zone. A closed alert says how it ended in close_cause: person (a person closed it), condition_cleared (the platform saw the condition normal again) or automatic (the platform closed it without seeing that, for instance when its rule was switched off or the vehicle went silent); it is null while the alert is open, and a client should treat any other value as automatic. Requires the key scope `alerts:read`.

الترويسات

statusOnly alerts in this state: open, acknowledged or closed.
typeOnly alerts of this kind, e.g. OVERSPEED.
vehicleOnly the alerts of this vehicle (its uuid).
branchOnly alerts of this branch (its uuid).
updated_sinceOnly alerts changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of alerts.
مثال
{
    "success": true,
    "data": [
        {
            "ref": "Zk3Q8vTn0aXy7mP2cLw9dA",
            "type": "OVERSPEED",
            "severity": "warning",
            "status": "open",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "occurred_at": "2026-06-01T08:59:10.250Z",
            "acknowledged_at": null,
            "closed_at": null,
            "close_cause": null,
            "updated_at": "2026-06-01T08:59:11Z",
            "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable: the platform has no public-id key configured; the alerts calls refuse until its operator sets it.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "service_unavailable",
        "message": "The service is temporarily unavailable. Retry later."
    },
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /alerts/{ref}

يتطلب مفتاحًا Read an alert

Reads one of your company's alerts by its ref. An alert of another company or branch, an unknown ref and one that is not yet an alert all answer 404. A closed alert says how it ended in close_cause: person (a person closed it), condition_cleared (the platform saw the condition normal again) or automatic (the platform closed it without seeing that, for instance when its rule was switched off or the vehicle went silent); it is null while the alert is open, and a client should treat any other value as automatic. Requires the key scope `alerts:read`.

الترويسات

ref
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The alert.
مثال
{
    "success": true,
    "data": {
        "ref": "Zk3Q8vTn0aXy7mP2cLw9dA",
        "type": "OVERSPEED",
        "severity": "warning",
        "status": "open",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "occurred_at": "2026-06-01T08:59:10.250Z",
        "acknowledged_at": null,
        "closed_at": null,
        "close_cause": null,
        "updated_at": "2026-06-01T08:59:11Z",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable: the platform has no public-id key configured; the alerts calls refuse until its operator sets it.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "service_unavailable",
        "message": "The service is temporarily unavailable. Retry later."
    },
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fleet-assets/{uuid}/assignments

يتطلب مفتاحًا Couple a trailer or assign equipment

Couples one of your trailers to a vehicle, or assigns a piece of equipment to a vehicle or a driver, as the panel does. Send exactly one of `vehicle_uuid` and `driver_uuid`; a trailer takes a vehicle only, an asset that already has a holder answers 422 until the current one is ended, and an unknown or foreign asset, vehicle or driver answers 404. The panel's warning when a head may not pull a trailer is not given here. Requires the key owner's right to update assets and the company's assets API setting. Requires the key scope `fleet:asset_assignments:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The new holding.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6f2c1d9e-4b7a-4e21-9c3d-8a5b0e7f1c22",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "driver_uuid": null,
        "started_at": "2026-11-20T05:00:00Z",
        "ended_at": null,
        "current": true
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-20T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fleet-assets/{uuid}/assignments

يتطلب مفتاحًا Read a fleet asset's assignments

The vehicles and drivers one of your trailers or pieces of equipment was assigned to, newest first, at most 100. A vehicle or driver you may not see, or whose register your own rights do not open, is shown as null. An asset of another company or branch answers 404. Requires the key scope `fleet_assets:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The assignments.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "asset_uuid": "9e2b7c14-3d58-4f0a-b6a1-7c4d2e8f5a10",
        "assignments": [
            {
                "uuid": "6f2c1d9e-4b7a-4e21-9c3d-8a5b0e7f1c22",
                "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
                "driver_uuid": null,
                "started_at": "2026-10-01T05:00:00Z",
                "ended_at": null,
                "current": true
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-15T09:00:00Z"
    }
}
404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fleet-assets/{uuid}/assignments/end

يتطلب مفتاحًا End the current coupling or assignment

Ends the current coupling or assignment of one of your assets with a reason, as the panel does; the holding stays in the history. Send the `assignment_uuid` you mean to end: when another holding is current now it answers 409 and ends nothing. Answers 422 when the asset has no current holder. Requires the key owner's right to update assets and the company's assets API setting. Requires the key scope `fleet:asset_assignments:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The ended holding.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6f2c1d9e-4b7a-4e21-9c3d-8a5b0e7f1c22",
        "started_at": "2026-11-20T05:00:00Z",
        "ended_at": "2026-11-21T05:00:00Z",
        "current": false
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-21T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fleet-assets/{uuid}/files

يتطلب مفتاحًا Attach a file to a fleet asset

Attaches a PDF, JPEG or PNG to one of your trailers or pieces of equipment, with its kind and an optional end day, as the panel does. The file name you send is not kept. A JPEG that carries a GPS position is refused. An asset of another company or branch answers 404. Requires the key scope `fleet:asset_files:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The attached file.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5d1c8a47-2e93-4b6f-9a10-3c7e5f9b2d64",
        "kind": "insurance",
        "attached_on": "2026-11-01",
        "expires_on": "2027-11-01"
    },
    "error": null,
    "meta": []
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fleet-assets/{uuid}/files

يتطلب مفتاحًا List a fleet asset's files

The files of one of your trailers or pieces of equipment that were not removed, the newest first: kind and the day they were attached. An asset of another company or branch answers 404. Requires the key scope `fleet_assets:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The files.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "asset_uuid": "9e2b7c14-3d58-4f0a-b6a1-7c4d2e8f5a10",
        "files": [
            {
                "uuid": "5d1c8a47-2e93-4b6f-9a10-3c7e5f9b2d64",
                "kind": "insurance",
                "attached_on": "2026-11-01",
                "expires_on": "2027-11-01"
            }
        ]
    },
    "error": null,
    "meta": []
}
404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fleet-assets/{uuid}/files/{fileUuid}/void

يتطلب مفتاحًا Remove a fleet asset file

Removes one file from the asset's list with a reason; the file stays in the record and is never deleted. A file of another company, branch or asset answers 404. Requires the key scope `fleet:asset_files:write`.

الترويسات

uuid
fileUuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The removed file.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5d1c8a47-2e93-4b6f-9a10-3c7e5f9b2d64",
        "kind": "insurance",
        "attached_on": "2026-11-01",
        "expires_on": "2027-11-01"
    },
    "error": null,
    "meta": []
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fleet-assets

يتطلب مفتاحًا Create a trailer or equipment

Creates a trailer or a piece of equipment of your company, as the panel does. Catalogue values (category, make, model) are sent by code; an unknown code answers 422. Only an owned or co-owned asset is accepted: a lessor is never taken through a key. Requires the key scope `fleet:assets:write`, the company's assets API setting, an owner who manages assets, and an `Idempotency-Key` header. Requires the key scope `fleet:assets:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The asset that was created.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "9e2b7c14-3d58-4f0a-b6a1-7c4d2e8f5a10",
        "status": "active",
        "asset_tag": "TR-014",
        "name": "Flatbed trailer 14",
        "kind": "trailer",
        "category": "flatbed_trailer",
        "make": "Schmitz Cargobull",
        "make_code": "schmitz_cargobull",
        "model": "S01",
        "model_code": "s01",
        "version": "Mk2",
        "version_code": "mk2",
        "manufacture_year": 2021,
        "serial_number": "SN-0914",
        "chassis_number": "WSM00000000000014",
        "plate_number": "1234 ABC",
        "ownership_type": "owned",
        "capacity_value": "28.000",
        "capacity_unit": "ton",
        "coupling_type": "kingpin",
        "gross_weight_kg": 39000,
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "archived_at": null,
        "created_at": "2026-03-01T08:30:00Z",
        "updated_at": "2026-05-12T11:05:42Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-17T09:00:00Z"
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fleet-assets

يتطلب مفتاحًا List fleet assets

Lists your company's trailers and equipment, oldest first, one page at a time. Archived assets are left out unless you ask for status=archived. A branch-limited key sees only its own branch. The lessor and the notes are never returned. Requires the key scope `fleet_assets:read`.

الترويسات

statusOnly assets in this state.
branchOnly assets of this branch (its uuid).
updated_sinceOnly assets changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of fleet assets.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "9e2b7c14-3d58-4f0a-b6a1-7c4d2e8f5a10",
            "status": "active",
            "asset_tag": "TR-014",
            "name": "Flatbed trailer 14",
            "kind": "trailer",
            "category": "flatbed_trailer",
            "make": "Schmitz Cargobull",
            "make_code": "schmitz_cargobull",
            "model": "S01",
            "model_code": "s01",
            "version": "Mk2",
            "version_code": "mk2",
            "manufacture_year": 2021,
            "serial_number": "SN-0914",
            "chassis_number": "WSM00000000000014",
            "plate_number": "1234 ABC",
            "ownership_type": "owned",
            "capacity_value": "28.000",
            "capacity_unit": "ton",
            "coupling_type": "kingpin",
            "gross_weight_kg": 39000,
            "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
            "archived_at": null,
            "created_at": "2026-03-01T08:30:00Z",
            "updated_at": "2026-05-12T11:05:42Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

PATCH /fleet-assets/{uuid}

يتطلب مفتاحًا Edit a trailer or equipment

Changes the fields you send; the others stay. Send the `row_version` you read: a stale one answers 409. The kind never changes. Requires the key scope `fleet:assets:write` and an `Idempotency-Key` header. Requires the key scope `fleet:assets:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The asset after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "9e2b7c14-3d58-4f0a-b6a1-7c4d2e8f5a10",
        "status": "active",
        "asset_tag": "TR-014",
        "name": "Flatbed trailer 14",
        "kind": "trailer",
        "category": "flatbed_trailer",
        "make": "Schmitz Cargobull",
        "make_code": "schmitz_cargobull",
        "model": "S01",
        "model_code": "s01",
        "version": "Mk2",
        "version_code": "mk2",
        "manufacture_year": 2021,
        "serial_number": "SN-0914",
        "chassis_number": "WSM00000000000014",
        "plate_number": "1234 ABC",
        "ownership_type": "owned",
        "capacity_value": "28.000",
        "capacity_unit": "ton",
        "coupling_type": "kingpin",
        "gross_weight_kg": 39000,
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "archived_at": null,
        "created_at": "2026-03-01T08:30:00Z",
        "updated_at": "2026-05-12T11:05:42Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-17T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fleet-assets/{uuid}

يتطلب مفتاحًا Read a fleet asset

Reads one of your company's trailers or pieces of equipment by its uuid. An asset of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `fleet_assets:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The fleet asset.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "9e2b7c14-3d58-4f0a-b6a1-7c4d2e8f5a10",
        "status": "active",
        "asset_tag": "TR-014",
        "name": "Flatbed trailer 14",
        "kind": "trailer",
        "category": "flatbed_trailer",
        "make": "Schmitz Cargobull",
        "make_code": "schmitz_cargobull",
        "model": "S01",
        "model_code": "s01",
        "version": "Mk2",
        "version_code": "mk2",
        "manufacture_year": 2021,
        "serial_number": "SN-0914",
        "chassis_number": "WSM00000000000014",
        "plate_number": "1234 ABC",
        "ownership_type": "owned",
        "capacity_value": "28.000",
        "capacity_unit": "ton",
        "coupling_type": "kingpin",
        "gross_weight_kg": 39000,
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "archived_at": null,
        "created_at": "2026-03-01T08:30:00Z",
        "updated_at": "2026-05-12T11:05:42Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fleet-assets/{uuid}/archive

يتطلب مفتاحًا Archive a trailer or equipment

Archives an asset with a reason: it leaves the active lists and keeps its record. A coupled trailer must be uncoupled first. Send the `row_version` you read: a stale one answers 409. Requires the key scope `fleet:assets:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The archived asset.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "9e2b7c14-3d58-4f0a-b6a1-7c4d2e8f5a10",
        "status": "active",
        "asset_tag": "TR-014",
        "name": "Flatbed trailer 14",
        "kind": "trailer",
        "category": "flatbed_trailer",
        "make": "Schmitz Cargobull",
        "make_code": "schmitz_cargobull",
        "model": "S01",
        "model_code": "s01",
        "version": "Mk2",
        "version_code": "mk2",
        "manufacture_year": 2021,
        "serial_number": "SN-0914",
        "chassis_number": "WSM00000000000014",
        "plate_number": "1234 ABC",
        "ownership_type": "owned",
        "capacity_value": "28.000",
        "capacity_unit": "ton",
        "coupling_type": "kingpin",
        "gross_weight_kg": 39000,
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "archived_at": null,
        "created_at": "2026-03-01T08:30:00Z",
        "updated_at": "2026-05-12T11:05:42Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-17T09:00:00Z"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fleet-assets/{uuid}/restore

يتطلب مفتاحًا Restore a trailer or equipment

Brings an archived asset back to the active lists. Send the `row_version` you read: a stale one answers 409; a tag already used by another asset answers 422. Requires the key scope `fleet:assets:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The restored asset.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "9e2b7c14-3d58-4f0a-b6a1-7c4d2e8f5a10",
        "status": "active",
        "asset_tag": "TR-014",
        "name": "Flatbed trailer 14",
        "kind": "trailer",
        "category": "flatbed_trailer",
        "make": "Schmitz Cargobull",
        "make_code": "schmitz_cargobull",
        "model": "S01",
        "model_code": "s01",
        "version": "Mk2",
        "version_code": "mk2",
        "manufacture_year": 2021,
        "serial_number": "SN-0914",
        "chassis_number": "WSM00000000000014",
        "plate_number": "1234 ABC",
        "ownership_type": "owned",
        "capacity_value": "28.000",
        "capacity_unit": "ton",
        "coupling_type": "kingpin",
        "gross_weight_kg": 39000,
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "archived_at": null,
        "created_at": "2026-03-01T08:30:00Z",
        "updated_at": "2026-05-12T11:05:42Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-17T09:00:00Z"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /assignments

يتطلب مفتاحًا List driver assignments

Lists which driver drives which vehicle, newest first, one page at a time (at most 100). A row names the vehicle and the driver by uuid, the role, when it began and ended, and its origin and end reason as fixed words; never a name, a note or who made it. A driver or vehicle outside the key owner's branch or rights is left out. Requires the key scope `fleet:assignments:read`. Requires the key scope `fleet:assignments:read`.

الترويسات

vehicleOnly this vehicle (its uuid).
driverOnly this driver (its uuid).
currenttrue for the assignments still running, false for the ended ones.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of assignments.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "driver_uuid": "3c1e9a52-8d47-4b6a-a2f0-5e7d9b4c1a44",
            "role": "main",
            "started_at": "2026-03-01T08:30:00Z",
            "ended_at": null,
            "end_reason": null,
            "origin": "manual",
            "current": true
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /billing/invoices

يتطلب مفتاحًا List invoices

Lists your company's invoices, oldest first, one page at a time; draft invoices are never shown. Money is whole minor units (halalas) next to the currency. A day's rows are capped per key and per company (429, reason `daily_rows`), and a key may make 60 calls a minute (429, reason `calls_per_minute`). Requires the key scope `billing:read` and an owner who may view or pay invoices; the module is closed (404) until the platform opens it. Requires the key scope `billing:read`.

الترويسات

statusOnly invoices in this state: issued, partially_paid, paid, credited, written_off or void.
issued_fromOnly invoices issued on or after this date (YYYY-MM-DD); send it with `issued_to`, at most 366 days apart.
issued_toOnly invoices issued on or before this date (YYYY-MM-DD).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 One page of invoices; next_cursor is null on the last page.
مثال
{
    "success": true,
    "data": [
        {
            "uuid": "9b1e7c3a-4d52-4f08-8a6b-2c5d7e9f1a30",
            "number": "INV-2026-000412",
            "series": "tax",
            "status": "issued",
            "currency": "SAR",
            "subtotal_minor": 10000,
            "tax_minor": 1500,
            "total_minor": 11500,
            "balance_minor": 11500,
            "credited_minor": 0,
            "issue_date": "2026-10-01",
            "due_date": "2026-10-31",
            "created_at": "2026-10-01T08:00:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 25,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /billing/invoices/{uuid}

يتطلب مفتاحًا Read an invoice

Reads one of your company's invoices by its uuid with its lines, at most 200 (`lines_truncated` says when more exist). An invoice of another company, and a draft, answers 404 exactly like one that does not exist; the read counts one row of the day's budget. Requires the key scope `billing:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The invoice with its lines.
مثال
{
    "success": true,
    "data": {
        "uuid": "9b1e7c3a-4d52-4f08-8a6b-2c5d7e9f1a30",
        "number": "INV-2026-000412",
        "series": "tax",
        "status": "issued",
        "currency": "SAR",
        "subtotal_minor": 10000,
        "tax_minor": 1500,
        "total_minor": 11500,
        "balance_minor": 11500,
        "credited_minor": 0,
        "issue_date": "2026-10-01",
        "due_date": "2026-10-31",
        "created_at": "2026-10-01T08:00:00Z",
        "lines": [
            {
                "description": "اشتراك المركبات - أكتوبر 2026",
                "quantity_thousandths": 10000,
                "unit_price_minor": 1000,
                "tax_category": "standard",
                "tax_rate_basis_points": 1500,
                "tax_minor": 1500,
                "subtotal_minor": 10000,
                "total_minor": 11500
            }
        ],
        "lines_truncated": false
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /billing/mandates

يتطلب مفتاحًا List saved cards

Lists your company's saved cards in the truncated form the panel shows: brand, last four digits, expiry and state. Never a holder name, a token or a gateway reference. Requires the key scope `billing:read` and an owner who may pay invoices (the view right alone is refused); the module is closed (404) until the platform opens it. Requires the key scope `billing:read`.

الترويسات

stateOnly cards in this state: active, revoked or failing.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 One page of saved cards; next_cursor is null on the last page.
مثال
{
    "success": true,
    "data": [
        {
            "uuid": "2d8f4a6c-3b19-4e70-8c5a-9e1b3d7f0a42",
            "card_brand": "visa",
            "card_last4": "4242",
            "card_exp_month": 12,
            "card_exp_year": 2028,
            "state": "active",
            "created_at": "2026-09-01T10:00:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 25,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /billing/payments

يتطلب مفتاحًا List payments

Lists the payments against your company's invoices, oldest first, one page at a time. A pending offline transfer does not reduce an invoice's balance until it is confirmed. The bank or gateway reference is never shown. Requires the key scope `billing:read` and an owner who may view or pay invoices; the module is closed (404) until the platform opens it. Requires the key scope `billing:read`.

الترويسات

stateOnly payments in this state: pending_review, confirmed or rejected.
invoice_uuidOnly the payments of this invoice.
received_fromOnly payments received on or after this date (YYYY-MM-DD); send it with `received_to`, at most 366 days apart.
received_toOnly payments received on or before this date (YYYY-MM-DD).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 One page of payments; next_cursor is null on the last page.
مثال
{
    "success": true,
    "data": [
        {
            "uuid": "4e6a2b8c-1d37-4c95-9f0e-7a3b5c8d2e61",
            "method": "bank_transfer",
            "state": "confirmed",
            "amount_minor": 11500,
            "currency": "SAR",
            "received_on": "2026-10-05",
            "created_at": "2026-10-05T09:30:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 25,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /reports/branch-profit

يتطلب مفتاحًا Read the branch profitability report

Lists, for each of your branches, what its delivered orders earned and what fell on it in the period: the cost of those orders, of its vehicles' empty trips, of their idle days and of the trips not yet delivered, the margin and its percent of the revenue. Orders of a branch-less vehicle appear under a null branch. Money is a list of lines, one per currency, never added across currencies. The period is whole Saudi days, at most a year; no driver is named. Requires the key scope `reporting:reports_branch_profit:read`.

الترويسات

fromStart of the period, ISO 8601 with an offset.
toEnd of the period, after from and at most 366 days later; its Saudi day is included.
branchOnly this branch (its uuid).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 One page of branches; meta.withheld_trips counts trips left out because their orders may not be read.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "branch_uuid": "3f6b1c0e-8d2a-4c57-b1a9-6e0d4f7a2c11",
            "delivered_orders": 40,
            "unpriced_orders": 1,
            "revenue": [
                {
                    "currency": "SAR",
                    "amount": "120000.00"
                }
            ],
            "order_cost": [
                {
                    "currency": "SAR",
                    "amount": "70000.00"
                }
            ],
            "empty_trips_cost": [],
            "idle_cost": [
                {
                    "currency": "SAR",
                    "amount": "4000.00"
                }
            ],
            "unfinished_cost": [],
            "margin": [
                {
                    "currency": "SAR",
                    "amount": "46000.00"
                }
            ],
            "margin_percent": [
                {
                    "currency": "SAR",
                    "percent": "38.3"
                }
            ]
        }
    ],
    "meta": {
        "page": {
            "limit": 50,
            "next_cursor": null
        },
        "withheld_trips": 0
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /maintenance/breakdowns

يتطلب مفتاحًا Read the breakdown figures of each vehicle

Lists, for each of your vehicles that had a breakdown repair in the period, the number of breakdowns, the defects by severity, the seconds it stood out of service (and, separately, the seconds estimated for stops whose return was not recorded) and the repeat faults. Most breakdowns first. A key limited to a branch sees that branch's vehicles only. Never an amount of money, a driver, a workshop or an order text. The period is required and at most 366 days. Requires the key scope `maintenance:read`.

الترويسات

fromStart of the period, ISO 8601 with an offset.
toEnd of the period, after from and at most 366 days later.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of vehicles with their breakdown figures.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "breakdowns": 3,
            "minor_defects": 1,
            "major_defects": 2,
            "critical_defects": 0,
            "stopped_seconds": 172800,
            "stops_without_return_recorded": 1,
            "estimated_stopped_seconds": 43200,
            "repeat_faults": 1
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fleet/budget

يتطلب مفتاحًا Read the company budget of a year

Lists the budget lines of one year: for each cost kind (fuel, maintenance, expenses) and month that has an amount, the amount in minor units of its currency. The whole company is the default; vehicle_type narrows it to the lines set for one vehicle type. Only months with an amount appear. A key bound to a branch gets 403. Requires the key scope `fleet:budget:read`, whose owner must still see the budget on every call; every read is recorded. Requires the key scope `fleet:budget:read`.

الترويسات

yearThe calendar year, from 2020 to 2099.
vehicle_typeOnly the lines set for this vehicle type, by its code.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The budget lines of the year.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "cost_kind": "maintenance",
            "month": "2026-01",
            "currency": "SAR",
            "amount_minor": 150000
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /buyers

يتطلب مفتاحًا List buyers

The names of the buyers your company keeps, one page at a time; archived buyers are left out. Identity numbers and phones are never shown. Needs the finance right over the whole company (403 otherwise); the reading is recorded. Requires the key scope `buyers:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of buyers.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "3f2b1c9e-8d47-4a6b-9c15-7e0a4d2b6f31",
            "name": "Example Trading Co",
            "created_at": "2026-05-12T12:00:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /buyers

يتطلب مفتاحًا Keep a buyer

Keeps a buyer for your company, as the buyers page does: a name and optionally a phone. An identity number is never accepted over a key. A phone the company already keeps answers 422 without saying which buyer. The answer is the uuid and the name; the phone is never shown. Needs the finance right over the whole company (403 otherwise) and the Idempotency-Key header; 30 an hour per key. Requires the key scope `fleet:disposal:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The buyer that was kept.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3f2b1c9e-8d47-4a6b-9c15-7e0a4d2b6f31",
        "name": "Example Trading Co",
        "created_at": "2026-05-12T12:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /buyers/{uuid}

يتطلب مفتاحًا Read a buyer

One buyer your company keeps: the uuid and the name. Identity numbers and phones are never shown. Needs the finance right over the whole company (403 otherwise); a buyer of another company or an archived one answers 404; the reading is recorded. Requires the key scope `buyers:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The buyer.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3f2b1c9e-8d47-4a6b-9c15-7e0a4d2b6f31",
        "name": "Example Trading Co",
        "created_at": "2026-05-12T12:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /roadside/cases

يتطلب مفتاحًا List roadside cases

Lists your company's roadside assistance cases, oldest first, one page at a time. Each carries the vehicle, what stopped it, its urgency, its state and where and when it happened; the free-text note and the people are never included. Requires the key scope `assistance:cases:read`.

الترويسات

statusOnly cases in this state: reported, requested, accepted, en_route, on_site, done or cancelled.
updated_sinceOnly cases changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of roadside cases.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "status": "accepted",
            "symptom": "engine",
            "urgency": "high",
            "can_move": "no",
            "need": "tow",
            "outcome": null,
            "lat": "24.713600",
            "lng": "46.675300",
            "expected_resume_at": null,
            "opened_at": "2026-06-01T08:12:00Z",
            "closed_at": null,
            "created_at": "2026-06-01T08:12:05Z",
            "updated_at": "2026-06-01T08:20:41Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /roadside/cases

يتطلب مفتاحًا Open a roadside case

Opens a roadside case for one of your company's vehicles, with the same rules as the panel: the vehicle must be yours and not archived, and a vehicle that already has an open case joins it (the answer is that case, status 200; a new case answers 201). A vehicle of another company or one that does not exist answers 404. Send an `Idempotency-Key` so a retry never opens twice. Requires the key scope `assistance:cases:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

201 The new case.
مثال
{
    "success": true,
    "data": {
        "uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "status": "accepted",
        "symptom": "engine",
        "urgency": "high",
        "can_move": "no",
        "need": "tow",
        "outcome": null,
        "lat": "24.713600",
        "lng": "46.675300",
        "expected_resume_at": null,
        "opened_at": "2026-06-01T08:12:00Z",
        "closed_at": null,
        "created_at": "2026-06-01T08:12:05Z",
        "updated_at": "2026-06-01T08:20:41Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /roadside/cases/{uuid}

يتطلب مفتاحًا Read a roadside case

Reads one of your company's roadside cases by its uuid. A case of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `assistance:cases:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The case.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "status": "accepted",
        "symptom": "engine",
        "urgency": "high",
        "can_move": "no",
        "need": "tow",
        "outcome": null,
        "lat": "24.713600",
        "lng": "46.675300",
        "expected_resume_at": null,
        "opened_at": "2026-06-01T08:12:00Z",
        "closed_at": null,
        "created_at": "2026-06-01T08:12:05Z",
        "updated_at": "2026-06-01T08:20:41Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /roadside/cases/{uuid}/cancel

يتطلب مفتاحًا Cancel a roadside case

Cancels one of your company's roadside cases that is not finished and has no responder on the way, with the reason; the driver and the staff of the case are told. A case whose responder is accepted, on the way or on site answers 409 responder_dispatched: it is ended in the panel. Send the `row_version` you read: a case changed meanwhile answers 409. A case of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `assistance:cases:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The case after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "status": "accepted",
        "symptom": "engine",
        "urgency": "high",
        "can_move": "no",
        "need": "tow",
        "outcome": null,
        "lat": "24.713600",
        "lng": "46.675300",
        "expected_resume_at": null,
        "opened_at": "2026-06-01T08:12:00Z",
        "closed_at": null,
        "created_at": "2026-06-01T08:12:05Z",
        "updated_at": "2026-06-01T08:20:41Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /roadside/cases/{uuid}/advance

يتطلب مفتاحًا Move a roadside case to its next state

Moves one of your company's roadside cases to its next state (reported, requested, accepted, en_route, on_site); the last step, done, is the close and is not available here. Send the `row_version` you read: a case changed meanwhile answers 409. A case of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `assistance:cases:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The case after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "status": "accepted",
        "symptom": "engine",
        "urgency": "high",
        "can_move": "no",
        "need": "tow",
        "outcome": null,
        "lat": "24.713600",
        "lng": "46.675300",
        "expected_resume_at": null,
        "opened_at": "2026-06-01T08:12:00Z",
        "closed_at": null,
        "created_at": "2026-06-01T08:12:05Z",
        "updated_at": "2026-06-01T08:20:41Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /roadside/cases/{uuid}/close

يتطلب مفتاحًا Close a roadside case

Closes one of your company's roadside cases that is on site, with how it ended. Nothing else is created: a corrective work order is opened in the panel. Send the `row_version` you read: a case changed meanwhile answers 409. A case of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `assistance:cases:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The case after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "status": "accepted",
        "symptom": "engine",
        "urgency": "high",
        "can_move": "no",
        "need": "tow",
        "outcome": null,
        "lat": "24.713600",
        "lng": "46.675300",
        "expected_resume_at": null,
        "opened_at": "2026-06-01T08:12:00Z",
        "closed_at": null,
        "created_at": "2026-06-01T08:12:05Z",
        "updated_at": "2026-06-01T08:20:41Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /roadside/cases/{uuid}/notes

يتطلب مفتاحًا Add a note to a roadside case

Puts a short note on the timeline of one of your company's roadside cases that is not finished, as the panel does; it changes no state. A finished case answers 409 final. A case of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `assistance:cases:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The case after the note.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "status": "accepted",
        "symptom": "engine",
        "urgency": "high",
        "can_move": "no",
        "need": "tow",
        "outcome": null,
        "lat": "24.713600",
        "lng": "46.675300",
        "expected_resume_at": null,
        "opened_at": "2026-06-01T08:12:00Z",
        "closed_at": null,
        "created_at": "2026-06-01T08:12:05Z",
        "updated_at": "2026-06-01T08:20:41Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /vehicle-catalogue/requests

يتطلب مفتاحًا Ask the catalogue for a missing make, model or type

Files a request to add a make, a model or a vehicle type the catalogue lacks, for Tawasul staff to decide; the vehicle catalogue itself is not changed. The answer is `filed` (a new request), or `known` when an approved value or alias already names the text, and the same limits as the panel apply: 429 with the reason `pending_cap` or `daily_cap`. Requires the key scope `fleet:vehicles:write`, its owner's right to update vehicles, and an `Idempotency-Key` header. Requires the key scope `fleet:vehicles:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The request was filed or the value is already known.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "state": "filed"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /drivers/licence-classes

يتطلب مفتاحًا List driving licence classes

Lists the active driving licence classes by code, one page at a time, with the minimum age and the heaviest gross weight each allows. Requires the key scope `drivers:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of licence classes.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "code": "heavy",
            "name_ar": "ثقيل",
            "name_en": "Heavy",
            "min_age": 21,
            "max_gross_kg": null
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /inspections/templates

يتطلب مفتاحًا List inspection templates

Lists the active inspection checklists by code, one page at a time; read one by its code to get its items. Requires the key scope `inspections:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of inspection templates.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "code": "pre_trip",
            "name_ar": "فحص قبل الرحلة",
            "name_en": "Pre-trip check"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /inspections/templates/{code}

يتطلب مفتاحًا Read an inspection template

Reads one active inspection checklist by its code, with its active items in order. An unknown or switched-off code answers 404. Requires the key scope `inspections:read`.

الترويسات

code
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The template with its items.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "code": "pre_trip",
        "name_ar": "فحص قبل الرحلة",
        "name_en": "Pre-trip check",
        "items": [
            {
                "code": "tyres",
                "name_ar": "الإطارات",
                "name_en": "Tyres"
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /defects/causes

يتطلب مفتاحًا List failure causes

Lists the active failure causes by code, one page at a time. Requires the key scope `defects:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of failure causes.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "code": "unknown",
            "name_ar": "غير معروف",
            "name_en": "Unknown"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /maintenance/categories

يتطلب مفتاحًا List maintenance categories

Lists the active maintenance categories by code, one page at a time. Requires the key scope `maintenance:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of maintenance categories.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "code": "oil_change",
            "name_ar": "تغيير الزيت",
            "name_en": "Oil change"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /expenses/types

يتطلب مفتاحًا List expense types

Lists the active expense types by code, one page at a time: the platform's own and the ones your company added for itself; another company's types are never shown. Requires the key scope `expenses:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of expense types.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "code": "fuel",
            "name_ar": "وقود",
            "name_en": "Fuel",
            "own": false
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /expenses/types

يتطلب مفتاحًا Add an expense type

Adds an expense type of your own company, named in Arabic and optionally in English, as the panel does: it then appears in the list of expense types and can be used when recording an expense. A name your company already has is refused. Send an Idempotency-Key header so a retry does not add it twice. Requires the key scope `fleet:expenses:write`. Requires the key scope `fleet:expenses:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The type that was added, with the code to use when recording an expense.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "code": "c12_a1b2c3d4",
        "name_ar": "رسوم موقف",
        "name_en": "Parking fees",
        "is_active": true
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicle-catalogue/colours

يتطلب مفتاحًا List vehicle colours

Lists the active vehicle colours by code, one page at a time, each with its swatch. Requires the key scope `vehicles:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of colours.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "code": "white",
            "name_ar": "أبيض",
            "name_en": "White",
            "hex": "#FFFFFF"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicle-catalogue/fuel-types

يتطلب مفتاحًا List fuel types

Lists the active fuel types by code, one page at a time. Requires the key scope `vehicles:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of fuel types.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "code": "diesel",
            "name_ar": "ديزل",
            "name_en": "Diesel"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicle-catalogue/categories

يتطلب مفتاحًا List vehicle categories

Lists the active vehicle categories by code, one page at a time, with the weight and seat bounds that only suggest a category. Requires the key scope `vehicles:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of vehicle categories.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "code": "heavy_truck",
            "name_ar": "شاحنة ثقيلة",
            "name_en": "Heavy truck",
            "min_gross_kg": 7500,
            "max_gross_kg": null,
            "min_seats": null,
            "max_seats": null,
            "is_equipment": false
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /collection-runs

يتطلب مفتاحًا List collection runs

Lists your company's collection runs, oldest first, one page at a time, with how many of each run's containers are done, skipped or waiting. A branch-limited key sees only its own branch. The driver, the vehicle, the notes and any position are never returned. Requires the key scope `waste:runs:read`.

الترويسات

statusOnly runs in this state.
branchOnly runs of this branch (its uuid).
updated_sinceOnly runs changed at or after this moment (ISO 8601 with an offset); a moment older than 92 days reads as 92 days ago.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of collection runs.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "7c2e9d10-4a6b-4f83-9b15-0d3e8a1c5f67",
            "name": "North districts, Sunday morning",
            "status": "in_progress",
            "planned_for": "2026-06-01",
            "planned_time": "06:00:00",
            "scheduled": true,
            "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
            "stops_total": 24,
            "stops_done": 9,
            "stops_skipped": 1,
            "stops_pending": 14,
            "started_at": "2026-06-01T03:05:10Z",
            "completed_at": null,
            "created_at": "2026-05-31T12:00:00Z",
            "updated_at": "2026-06-01T05:40:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /collection-runs/{uuid}

يتطلب مفتاحًا Read a collection run

Reads one of your company's collection runs by its uuid. A run of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `waste:runs:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The collection run.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7c2e9d10-4a6b-4f83-9b15-0d3e8a1c5f67",
        "name": "North districts, Sunday morning",
        "status": "in_progress",
        "planned_for": "2026-06-01",
        "planned_time": "06:00:00",
        "scheduled": true,
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "stops_total": 24,
        "stops_done": 9,
        "stops_skipped": 1,
        "stops_pending": 14,
        "started_at": "2026-06-01T03:05:10Z",
        "completed_at": null,
        "created_at": "2026-05-31T12:00:00Z",
        "updated_at": "2026-06-01T05:40:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /command-batches

يتطلب مفتاحًا List bulk commands

Lists the commands sent to many devices at once, oldest first, one page at a time, with how many lines ended in each state. You see the batches your key's owner started; a company administrator sees all of the company's. Device identities and command values are never returned. Requires the key scope `command_batches:read`.

الترويسات

statusOnly batches in this state.
updated_sinceOnly batches created at or after this moment (ISO 8601 with an offset).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of bulk commands.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "2f9a6e41-5c07-4d8b-a3e2-9b1c7d4f8e60",
            "command": "Request position",
            "state": "finished",
            "total": 40,
            "lines": {
                "queued": 0,
                "sending": 0,
                "accepted": 37,
                "unconfirmed": 1,
                "refused": 1,
                "not_linked": 1,
                "cancelled": 0
            },
            "created_at": "2026-11-14T08:30:00Z",
            "finished_at": "2026-11-14T11:10:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /command-batches/{uuid}

يتطلب مفتاحًا Read a bulk command

Reads one bulk command by its uuid with its lines: each line's device brand and model, state and a closed reason code (never the IMEI, which needs the devices scope). A batch you may not see answers 404 exactly like one that does not exist. Requires the key scope `command_batches:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The bulk command with its lines.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "2f9a6e41-5c07-4d8b-a3e2-9b1c7d4f8e60",
        "command": "Request position",
        "state": "finished",
        "total": 40,
        "lines": {
            "queued": 0,
            "sending": 0,
            "accepted": 37,
            "unconfirmed": 1,
            "refused": 1,
            "not_linked": 1,
            "cancelled": 0
        },
        "created_at": "2026-11-14T08:30:00Z",
        "finished_at": "2026-11-14T11:10:00Z",
        "device_lines": [
            {
                "line": 1,
                "device": "Teltonika FMC130",
                "state": "accepted",
                "reason": null
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /reports

يتطلب مفتاحًا List readable reports

Lists the reports this key may read now: those its owner could export to Excel at this moment (the same rights, plan and readiness), with their filters and columns. Profit, ranking and screen-only reports are never listed; the fuel and impact reports are read on their own addresses. Requires the key scope `reporting:company_reports:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The readable reports.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "key": "maintenance_costs",
            "title": "Maintenance costs",
            "family": "fleet_cost",
            "filters": [
                "period",
                "branch",
                "vehicle"
            ],
            "period_required": true,
            "max_days": 92,
            "columns": [
                {
                    "key": "plate",
                    "label": "Plate"
                },
                {
                    "key": "total",
                    "label": "Total"
                }
            ]
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /reports/{key}

يتطلب مفتاحًا Read a report

Reads one page of a report with the columns and cells its owner's Excel export would carry; personal data stays masked. A report the key may not read answers 404 exactly like one that does not exist. Every read is recorded as an export. The rows returned count against a daily budget of the key and of the company; once one is spent the answer is 429 with Retry-After. Since 2026-11-15 a query key this endpoint does not list answers 422 (validation_failed, the key named in error.details) instead of being ignored. Requires the key scope `reporting:company_reports:read`.

الترويسات

key
from
until
branch
vehicle
driver
category
group
search
sort
direction
compare
baseline_from
baseline_until
page
per_page
view
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 One page of the report.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "key": "maintenance_costs",
        "title": "Maintenance costs",
        "columns": [
            {
                "key": "plate",
                "label": "Plate"
            }
        ],
        "rows": [
            {
                "plate": "ABC 1234"
            }
        ],
        "notices": [],
        "period": {
            "from": "2026-05-01",
            "until": "2026-05-31"
        },
        "data_as_of": null
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "page": 1,
            "per_page": 50,
            "has_more": false
        }
    }
}
404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /reports/{key}/views

يتطلب مفتاحًا List my saved views of a report

Lists the saved views the key's owner made of this report in the portal, each with an opaque handle to pass as view= when reading it. Another person's views are never listed, and a report the key may not read answers 404. Requires the key scope `reporting:company_reports:read`.

الترويسات

key
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The owner's own saved views of the report.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "handle": "Qm9vay1yZXBvcnQtdmlldw",
            "name": "Riyadh branch, last month",
            "is_default": false
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /reports/{key}/views

يتطلب مفتاحًا Save a view of a report

Saves the filters given (the read's own: period, branch, vehicle and driver by uuid, category, group, search, sort, compare) as one of your views of the report, under a plain name; it opens in the portal too and reads back with view=. At most 50 views of one report; at most 6 pinned. Send an Idempotency-Key header. Requires the key scope `reporting:report_views:write`.

الترويسات

key
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The saved view; its handle names it in every next call.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "handle": "Vmlldy1vZi1hLXJlcG9ydA",
        "name": "Weekly, Riyadh branch",
        "is_default": false,
        "pinned": false
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /reports/{key}/charts

يتطلب مفتاحًا Read a report's charts

The charts the portal draws for the report with the same filters (and view=), in your own scope: what to draw and its numbers. A chart grouped by a named driver is never given; at most 20 charts of at most 500 points, and the points count against the daily row budget. Recorded as a read. Requires the key scope `reporting:company_reports:read`.

الترويسات

key
from
until
branch
vehicle
driver
category
group
search
sort
direction
compare
baseline_from
baseline_until
page
per_page
view
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The charts of the report for the period, each with what to draw and its numbers.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "key": "maintenance_costs",
        "title": "Maintenance costs",
        "period": {
            "from": "2026-05-01",
            "until": "2026-06-01"
        },
        "charts": [
            {
                "kind": "columns",
                "title": "Cost by month",
                "labels": [
                    "Mar",
                    "Apr",
                    "May"
                ],
                "series": [
                    {
                        "label": "SAR",
                        "values": [
                            1200,
                            980.5,
                            1430
                        ],
                        "tone": "primary",
                        "xs": null,
                        "targets": null,
                        "estimated": false
                    }
                ],
                "unit": "SAR",
                "decimals": 2,
                "note": null,
                "point_titles": null,
                "lower_is_better": true,
                "bands": [],
                "reference": null,
                "x_title": null,
                "y_title": null
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /reports/{key}/files

يتطلب مفتاحًا Start a report file

Starts a file of the report with the read's own filters and a reason of 10 to 500 characters, built like the portal's Excel export with personal data masked; it is ready within minutes in every format the plan allows. Answers 404 while report files by key are off. Capped per company a day and by the restricted exports' own caps; one file at a time per person. Send an Idempotency-Key header. Requires the key scope `reporting:report_files:write`.

الترويسات

key
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

202 The file, queued; read its handle until the state is ready.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "handle": "RmlsZS1vZi1hLXJlcG9ydA",
        "report": "maintenance_costs",
        "report_title": "Maintenance costs",
        "state": "queued",
        "reason": null,
        "formats": [],
        "rows": 0,
        "created_at": "2026-06-01T09:00:00Z",
        "expires_at": null
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /report-files/{handle}

يتطلب مفتاحًا Read a report file's state

One of your report files: queued, ready (with the formats to download), expired once its retention ends, or failed with a closed code. Another person's file answers 404 exactly like one that does not exist. Requires the key scope `reporting:report_files:write`.

الترويسات

handle
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The file with its state and, when ready, the formats to download.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "handle": "RmlsZS1vZi1hLXJlcG9ydA",
        "report": "maintenance_costs",
        "report_title": "Maintenance costs",
        "state": "ready",
        "reason": null,
        "formats": [
            "csv",
            "xlsx"
        ],
        "rows": 128,
        "created_at": "2026-06-01T09:00:00Z",
        "expires_at": "2026-06-08T09:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /report-files/{handle}/download

يتطلب مفتاحًا Download a report file

Streams one of your ready report files in the format asked (one of the formats its state lists) to you alone; there is no link to share. A format not built answers 422; a file past its retention answers 410. Each download counts its rows against the reports API's daily row budget, and the cap on downloads counts every format of the file together. Requires the key scope `reporting:report_files:write`.

الترويسات

handle
formatThe format to download, one of the formats the state lists: csv or xlsx.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The file, in the format asked.

Transfer-Encoding

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /report-schedules

يتطلب مفتاحًا List scheduled reports

Lists the company's scheduled reports for a key whose owner may manage them, as the portal shows them (a branch-bound owner sees only the schedules they created). Each carries how many people receive it, never who, and how many external contacts it e-mails (their uuids only to a key whose owner may view contacts, else null); a pause is a code: by_person, plan, driver_data, failing (paused after three failed sends in a row) or other. A query key not listed here answers 422. Requires the key scope `reporting:report_schedules:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 One page of scheduled reports.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "handle": "Qm9vay1yZXBvcnQtdmlldw",
            "report": "maintenance_costs",
            "report_title": "Maintenance costs",
            "format": "pdf",
            "cadence": "weekly",
            "weekday": 7,
            "month_day": null,
            "send_hour": 7,
            "period": "previous",
            "locale": "ar",
            "skip_when_empty": false,
            "recipients_count": 3,
            "contacts_count": 1,
            "contacts": [
                "9b2f4e8a-1c3d-4e5f-8a7b-6c5d4e3f2a1b"
            ],
            "is_mine": true,
            "state": "active",
            "pause": null,
            "next_run_at": "2026-06-07T04:00:00Z",
            "last_status": "sent",
            "last_run_at": "2026-05-31T04:00:12Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /report-schedules

يتطلب مفتاحًا Create a scheduled report

Creates a scheduled report under the portal's own rules. Recipients are user uuids of company users who may read the report; a report that names a driver is never scheduled. contacts (optional, at most 5) are uuids of the company's external contacts, only for a report that may leave the company, only while the platform and the company allow it (403 otherwise), and each receives files only after confirming from their own mailbox. Send an Idempotency-Key header; writes are capped per key an hour and per company a day. Requires the key scope `reporting:report_schedules:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

جسم الطلب

reportمطلوبThe report key, from GET /reports; a report that names a driver is never scheduled.
formatمطلوبpdf, xlsx or csv.
cadenceمطلوبdaily, weekly, monthly, quarterly or yearly.
weekdayاختياريFor weekly: 1 (Monday) to 7 (Sunday).
send_hourمطلوبThe hour it goes, 0 to 23, Saudi time.
periodاختياريprevious (the last complete period) or to_date (from the start of the current one to yesterday).
مثال
{
    "report": "fuel",
    "format": "xlsx",
    "cadence": "weekly",
    "weekday": 7,
    "send_hour": 7,
    "period": "previous"
}

الردود

201 The schedule as saved; its handle names it in every next call.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "handle": "Qm9vay1yZXBvcnQtdmlldw",
        "report": "maintenance_costs",
        "report_title": "Maintenance costs",
        "format": "pdf",
        "cadence": "weekly",
        "weekday": 7,
        "month_day": null,
        "send_hour": 7,
        "period": "previous",
        "locale": "ar",
        "skip_when_empty": false,
        "recipients_count": 3,
        "contacts_count": 1,
        "contacts": [
            "9b2f4e8a-1c3d-4e5f-8a7b-6c5d4e3f2a1b"
        ],
        "is_mine": true,
        "state": "active",
        "pause": null,
        "next_run_at": "2026-06-07T04:00:00Z",
        "last_status": "sent",
        "last_run_at": "2026-05-31T04:00:12Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

PATCH /report-schedules/{handle}

يتطلب مفتاحًا Edit a scheduled report

Changes the fields sent; a field left out keeps its value (period: previous, the last complete period, or to_date, from the start of the current week, month, quarter or year to yesterday; daily schedules always send yesterday), and a filter sent as null is removed. Another company's schedule answers 404 exactly like one that does not exist. Requires the key scope `reporting:report_schedules:write`.

الترويسات

handle
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

جسم الطلب

reportاختياريThe report key, from GET /reports; a report that names a driver is never scheduled.
formatاختياريpdf, xlsx or csv.
cadenceاختياريdaily, weekly, monthly, quarterly or yearly.
weekdayاختياريFor weekly: 1 (Monday) to 7 (Sunday).
send_hourاختياريThe hour it goes, 0 to 23, Saudi time.
periodاختياريprevious (the last complete period) or to_date (from the start of the current one to yesterday).
مثال
{
    "report": "fuel",
    "format": "xlsx",
    "cadence": "weekly",
    "weekday": 7,
    "send_hour": 7,
    "period": "previous"
}

الردود

200 The schedule as changed.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "handle": "Qm9vay1yZXBvcnQtdmlldw",
        "report": "maintenance_costs",
        "report_title": "Maintenance costs",
        "format": "pdf",
        "cadence": "weekly",
        "weekday": 7,
        "month_day": null,
        "send_hour": 7,
        "period": "previous",
        "locale": "ar",
        "skip_when_empty": false,
        "recipients_count": 3,
        "contacts_count": 1,
        "contacts": [
            "9b2f4e8a-1c3d-4e5f-8a7b-6c5d4e3f2a1b"
        ],
        "is_mine": true,
        "state": "active",
        "pause": null,
        "next_run_at": "2026-06-07T04:00:00Z",
        "last_status": "sent",
        "last_run_at": "2026-05-31T04:00:12Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

DELETE /report-schedules/{handle}

يتطلب مفتاحًا Delete a scheduled report

Deletes it; its past sends stay in the company's log. Requires the key scope `reporting:report_schedules:write`.

الترويسات

handle
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /report-schedules/{handle}/pause

يتطلب مفتاحًا Pause a scheduled report

Pauses it with a reason of 3 to 500 characters; the reason is kept for the portal and never returned (the list shows the pause as by_person). Requires the key scope `reporting:report_schedules:write`.

الترويسات

handle
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

جسم الطلب

reasonمطلوبWhy it is paused, 3 to 500 characters of plain text; kept for the portal and never returned.
مثال
{
    "reason": "The workshop is closed for the holiday"
}

الردود

200 The schedule, paused.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "handle": "Qm9vay1yZXBvcnQtdmlldw",
        "report": "maintenance_costs",
        "report_title": "Maintenance costs",
        "format": "pdf",
        "cadence": "weekly",
        "weekday": 7,
        "month_day": null,
        "send_hour": 7,
        "period": "previous",
        "locale": "ar",
        "skip_when_empty": false,
        "recipients_count": 3,
        "contacts_count": 1,
        "contacts": [
            "9b2f4e8a-1c3d-4e5f-8a7b-6c5d4e3f2a1b"
        ],
        "is_mine": true,
        "state": "paused",
        "pause": "by_person",
        "next_run_at": null,
        "last_status": "sent",
        "last_run_at": "2026-05-31T04:00:12Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /report-schedules/{handle}/resume

يتطلب مفتاحًا Resume a scheduled report

Resumes a paused scheduled report from its next send; a pause the plan or the driver data protection made ends only when they allow it again. Requires the key scope `reporting:report_schedules:write`.

الترويسات

handle
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The schedule, running again from its next send.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "handle": "Qm9vay1yZXBvcnQtdmlldw",
        "report": "maintenance_costs",
        "report_title": "Maintenance costs",
        "format": "pdf",
        "cadence": "weekly",
        "weekday": 7,
        "month_day": null,
        "send_hour": 7,
        "period": "previous",
        "locale": "ar",
        "skip_when_empty": false,
        "recipients_count": 3,
        "contacts_count": 1,
        "contacts": [
            "9b2f4e8a-1c3d-4e5f-8a7b-6c5d4e3f2a1b"
        ],
        "is_mine": true,
        "state": "active",
        "pause": null,
        "next_run_at": "2026-06-07T04:00:00Z",
        "last_status": "sent",
        "last_run_at": "2026-05-31T04:00:12Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /report-schedules/{handle}/test

يتطلب مفتاحًا Send a test of a scheduled report

Queues the last complete period to the key's owner alone, marked as a test copy; it never counts as the period's send. Capped per schedule an hour and per company a day. Requires the key scope `reporting:report_schedules:write`.

الترويسات

handle
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

202 The test copy is queued for the key's owner.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "queued": true
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

PATCH /reports/{key}/views/{handle}

يتطلب مفتاحًا Rename a view or make it the default

Changes the name and/or is_default of one of your views; its filters stay. Another person's view answers 404 exactly like one that does not exist. Requires the key scope `reporting:report_views:write`.

الترويسات

key
handle
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

جسم الطلب

nameاختياريThe new name, 1 to 60 characters.
is_defaultاختياريTrue to make it the default, false to clear it.
مثال
{
    "name": "Monthly, all branches",
    "is_default": true
}

الردود

200 The view as changed.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "handle": "Vmlldy1vZi1hLXJlcG9ydA",
        "name": "Weekly, Riyadh branch",
        "is_default": false,
        "pinned": false
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

DELETE /reports/{key}/views/{handle}

يتطلب مفتاحًا Delete a view

Deletes one of your views of the report. Requires the key scope `reporting:report_views:write`.

الترويسات

key
handle
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

PUT /reports/{key}/views/{handle}/pin

يتطلب مفتاحًا Pin a view to the home page

Pins one of your views to your portal home; at most 6 pins, a seventh answers 409 with reason pin_limit. Requires the key scope `reporting:report_views:write`.

الترويسات

key
handle
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The view, now pinned.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "handle": "Vmlldy1vZi1hLXJlcG9ydA",
        "name": "Weekly, Riyadh branch",
        "is_default": false,
        "pinned": true
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

DELETE /reports/{key}/views/{handle}/pin

يتطلب مفتاحًا Unpin a view

Takes one of your views off your portal home. Requires the key scope `reporting:report_views:write`.

الترويسات

key
handle
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The view, no longer pinned.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "handle": "Vmlldy1vZi1hLXJlcG9ydA",
        "name": "Weekly, Riyadh branch",
        "is_default": false,
        "pinned": false
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /tasks

يتطلب مفتاحًا List tasks

Lists your company's tasks, open ones first by default, one page at a time; ask status=closed or status=cancelled for the finished ones. A key whose owner may not assign tasks sees only the tasks given to that person. Times are UTC; meta.timezone names the platform time zone. Requires the key scope `tasks:tasks:read`.

الترويسات

statusOnly tasks in this state: open, in_progress, waiting_external, closed or cancelled.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of tasks.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "7c1d2e44-5b6a-4f0e-9a3b-1d2c3e4f5a66",
            "number": "TSK-000123",
            "title": "Renew the vehicle insurance",
            "instructions": "Bring the new policy to the office.",
            "status": "open",
            "due_at": "2026-06-10T09:00:00Z",
            "overdue": false,
            "assigned_at": null,
            "closed_at": null,
            "version": 1,
            "created_at": "2026-06-01T08:00:00Z",
            "updated_at": "2026-06-01T08:00:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /tasks

يتطلب مفتاحًا Create a task

Opens a company task in your company with a title, optional instructions and an optional due time. Send an Idempotency-Key header. The task has no assignee yet; the company is the key's own and no other field is accepted. Answers 429 when the key has opened its hourly allowance or the company its daily one. Requires the key scope `tasks:tasks:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The new task; its version is the token for the next change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7c1d2e44-5b6a-4f0e-9a3b-1d2c3e4f5a66",
        "number": "TSK-000123",
        "title": "Renew the vehicle insurance",
        "instructions": "Bring the new policy to the office.",
        "status": "open",
        "due_at": "2026-06-10T09:00:00Z",
        "overdue": false,
        "assigned_at": null,
        "closed_at": null,
        "version": 1,
        "created_at": "2026-06-01T08:00:00Z",
        "updated_at": "2026-06-01T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /tasks/{uuid}

يتطلب مفتاحًا Read a task

Reads one of your company's tasks by its uuid. A task of another company, one outside what the key's owner may see and an unknown uuid all answer 404. Requires the key scope `tasks:tasks:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The task.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7c1d2e44-5b6a-4f0e-9a3b-1d2c3e4f5a66",
        "number": "TSK-000123",
        "title": "Renew the vehicle insurance",
        "instructions": "Bring the new policy to the office.",
        "status": "open",
        "due_at": "2026-06-10T09:00:00Z",
        "overdue": false,
        "assigned_at": null,
        "closed_at": null,
        "version": 1,
        "created_at": "2026-06-01T08:00:00Z",
        "updated_at": "2026-06-01T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

PATCH /tasks/{uuid}

يتطلب مفتاحًا Edit a task

Changes the title, the instructions and the due time of an unfinished task of your company; the key's owner must be allowed to assign tasks. Send the `version` you read: a task changed meanwhile answers 409. Requires the key scope `tasks:tasks:write` and an `Idempotency-Key` header. Requires the key scope `tasks:tasks:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The task after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7c1d2e44-5b6a-4f0e-9a3b-1d2c3e4f5a66",
        "number": "TSK-000123",
        "title": "Renew the vehicle insurance",
        "instructions": "Bring the new policy to the office.",
        "status": "open",
        "due_at": "2026-06-10T09:00:00Z",
        "overdue": false,
        "assigned_at": null,
        "closed_at": null,
        "version": 1,
        "created_at": "2026-06-01T08:00:00Z",
        "updated_at": "2026-06-01T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /tasks/{uuid}/comments

يتطلب مفتاحًا List the comments of a task

Lists the comments on one of your company's tasks, oldest first, up to 200. Requires the key scope `tasks:tasks:read`. Requires the key scope `tasks:tasks:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The comments.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "id": "0192a1b2-0000-7000-8000-000000000002",
            "author": "Sara",
            "body": "The policy is renewed.",
            "created_at": "2026-06-01T09:00:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /tasks/{uuid}/comments

يتطلب مفتاحًا Comment on a task

Adds a comment to one of your company's tasks; the key's owner must be allowed to work or assign tasks. A comment is never changed afterwards. Requires the key scope `tasks:tasks:write` and an `Idempotency-Key` header. Requires the key scope `tasks:tasks:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The new comment.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "id": "0192a1b2-0000-7000-8000-000000000002",
        "author": "Sara",
        "body": "The policy is renewed.",
        "created_at": "2026-06-01T09:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /tasks/assignees

يتطلب مفتاحًا List who a task can be given to

Lists the people of your company who can hold a task, each with the `id` to send when assigning; the key's owner must be allowed to assign tasks. Requires the key scope `tasks:tasks:read`. Requires the key scope `tasks:tasks:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The people.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "id": "0192a1b2-0000-7000-8000-000000000001",
            "name": "Sara"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /tasks/{uuid}/start

يتطلب مفتاحًا Start a task

Moves an open task to in progress, or resumes one that waits for a reply. The key's owner must be the person it is assigned to, or allowed to assign tasks. Send the `version` you read. Requires the key scope `tasks:tasks:write` and an `Idempotency-Key` header. Requires the key scope `tasks:tasks:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The task after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7c1d2e44-5b6a-4f0e-9a3b-1d2c3e4f5a66",
        "number": "TSK-000123",
        "title": "Renew the vehicle insurance",
        "instructions": "Bring the new policy to the office.",
        "status": "open",
        "due_at": "2026-06-10T09:00:00Z",
        "overdue": false,
        "assigned_at": null,
        "closed_at": null,
        "version": 1,
        "created_at": "2026-06-01T08:00:00Z",
        "updated_at": "2026-06-01T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /tasks/{uuid}/wait

يتطلب مفتاحًا Mark a task as waiting for a reply

Moves a task in progress to waiting for an outside party. Send the `version` you read. Requires the key scope `tasks:tasks:write` and an `Idempotency-Key` header. Requires the key scope `tasks:tasks:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The task after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7c1d2e44-5b6a-4f0e-9a3b-1d2c3e4f5a66",
        "number": "TSK-000123",
        "title": "Renew the vehicle insurance",
        "instructions": "Bring the new policy to the office.",
        "status": "open",
        "due_at": "2026-06-10T09:00:00Z",
        "overdue": false,
        "assigned_at": null,
        "closed_at": null,
        "version": 1,
        "created_at": "2026-06-01T08:00:00Z",
        "updated_at": "2026-06-01T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /tasks/{uuid}/close

يتطلب مفتاحًا Complete a task

Completes an unfinished task; a task that needs evidence or a verified external id is completed in the panel. Send the `version` you read. Requires the key scope `tasks:tasks:write` and an `Idempotency-Key` header. Requires the key scope `tasks:tasks:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The task after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7c1d2e44-5b6a-4f0e-9a3b-1d2c3e4f5a66",
        "number": "TSK-000123",
        "title": "Renew the vehicle insurance",
        "instructions": "Bring the new policy to the office.",
        "status": "open",
        "due_at": "2026-06-10T09:00:00Z",
        "overdue": false,
        "assigned_at": null,
        "closed_at": null,
        "version": 1,
        "created_at": "2026-06-01T08:00:00Z",
        "updated_at": "2026-06-01T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /tasks/{uuid}/assign

يتطلب مفتاحًا Give a task to a person

Gives an unfinished task to a person of your company, or takes it from the current one when `assignee` is null; the key's owner must be allowed to assign tasks. Send the `version` you read. Requires the key scope `tasks:tasks:write` and an `Idempotency-Key` header. Requires the key scope `tasks:tasks:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The task after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7c1d2e44-5b6a-4f0e-9a3b-1d2c3e4f5a66",
        "number": "TSK-000123",
        "title": "Renew the vehicle insurance",
        "instructions": "Bring the new policy to the office.",
        "status": "open",
        "due_at": "2026-06-10T09:00:00Z",
        "overdue": false,
        "assigned_at": null,
        "closed_at": null,
        "version": 1,
        "created_at": "2026-06-01T08:00:00Z",
        "updated_at": "2026-06-01T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /tasks/{uuid}/cancel

يتطلب مفتاحًا Cancel a task

Cancels an unfinished task with a written reason of up to 1000 characters; the key's owner must be allowed to cancel tasks. Send the `version` you read. Requires the key scope `tasks:tasks:write` and an `Idempotency-Key` header. Requires the key scope `tasks:tasks:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The task after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7c1d2e44-5b6a-4f0e-9a3b-1d2c3e4f5a66",
        "number": "TSK-000123",
        "title": "Renew the vehicle insurance",
        "instructions": "Bring the new policy to the office.",
        "status": "open",
        "due_at": "2026-06-10T09:00:00Z",
        "overdue": false,
        "assigned_at": null,
        "closed_at": null,
        "version": 1,
        "created_at": "2026-06-01T08:00:00Z",
        "updated_at": "2026-06-01T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /connections

يتطلب مفتاحًا List connection states

Lists whether each of your company's tracking devices is online, offline or has never connected, and whether each tracking platform link (source) is healthy, one page at a time, oldest first. A device is online while its vehicle reported within the platform's online window. changed_at is when the state last changed; updated_since filters on it. A branch-limited key sees only the records of its own branch. The states are refreshed every five minutes, so a change shows up to five minutes late, and a device archived or moved to another branch stays visible to its old branch for that long. Times are UTC; meta.timezone names the platform time zone. Requires the key scope `connections:read`.

الترويسات

kindOnly devices (device) or only sources (source).
statusOnly records in this state: online, offline, never_connected, healthy or unhealthy.
branchOnly records of this branch (its uuid).
vehicleOnly the device installed in this vehicle (its uuid).
updated_sinceOnly records whose state changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of connection states.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "9e2b4d61-3f58-4c7a-b1d9-2a6c8e0f3b55",
            "kind": "device",
            "label": "356307042441013",
            "state": "offline",
            "last_seen_at": "2026-06-01T07:42:10Z",
            "changed_at": "2026-06-01T07:55:00Z",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /connections/{uuid}

يتطلب مفتاحًا Read a connection state

Reads the connection state of one of your company's devices or sources by its own uuid. A record of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `connections:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The connection state.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "9e2b4d61-3f58-4c7a-b1d9-2a6c8e0f3b55",
        "kind": "device",
        "label": "356307042441013",
        "state": "offline",
        "last_seen_at": "2026-06-01T07:42:10Z",
        "changed_at": "2026-06-01T07:55:00Z",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /containers

يتطلب مفتاحًا List waste containers

Lists your company's waste containers, oldest first, one page at a time, with the latest fill level, the battery and the kinds of alert open on each. Archived containers are left out unless you ask for status=archived. A branch-limited key sees only its own branch. A container's printed code, its report link and its photos are never returned. Requires the key scope `waste:containers:read`.

الترويسات

statusOnly containers in this state.
branchOnly containers of this branch (its uuid).
updated_sinceOnly containers changed at or after this moment (ISO 8601 with an offset); a moment older than 92 days reads as 92 days ago.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of containers.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "3b1f6a52-9d4e-4c7b-8a10-5e2c7d9f0b44",
            "status": "active",
            "tag": "RYD-0142",
            "name": "King Fahd Road, bin 142",
            "type": "1,100 litre street bin",
            "volume_litres": 1100,
            "district": "Al Olaya",
            "address": "King Fahd Road, Riyadh",
            "latitude": "24.7136000",
            "longitude": "46.6753000",
            "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
            "fill_pct": "86.50",
            "fill_observed_at": "2026-06-01T08:55:00Z",
            "battery_pct": 74,
            "predicted_full_at": "2026-06-02T06:00:00Z",
            "open_alerts": [
                "near_full"
            ],
            "archived_at": null,
            "created_at": "2026-03-01T08:30:00Z",
            "updated_at": "2026-06-01T08:55:12Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /containers/{uuid}

يتطلب مفتاحًا Read a waste container

Reads one of your company's waste containers by its uuid. A container of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `waste:containers:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The container.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3b1f6a52-9d4e-4c7b-8a10-5e2c7d9f0b44",
        "status": "active",
        "tag": "RYD-0142",
        "name": "King Fahd Road, bin 142",
        "type": "1,100 litre street bin",
        "volume_litres": 1100,
        "district": "Al Olaya",
        "address": "King Fahd Road, Riyadh",
        "latitude": "24.7136000",
        "longitude": "46.6753000",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "fill_pct": "86.50",
        "fill_observed_at": "2026-06-01T08:55:00Z",
        "battery_pct": 74,
        "predicted_full_at": "2026-06-02T06:00:00Z",
        "open_alerts": [
            "near_full"
        ],
        "archived_at": null,
        "created_at": "2026-03-01T08:30:00Z",
        "updated_at": "2026-06-01T08:55:12Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /roadside/costs

يتطلب مفتاحًا List roadside invoices

Lists the invoices declared for your company's roadside cases, oldest first, one page at a time. Amounts and VAT are whole minor units (halalas) with the currency; the payee, the invoice number and file and the retract reason are never included. A day's reads are limited by a row budget per key and per company. Requires the key scope `assistance:case_costs:read`.

الترويسات

caseOnly the invoices of this case (its uuid).
kindOnly invoices of this kind: repair, tow or other.
updated_sinceOnly invoices declared or retracted at or after this moment (ISO 8601 with an offset), at most 366 days back.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of invoices.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "7c2e9b40-5d1a-4e8f-a3b6-0f9d2c4e1a55",
            "case_uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
            "kind": "tow",
            "invoice_on": "2026-06-02",
            "amount_minor": 45000,
            "vat_minor": 6750,
            "total_minor": 51750,
            "currency": "SAR",
            "retracted": false,
            "retracted_at": null,
            "declared_at": "2026-06-02T09:30:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /roadside/costs/{uuid}

يتطلب مفتاحًا Read a roadside invoice

Reads one invoice of your company's roadside cases by its uuid. An invoice of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `assistance:case_costs:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The invoice.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7c2e9b40-5d1a-4e8f-a3b6-0f9d2c4e1a55",
        "case_uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "kind": "tow",
        "invoice_on": "2026-06-02",
        "amount_minor": 45000,
        "vat_minor": 6750,
        "total_minor": 51750,
        "currency": "SAR",
        "retracted": false,
        "retracted_at": null,
        "declared_at": "2026-06-02T09:30:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /roadside/cases/{uuid}/costs

يتطلب مفتاحًا Declare a roadside invoice

Declares an invoice for one of your company's roadside cases that is not cancelled: its kind, who billed, the invoice number and day (not in the future), and the amount before VAT and the VAT in whole minor units (halalas). The same invoice number cannot be declared twice for the company. A tow invoice is compared with the agreed price as in the panel. No expense of the vehicle is recorded from here; that is done in the panel. A case of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `assistance:case_costs:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The declared invoice.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7c2e9b40-5d1a-4e8f-a3b6-0f9d2c4e1a55",
        "case_uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "kind": "tow",
        "invoice_on": "2026-06-02",
        "amount_minor": 45000,
        "vat_minor": 6750,
        "total_minor": 51750,
        "currency": "SAR",
        "retracted": false,
        "retracted_at": null,
        "declared_at": "2026-06-02T09:30:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /roadside/costs/{uuid}/retract

يتطلب مفتاحًا Retract a roadside invoice

Retracts a mistaken invoice of one of your company's roadside cases, with the reason; the line stays in the list marked retracted and an expense of the vehicle recorded in the panel for it is voided with it. An invoice already retracted answers 422. An invoice of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `assistance:case_costs:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The invoice after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7c2e9b40-5d1a-4e8f-a3b6-0f9d2c4e1a55",
        "case_uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "kind": "tow",
        "invoice_on": "2026-06-02",
        "amount_minor": 45000,
        "vat_minor": 6750,
        "total_minor": 51750,
        "currency": "SAR",
        "retracted": false,
        "retracted_at": null,
        "declared_at": "2026-06-02T09:30:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /billing/currencies

يتطلب مفتاحًا List billing currencies

Lists the enabled currencies with the size of their minor unit, so a money amount in minor units can be shown. Requires the key scope `billing:read`; the module is closed (404) until the platform opens it. Requires the key scope `billing:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The enabled currencies.
مثال
{
    "success": true,
    "data": [
        {
            "code": "SAR",
            "name_ar": "ريال سعودي",
            "name_en": "Saudi riyal",
            "symbol": "ر.س",
            "minor_unit": 2,
            "price_rounding_minor": 1
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /reports/customer-profit

يتطلب مفتاحًا Read the customer profitability report

Lists, for each of your own customers, what its delivered orders earned and what its share of the trips cost in the period: revenue, cost, the margin and its percent of the revenue, and the revenue per ton where orders are weighed. A customer of the market, or one outside your scope, has no uuid. The cost includes the daily allowance of the drivers, so the owner of the key needs the right to see per diem as well as the reports right. Money is a list of lines, one per currency, never added across currencies. The period is whole Saudi days, at most a year; no driver is named. Requires the key scope `reporting:reports_customer_profit:read`.

الترويسات

fromStart of the period, ISO 8601 with an offset.
toEnd of the period, after from and at most 366 days later; its Saudi day is included.
customerOnly this customer (its uuid).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 One page of customers; meta.withheld_trips counts trips left out because their orders may not be read.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "customer_uuid": "3f6b1c0e-8d2a-4c57-b1a9-6e0d4f7a2c11",
            "delivered_orders": 40,
            "unpriced_orders": 1,
            "revenue": [
                {
                    "currency": "SAR",
                    "amount": "120000.00"
                }
            ],
            "cost": [
                {
                    "currency": "SAR",
                    "amount": "74000.00"
                }
            ],
            "margin": [
                {
                    "currency": "SAR",
                    "amount": "46000.00"
                }
            ],
            "margin_percent": [
                {
                    "currency": "SAR",
                    "percent": "38.3"
                }
            ],
            "revenue_per_ton": [
                {
                    "currency": "SAR",
                    "amount": "310.50"
                }
            ]
        }
    ],
    "meta": {
        "page": {
            "limit": 50,
            "next_cursor": null
        },
        "withheld_trips": 0
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /defects

يتطلب مفتاحًا List defects

Lists your company's vehicle defects, oldest first, one page at a time. Each carries the vehicle, a short title (free text as typed), severity, state and times, and the inspection or work order it is tied to; descriptions and resolutions are never shown. A branch-limited key sees only the defects of the vehicles that are currently in its branch. Requires the key scope `defects:read`.

الترويسات

statusOnly defects in this state: open, in_repair, resolved or dismissed.
vehicleOnly the vehicle defects of this vehicle (its uuid).
updated_sinceOnly vehicle defects changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of vehicle defects.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "9d4f1a63-7b28-4c05-8e1a-6f3b2c9d0e55",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "inspection_uuid": "4e2b7c10-9a35-4d68-b1f4-2c8a6e0d5b77",
            "work_order_uuid": null,
            "source": "inspection",
            "title": "Worn front brake pads",
            "severity": "major",
            "category_code": "brake",
            "status": "open",
            "reported_at": "2026-05-12T07:48:00Z",
            "closed_at": null,
            "created_at": "2026-05-12T07:50:12Z",
            "updated_at": "2026-05-12T07:50:12Z",
            "row_version": 3
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /defects

يتطلب مفتاحًا Report a defect

Reports a defect on one of your company's vehicles, as the panel does, with its notices to the maintenance people: a title, the severity (minor, major or critical) and optionally a description and a maintenance category code. A driver, an inspection or an amount of money is never accepted. At most 10 reports an hour for one vehicle. A vehicle of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `fleet:defects:write` and an `Idempotency-Key` header. Requires the key scope `fleet:defects:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The defect that was reported.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "9d4f1a63-7b28-4c05-8e1a-6f3b2c9d0e55",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "inspection_uuid": "4e2b7c10-9a35-4d68-b1f4-2c8a6e0d5b77",
        "work_order_uuid": null,
        "source": "inspection",
        "title": "Worn front brake pads",
        "severity": "major",
        "category_code": "brake",
        "status": "open",
        "reported_at": "2026-05-12T07:48:00Z",
        "closed_at": null,
        "created_at": "2026-05-12T07:50:12Z",
        "updated_at": "2026-05-12T07:50:12Z",
        "row_version": 3
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /defects/{uuid}

يتطلب مفتاحًا Read a defect

Reads one of your company's vehicle defects by its uuid. A record of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `defects:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The defect.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "9d4f1a63-7b28-4c05-8e1a-6f3b2c9d0e55",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "inspection_uuid": "4e2b7c10-9a35-4d68-b1f4-2c8a6e0d5b77",
        "work_order_uuid": null,
        "source": "inspection",
        "title": "Worn front brake pads",
        "severity": "major",
        "category_code": "brake",
        "status": "open",
        "reported_at": "2026-05-12T07:48:00Z",
        "closed_at": null,
        "created_at": "2026-05-12T07:50:12Z",
        "updated_at": "2026-05-12T07:50:12Z",
        "row_version": 3
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /defects/{uuid}/dismiss

يتطلب مفتاحًا Dismiss a defect

Closes a minor or major defect that is not real or needs nothing, as the panel does. A critical defect is safety evidence and is dismissed in the panel only (422). Send the `row_version` you read and the reason; a defect changed meanwhile or no longer open answers 409. Requires the key scope `fleet:defects:write` and an `Idempotency-Key` header. Requires the key scope `fleet:defects:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The defect, now dismissed.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "9d4f1a63-7b28-4c05-8e1a-6f3b2c9d0e55",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "inspection_uuid": "4e2b7c10-9a35-4d68-b1f4-2c8a6e0d5b77",
        "work_order_uuid": null,
        "source": "inspection",
        "title": "Worn front brake pads",
        "severity": "major",
        "category_code": "brake",
        "status": "open",
        "reported_at": "2026-05-12T07:48:00Z",
        "closed_at": null,
        "created_at": "2026-05-12T07:50:12Z",
        "updated_at": "2026-05-12T07:50:12Z",
        "row_version": 3
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicles/{uuid}/depreciation

يتطلب مفتاحًا Read a vehicle's depreciation

The running depreciation plan of one of your vehicles and its book value today; null when it has no running plan. Needs the finance right (403 without it); a vehicle of another company or branch answers 404. Requires the key scope `depreciation:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The plan.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "plan": {
            "method": "straight_line",
            "acquisition_cost_minor": 1250050,
            "salvage_minor": 125000,
            "currency": "SAR",
            "acquired_on": "2026-01-01",
            "life_months": 60,
            "accumulated_minor": 150000,
            "book_value_minor": 1100050,
            "is_fully_depreciated": false
        }
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /vehicles/{uuid}/depreciation

يتطلب مفتاحًا Set a vehicle's depreciation plan

Sets the depreciation plan of one of your vehicles as the vehicle page does, with the same rights and rules. When a plan is running, send replace_reason: it ends that plan and the new one starts. Needs the finance right and the Idempotency-Key header. Requires the key scope `fleet:depreciation:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The plan that was set.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "method": "straight_line",
        "acquisition_cost_minor": 12500050,
        "salvage_minor": 1250000,
        "currency": "SAR",
        "acquired_on": "2026-01-01",
        "life_months": 60,
        "version": 1,
        "ended": false
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fleet-assets/{uuid}/depreciation

يتطلب مفتاحًا Read a fleet asset's depreciation

The running depreciation plan of one of your trailers or pieces of equipment and its book value today; null when it has no running plan. Needs the finance right (403 without it); an asset of another company or branch answers 404. Requires the key scope `depreciation:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The plan.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "asset_uuid": "9e2b7c14-3d58-4f0a-b6a1-7c4d2e8f5a10",
        "plan": {
            "method": "straight_line",
            "acquisition_cost_minor": 1250050,
            "salvage_minor": 125000,
            "currency": "SAR",
            "acquired_on": "2026-01-01",
            "life_months": 60,
            "accumulated_minor": 150000,
            "book_value_minor": 1100050,
            "is_fully_depreciated": false
        }
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fleet-assets/{uuid}/depreciation

يتطلب مفتاحًا Set a fleet asset's depreciation plan

Sets the depreciation plan of one of your trailers or pieces of equipment as its page does, with the same rights and rules; per_km is for vehicles only. When a plan is running, send replace_reason. Needs the finance right and the Idempotency-Key header. Requires the key scope `fleet:depreciation:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The plan that was set.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "method": "straight_line",
        "acquisition_cost_minor": 8500000,
        "salvage_minor": 0,
        "currency": "SAR",
        "acquired_on": "2026-01-01",
        "life_months": 60,
        "version": 1,
        "ended": false
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /vehicles/{uuid}/depreciation/end

يتطلب مفتاحًا End the running depreciation plan

Ends the running plan of one of your vehicles with the version you read and a written reason. The plan stays in the history. Needs the finance right and the Idempotency-Key header. Requires the key scope `fleet:depreciation:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The plan after it ended.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "method": "straight_line",
        "acquisition_cost_minor": 12500050,
        "salvage_minor": 1250000,
        "currency": "SAR",
        "acquired_on": "2026-01-01",
        "life_months": 60,
        "version": 2,
        "ended": true
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fleet-assets/{uuid}/depreciation/end

يتطلب مفتاحًا End a fleet asset's running depreciation plan

Ends the running plan of one of your trailers or pieces of equipment with the version you read and a written reason. The plan stays in the history. Needs the finance right and the Idempotency-Key header. Requires the key scope `fleet:depreciation:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The plan after it ended.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "method": "straight_line",
        "acquisition_cost_minor": 8500000,
        "salvage_minor": 0,
        "currency": "SAR",
        "acquired_on": "2026-01-01",
        "life_months": 60,
        "version": 2,
        "ended": true
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /devices

يتطلب مفتاحًا List devices

Lists your company's tracking devices, oldest first, one page at a time. Archived devices are left out unless you ask for status=archived. A branch-limited key sees only its own branch (records shared with your branch are included; their branch_uuid is empty). vehicle_uuid is the vehicle the device is installed in now. SIM numbers are never returned. Times are UTC; meta.timezone names the platform time zone; the two expiry fields are calendar days. Requires the key scope `devices:read`.

الترويسات

statusOnly devices in this state.
branchOnly devices of this branch (its uuid).
updated_sinceOnly devices changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of devices.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "9e2b4d61-3f58-4c7a-b1d9-2a6c8e0f3b55",
            "status": "active",
            "imei": "356307042441013",
            "device_brand": "Teltonika",
            "device_model": "FMC130",
            "serial_number": "SN-2201987",
            "telecom_company_name": "STC",
            "sim_expires_on": "2027-01-31",
            "warranty_expires_on": "2027-06-30",
            "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "installed_on": "2026-03-02",
            "installations": [
                {
                    "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
                    "installed_on": "2026-03-02",
                    "removed_on": null
                },
                {
                    "vehicle_uuid": "7c2e9a14-1b5d-4f60-8e3a-6d4b2f9c0e77",
                    "installed_on": "2025-11-10",
                    "removed_on": "2026-03-01"
                }
            ],
            "archived_at": null,
            "created_at": "2026-03-01T08:30:00Z",
            "updated_at": "2026-05-12T11:05:42Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /devices/{uuid}

يتطلب مفتاحًا Read a device

Reads one of your company's tracking devices by its uuid. A device of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `devices:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The device.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "9e2b4d61-3f58-4c7a-b1d9-2a6c8e0f3b55",
        "status": "active",
        "imei": "356307042441013",
        "device_brand": "Teltonika",
        "device_model": "FMC130",
        "serial_number": "SN-2201987",
        "telecom_company_name": "STC",
        "sim_expires_on": "2027-01-31",
        "warranty_expires_on": "2027-06-30",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "installed_on": "2026-03-02",
        "installations": [
            {
                "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
                "installed_on": "2026-03-02",
                "removed_on": null
            },
            {
                "vehicle_uuid": "7c2e9a14-1b5d-4f60-8e3a-6d4b2f9c0e77",
                "installed_on": "2025-11-10",
                "removed_on": "2026-03-01"
            }
        ],
        "archived_at": null,
        "created_at": "2026-03-01T08:30:00Z",
        "updated_at": "2026-05-12T11:05:42Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /device-commands

يتطلب مفتاحًا List recent device commands

Lists the latest commands sent to your devices, newest first, at most 100: the command name, how it was sent, its outcome, whether it is critical and when. Command values, device numbers and who sent it are never returned. You see the commands your key's owner sent; a company administrator sees all of the company's. Requires the key scope `device_command_log:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The latest commands.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "8e3a5b17-2d64-4c90-a1f8-5b7c0d9e4a26",
            "device_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "command": "Request position",
            "channel": "gprs",
            "outcome": "accepted",
            "critical": false,
            "sent_at": "2026-11-14T08:30:00Z",
            "finished_at": "2026-11-14T08:30:02Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /vehicles/{uuid}/disposal

يتطلب مفتاحًا Record a vehicle sale or scrapping

Records that one of your vehicles was sold or scrapped, as the vehicle page does, with the same rights and rules: the depreciation plan ends on that day, the gain or loss is worked out by the server, the vehicle leaves the live lists and its integrations are cut. Send the price; name the buyer by `buyer_uuid` (a buyer you keep) or by `buyer_name`; an identity number is refused anywhere. The contract is attached in the panel. Needs the finance right over the whole company, the Idempotency-Key header, and stays within 10 an hour per key and 100 a day per company. Your finance holders are told, naming the key. Requires the key scope `fleet:disposal:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

201 The disposal that was recorded.
مثال
{
    "success": true,
    "data": {
        "kind": "sale",
        "occurred_on": "2026-06-01",
        "amount_minor": 5200000,
        "currency": "SAR",
        "version": 1,
        "voided": false
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /vehicles/{uuid}/disposal/void

يتطلب مفتاحًا Cancel a vehicle sale or scrapping

Cancels the vehicle's last stage when it is a sale or scrapping, with the version you read and a written reason of at least ten characters: the vehicle returns to operation and its depreciation plan restarts. A second person is needed: the key that recorded the disposal cannot cancel it (422). Needs the Idempotency-Key header and counts in the same caps. Your finance holders are told, naming the key. Requires the key scope `fleet:disposal:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The disposal after it was cancelled.
مثال
{
    "success": true,
    "data": {
        "kind": "sale",
        "occurred_on": "2026-06-01",
        "amount_minor": 5200000,
        "currency": "SAR",
        "version": 2,
        "voided": true
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /documents

يتطلب مفتاحًا List document details

Lists the details of the documents your company may read, oldest first, one page at a time: title (free text as typed), class, sensitivity, verification status, file type and size and dates. The file itself, any link to it, its file name and who uploaded it are never shown, and highly confidential documents are never listed. Archived documents are left out. A branch-limited key sees only its own branch. Requires the key scope `documents:read`.

الترويسات

statusOnly documents with this verification status: uploaded_unverified, verified or rejected.
branchOnly documents of this branch (its uuid).
updated_sinceOnly documents changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of document details.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "1c9f4e82-7a35-4b60-8d12-5e3b0a7c9f46",
            "doc_class": "company_file",
            "title": "Lease contract",
            "sensitivity": "internal",
            "verification_status": "verified",
            "verified_at": "2026-04-20T09:15:00Z",
            "mime_type": "application/pdf",
            "size_bytes": 184320,
            "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
            "created_at": "2026-04-19T11:00:00Z",
            "updated_at": "2026-04-20T09:15:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /documents/{uuid}

يتطلب مفتاحًا Read document details

Reads the details of one document by its uuid. A document your company may not read, one of another company or branch, and an unknown one all answer 404. Requires the key scope `documents:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The document details.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "1c9f4e82-7a35-4b60-8d12-5e3b0a7c9f46",
        "doc_class": "company_file",
        "title": "Lease contract",
        "sensitivity": "internal",
        "verification_status": "verified",
        "verified_at": "2026-04-20T09:15:00Z",
        "mime_type": "application/pdf",
        "size_bytes": 184320,
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "created_at": "2026-04-19T11:00:00Z",
        "updated_at": "2026-04-20T09:15:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /drivers

يتطلب مفتاحًا List drivers

Lists your company's drivers, oldest first, one page at a time. Archived drivers are left out unless you ask for status=archived. A branch-limited key sees only its own branch (records shared with your branch are included; their branch_uuid is empty). Identity numbers, birth dates and e-mail are never returned. Times are UTC; meta.timezone names the platform time zone. Requires the key scope `drivers:read`.

الترويسات

statusOnly drivers in this state.
branchOnly drivers of this branch (its uuid).
updated_sinceOnly drivers changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of drivers.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "3c1e9a52-8d47-4b6a-a2f0-5e7d9b4c1a44",
            "status": "active",
            "full_name": {
                "ar": "أحمد محمد",
                "en": "Ahmed Mohammed"
            },
            "mobile_number": "+966500000000",
            "nationality_country_code": "SA",
            "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
            "employer_operator_uuid": "7a9c3d2e-1b44-4a6f-9c5d-6e8f0a1b2c33",
            "individual_operator_uuid": null,
            "readiness": {
                "state": "not_ready",
                "complete": true,
                "reasons": [
                    {
                        "code": "licence_expired",
                        "date": "2026-05-01"
                    }
                ]
            },
            "archived_at": null,
            "created_at": "2026-03-01T08:30:00Z",
            "updated_at": "2026-05-12T11:05:42Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /drivers/{uuid}

يتطلب مفتاحًا Read a driver

Reads one of your company's drivers by its uuid. A driver of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `drivers:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The driver.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3c1e9a52-8d47-4b6a-a2f0-5e7d9b4c1a44",
        "status": "active",
        "full_name": {
            "ar": "أحمد محمد",
            "en": "Ahmed Mohammed"
        },
        "mobile_number": "+966500000000",
        "nationality_country_code": "SA",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "employer_operator_uuid": "7a9c3d2e-1b44-4a6f-9c5d-6e8f0a1b2c33",
        "individual_operator_uuid": null,
        "readiness": {
            "state": "not_ready",
            "complete": true,
            "reasons": [
                {
                    "code": "licence_expired",
                    "date": "2026-05-01"
                }
            ]
        },
        "archived_at": null,
        "created_at": "2026-03-01T08:30:00Z",
        "updated_at": "2026-05-12T11:05:42Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

PATCH /drivers/{uuid}

يتطلب مفتاحًا Change a driver

Changes the name and the notes of one of your company's drivers, as the panel does. Send the `row_version` you read: a driver changed meanwhile, or a body without it, answers 409. A part you send replaces that part whole (`full_name` needs at least one language), a part you leave out stays as it is, and `notes` set to null clears the notes. The identity number and type, the border number, the gender, the mobile, the e-mail, the licence numbers, the date of birth, the nationality, the photo, the branch and the status cannot be sent (422 naming the key); they stay in the panel. The answer is the driver as the register reads it, without the mobile. Retry safely with the same Idempotency-Key. At most 60 changes an hour for one key and 600 a day for one company. Requires the key scope `fleet:drivers:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The driver after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3c1e9a52-8d47-4b6a-a2f0-5e7d9b4c1a44",
        "status": "active",
        "full_name": {
            "ar": "أحمد محمد",
            "en": "Ahmed Mohammed"
        },
        "mobile_number": "+966500000000",
        "nationality_country_code": "SA",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "employer_operator_uuid": "7a9c3d2e-1b44-4a6f-9c5d-6e8f0a1b2c33",
        "individual_operator_uuid": null,
        "readiness": {
            "state": "not_ready",
            "complete": true,
            "reasons": [
                {
                    "code": "licence_expired",
                    "date": "2026-05-01"
                }
            ]
        },
        "archived_at": null,
        "created_at": "2026-03-01T08:30:00Z",
        "updated_at": "2026-05-12T11:05:42Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /driver-availability

يتطلب مفتاحًا Read the driver availability board

The week of the company's drivers as the availability page shows it: each driver's state on each of seven days (ready, ready without a vehicle, on a trip, on leave, on a rest day of the driver's roster, off duty, not allowed to drive), the day's count of each state, whether the drivers cover each day's planned trips, the cards worth a look (the first short day, the licences ending within 14 days, the trips with no driver) with their counts, and who does not drive on the first day and why. A leave's kind and the reason a driver may not drive appear only for a key owner who may read them, and what the owner may not check is flagged unchecked. A rest day (`rest_day`) is reported, in the days and in the counts, only for a key that also holds the scope `fleet:driver_shifts:read` whose owner may read the roster; otherwise no day is a rest day and the counts carry no `rest_day` entry. Drivers are named by uuid only; no name, phone or position is returned. Requires the key scope `logistics:driver_availability:read` and the dispatch right. Requires the key scope `logistics:driver_availability:read`.

الترويسات

dayThe first of the seven days, Y-m-d, from today to a month ahead; today when absent or outside that.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The board of the week.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "first_day": "2026-11-19",
        "days": [
            {
                "date": "2026-11-19",
                "today": true
            }
        ],
        "total": 12,
        "capped": false,
        "trips_capped": false,
        "partial": false,
        "counts": {
            "ready": 5,
            "ready_no_vehicle": 1,
            "trip": 3,
            "leave": 1,
            "rest_day": 0,
            "off_duty": 1,
            "blocked": 1
        },
        "coverage": [
            {
                "date": "2026-11-19",
                "available": 10,
                "planned": 4,
                "short": false
            }
        ],
        "drivers": [
            {
                "driver_uuid": "3c1e9a52-8d47-4b6a-a2f0-5e7d9b4c1a44",
                "days": [
                    {
                        "date": "2026-11-19",
                        "state": "ready",
                        "label": null,
                        "unchecked": false
                    }
                ]
            }
        ],
        "cards": [
            {
                "key": "enough",
                "tone": "good",
                "count": null
            }
        ],
        "not_driving": [
            {
                "driver_uuid": "3c1e9a52-8d47-4b6a-a2f0-5e7d9b4c1a44",
                "kind": "blocked",
                "topic": "licence"
            }
        ]
    },
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-19T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /drivers/{uuid}/documents

يتطلب مفتاحًا List the files of a driver

Lists the files of the kind `other` attached to one of your company's drivers, newest first, up to 200: the document's uuid, its kind, its state (`available` once the scan is clean, otherwise `pending`), type, size and day. It gives the metadata only, never the file, a link, its title or its name; the identity copy is never listed. A driver of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `fleet:driver_documents:write`. Requires the key scope `fleet:driver_documents:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The files of the driver.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "5e8f1a22-3b4c-4d6e-8a9b-0c1d2e3f4a55",
            "kind": "other",
            "state": "available",
            "mime_type": "application/pdf",
            "size_bytes": 184320,
            "created_at": "2026-06-01T09:00:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 200,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /drivers/{uuid}/documents

يتطلب مفتاحًا Attach a document to a driver

Attaches a PDF, JPEG or PNG to one of your company's drivers as a driver document, as the panel does. Only the kind `other` is accepted: the identity copy stays in the panel. The file is scanned before it is stored and an infected file or a scanner outage is refused (422), so the answer carries the document in its `state`, `available`; there is nothing to poll. The file is not verified by this and changes nothing about the driver's readiness. The name you send is not kept. A company may upload a limited number of bytes a day, and a key a limited number of files an hour, through the API (429 with the reason `daily_quota` or `hourly_uploads`). A driver of another company or branch answers 404. Requires the key scope `fleet:driver_documents:write`, its owner's right to attach documents and to view the driver, and an `Idempotency-Key` header. Requires the key scope `fleet:driver_documents:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The attached document; state is available once the scan is clean, otherwise pending.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5e8f1a22-3b4c-4d6e-8a9b-0c1d2e3f4a55",
        "kind": "other",
        "state": "available",
        "mime_type": "application/pdf",
        "size_bytes": 184320,
        "created_at": "2026-06-01T09:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /driver-leaves

يتطلب مفتاحًا List driver leave

Lists your company's leave entries by their start day, one page at a time. A range of dates (from and to, at most 366 days) is required unless you name one driver. Sick and emergency leave read as «leave» unless the key's owner may manage leave; the note and any certificate are never returned. Requires the key scope `driver_leaves:read`.

الترويسات

driverOnly this driver (its uuid).
stateOnly entries in this state: current, upcoming, past or voided.
fromFirst day of the range (YYYY-MM-DD, Saudi calendar).
toLast day of the range (YYYY-MM-DD, Saudi calendar).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of leave entries.
مثال
{
    "success": true,
    "data": [
        {
            "uuid": "3f8b2c6e-91d4-4a7b-8c35-5e0a1d9f7b42",
            "driver_uuid": "7a1c9e30-5b2d-4f68-9d14-2c8e6b0a3f51",
            "kind": "annual",
            "starts_on": "2026-11-15",
            "ends_on": "2026-11-17",
            "days": 3,
            "state": "upcoming",
            "voided": false,
            "created_at": "2026-11-01T08:00:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /driver-leaves/{uuid}

يتطلب مفتاحًا Read a leave entry

Reads one leave entry by its uuid. An entry of another company, outside the key owner's branch, of the owner's own driver, or that does not exist answers 404 alike. Requires the key scope `driver_leaves:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The leave entry.
مثال
{
    "success": true,
    "data": {
        "uuid": "3f8b2c6e-91d4-4a7b-8c35-5e0a1d9f7b42",
        "driver_uuid": "7a1c9e30-5b2d-4f68-9d14-2c8e6b0a3f51",
        "kind": "annual",
        "starts_on": "2026-11-15",
        "ends_on": "2026-11-17",
        "days": 3,
        "state": "upcoming",
        "voided": false,
        "created_at": "2026-11-01T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /driver-leave-requests

يتطلب مفتاحًا List driver leave requests

Lists the leave requests your drivers made in the app, newest first, one page at a time; the waiting ones unless you name a state. The driver's note is never returned. Requires the key scope `fleet:leave_decisions:write` and an owner who manages leave. Requires the key scope `fleet:leave_decisions:write`.

الترويسات

staterequested (default), approved, declined or withdrawn.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of leave requests.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "5d1f7a2c-3b8e-4c90-a6d4-8e2b1f0c9a37",
            "driver_uuid": "7a1c9e30-5b2d-4f68-9d14-2c8e6b0a3f51",
            "driver_name": "Ahmed Alharbi",
            "kind": "annual",
            "starts_on": "2026-11-20",
            "ends_on": "2026-11-22",
            "state": "requested",
            "decline_reason": null,
            "requested_at": "2026-11-17T08:00:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-17T09:00:00Z"
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /driver-leave-requests/{uuid}/approve

يتطلب مفتاحًا Approve a leave request

Approves a waiting leave request: the leave is recorded and the driver is told, as in the panel. A request already decided answers 409. Requires the key scope `fleet:leave_decisions:write`, an owner who manages leave, and an `Idempotency-Key` header. Requires the key scope `fleet:leave_decisions:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The request, now approved.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5d1f7a2c-3b8e-4c90-a6d4-8e2b1f0c9a37",
        "driver_uuid": "7a1c9e30-5b2d-4f68-9d14-2c8e6b0a3f51",
        "driver_name": "Ahmed Alharbi",
        "kind": "annual",
        "starts_on": "2026-11-20",
        "ends_on": "2026-11-22",
        "state": "requested",
        "decline_reason": null,
        "requested_at": "2026-11-17T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-17T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /driver-leave-requests/{uuid}/decline

يتطلب مفتاحًا Decline a leave request

Declines a waiting leave request with a reason from a fixed list and tells the driver. A request already decided answers 409. Requires the key scope `fleet:leave_decisions:write`, an owner who manages leave, and an `Idempotency-Key` header. Requires the key scope `fleet:leave_decisions:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The request, now declined.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5d1f7a2c-3b8e-4c90-a6d4-8e2b1f0c9a37",
        "driver_uuid": "7a1c9e30-5b2d-4f68-9d14-2c8e6b0a3f51",
        "driver_name": "Ahmed Alharbi",
        "kind": "annual",
        "starts_on": "2026-11-20",
        "ends_on": "2026-11-22",
        "state": "declined",
        "decline_reason": "period_not_possible",
        "requested_at": "2026-11-17T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-17T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /drivers/{uuid}/overview

يتطلب مفتاحًا Read a driver's overview

When the identity document, the driving licence and the professional card of one of your drivers end: a label, a day and the days left, only for the kinds the key's owner may read in the panel. It carries no number, file, name, figure, violation, score or training. Another company's or branch's driver is a 404. Requires the key scope `fleet:driver_overview:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The overview.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "expiring": [
            {
                "label": "Driving licence",
                "detail": "Ends 2026-12-01",
                "days": 17
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T10:00:00+00:00"
    }
}
404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /driver-pay/sheets

يتطلب مفتاحًا List pay sheets

Lists the monthly pay sheets of your company, newest month first: month, currency, state, how many drivers it has lines for and the total of those lines. The key's owner must hold the pay right and be bound to no branch, and the opening is recorded before the figures are returned; if it cannot be recorded nothing is returned. Requires the key scope `fleet:driver_pay_sheets:read`.

الترويسات

stateOnly sheets in this state: draft, reviewed, approved, paid or cancelled.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 One page of sheets.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "ref": "Xk3dQ0m1v8aB2cD4eF5gHw",
            "month": "2026-10",
            "currency": "SAR",
            "state": "approved",
            "drivers": 12,
            "total": "41250.00"
        }
    ],
    "meta": {
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /driver-pay/sheets

يتطلب مفتاحًا Compute a draft pay sheet

Computes the draft sheet of a month (a past one or the month in progress) in one currency, as the panel does; a sheet is reviewed only once its month is over. The answer holds the sheet's ref and state, never a figure; read the lines with the sheets scope. A month that already has a sheet in this currency answers 409. Reviewing, approving and paying stay in the panel. Requires the key scope `fleet:driver_pay_sheets:compute`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The draft sheet.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "ref": "Xk3dQ0m1v8aB2cD4eF5gHw",
        "state": "draft"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /driver-pay/sheets/{ref}

يتطلب مفتاحًا Read a pay sheet

Reads one pay sheet by its ref with its lines: for each driver (by uuid) the days paid, the days of the month, the basic pay, the allowances and the total. A sheet of another company answers 404 like one that does not exist. Requires the key scope `fleet:driver_pay_sheets:read`.

الترويسات

ref
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The sheet with its lines.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "ref": "Xk3dQ0m1v8aB2cD4eF5gHw",
        "month": "2026-10",
        "currency": "SAR",
        "state": "approved",
        "lines": [
            {
                "driver_uuid": "7c1d2e44-5b6a-4f0e-9a3b-1d2c3e4f5a6b",
                "days_paid": 31,
                "days_in_month": 31,
                "basic": "3000.00",
                "allowances": "450.00",
                "total": "3450.00"
            }
        ]
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /driver-pay/ledger

يتطلب مفتاحًا List pay ledger entries

Lists the advances, deductions and additions of your company's drivers, newest first: kind, amount, instalment, reason code, state and the driver by uuid. A note is never returned. The opening is recorded before the figures are returned. Requires the key scope `fleet:driver_pay_ledger:read`.

الترويسات

stateOnly entries in this state: proposed, approved or cancelled.
kindOnly this kind: advance, deduction or addition.
driverOnly this driver (their uuid).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 One page of entries.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "ref": "Pq9dQ0m1v8aB2cD4eF5gHw",
            "driver_uuid": "7c1d2e44-5b6a-4f0e-9a3b-1d2c3e4f5a6b",
            "kind": "advance",
            "amount": "1500.00",
            "currency": "SAR",
            "instalment": "500.00",
            "reason_code": null,
            "state": "proposed",
            "created_at": "2026-11-02T08:15:00Z"
        }
    ],
    "meta": {
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /driver-pay/ledger

يتطلب مفتاحًا Propose a pay ledger entry

Proposes an advance, a deduction or an addition to one driver's pay, as the panel does. The key's owner is the proposer, so a second person must approve it in the panel; nothing is approved or paid here. The amount is in minor units within a ceiling, an advance needs its instalment, a deduction or addition needs a reason code, and a note is required. Capped per key and per company in a day. Requires the key scope `fleet:driver_pay_ledger:propose`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The entry that was proposed.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "ref": "Pq9dQ0m1v8aB2cD4eF5gHw",
        "state": "proposed"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /driver-pay/items

يتطلب مفتاحًا List pay allowance items

Lists the allowance items your company names for its drivers' pay, oldest first: the code, both names and whether the item is archived. No amount and no driver is part of it, and the opening is recorded first. Requires the key scope `fleet:driver_pay_items:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 One page of items.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "code": "housing",
            "name_ar": "سكن",
            "name_en": "Housing",
            "archived": false
        }
    ],
    "meta": {
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /driver-pay/terms

يتطلب مفتاحًا List the pay terms in force

Lists, for each driver, the pay term in force today: the day it took effect, the basic pay, the currency and how a trip is paid. Earlier terms and the reason text are never returned, and a term is never changed here. The opening is recorded before the figures are returned. Requires the key scope `fleet:driver_pay_terms:read`.

الترويسات

driverOnly this driver (their uuid).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 One page of terms.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "driver_uuid": "7c1d2e44-5b6a-4f0e-9a3b-1d2c3e4f5a6b",
            "effective_from": "2026-01-01",
            "basic": "3000.00",
            "currency": "SAR",
            "trip_basis": "none",
            "trip_value": null
        }
    ],
    "meta": {
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /driver-pay/ledger/{ref}/cancel

يتطلب مفتاحًا Cancel a pay ledger entry

Cancels an entry that is still waiting for a decision, with a reason. An entry that was approved or cancelled already answers 409: an approved entry moves money and is cancelled in the panel only. Requires the key scope `fleet:driver_pay_ledger:cancel`.

الترويسات

ref
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The entry after the cancellation.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "ref": "Pq9dQ0m1v8aB2cD4eF5gHw",
        "state": "cancelled"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /drivers/proposals

يتطلب مفتاحًا Propose a driver

Proposes a new driver of your company by name only: a proposal is not a driver. A different user of your company completes it in the panel, typing the identity, the nationality, the mobile and the rest, and only then does the driver exist; until then it waits at most 30 days. Nothing but `full_name` can be sent (422 naming the key). The answer is the proposal with its state. A name already waiting answers 409 `open_duplicate`; a company with 200 waiting answers 429 `open_proposals`. At most 20 proposals an hour for one key and 100 a day for one company. Retry safely with the same Idempotency-Key. Requires the key scope `fleet:driver_proposals:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The proposal, waiting.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "8c2f1d44-6a3b-4e9d-b1c5-2f7e0a9d3b61",
        "state": "proposed",
        "full_name": {
            "ar": "أحمد محمد",
            "en": "Ahmed Mohammed"
        },
        "driver_uuid": null,
        "decision_note": null,
        "created_at": "2026-06-01T09:00:00Z",
        "expires_at": "2026-07-01T09:00:00Z",
        "decided_at": null
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /drivers/proposals

يتطلب مفتاحًا List driver proposals

The latest 100 proposals of your company, newest first, optionally of one state. Read one by its uuid for the rest. Requires the key scope `fleet:driver_proposals:write`.

الترويسات

stateOnly the proposals in this state.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The proposals.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "8c2f1d44-6a3b-4e9d-b1c5-2f7e0a9d3b61",
            "state": "proposed",
            "full_name": {
                "ar": "أحمد محمد",
                "en": "Ahmed Mohammed"
            },
            "driver_uuid": null,
            "decision_note": null,
            "created_at": "2026-06-01T09:00:00Z",
            "expires_at": "2026-07-01T09:00:00Z",
            "decided_at": null
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 100,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /drivers/proposals/{uuid}

يتطلب مفتاحًا Read a driver proposal

The state of one proposal of your company: `proposed`, `approved`, `rejected`, `cancelled` or `expired`; `driver_uuid` once it became a driver, the decision note only when it was rejected, and the name until it is blanked 90 days after the decision. A proposal of another company answers 404. Requires the key scope `fleet:driver_proposals:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The proposal.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "8c2f1d44-6a3b-4e9d-b1c5-2f7e0a9d3b61",
        "state": "proposed",
        "full_name": {
            "ar": "أحمد محمد",
            "en": "Ahmed Mohammed"
        },
        "driver_uuid": null,
        "decision_note": null,
        "created_at": "2026-06-01T09:00:00Z",
        "expires_at": "2026-07-01T09:00:00Z",
        "decided_at": null
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /driver-roster-entries

يتطلب مفتاحًا List the driver roster

Lists the standing roster entries of your company's drivers, one page at a time (at most 100): the driver and the template by uuid and the Riyadh days the driver follows it (no end day while it runs on). Voided entries are never listed. Requires the fleet:driver_shifts:read scope; every read is recorded. Requires the key scope `fleet:driver_shifts:read`.

الترويسات

driverOnly this driver (its uuid).
templateOnly this shift template (its uuid).
onOnly the entries a driver follows on this day (YYYY-MM-DD, Saudi calendar).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of roster entries.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "2e8a5d40-1c7b-4b96-9f03-6a4c8e1d7b52",
            "driver_uuid": "7a1c9e30-5b2d-4f68-9d14-2c8e6b0a3f51",
            "template_uuid": "9c4e1b72-6a05-4f3d-8e21-7b0d3a5c9f18",
            "starts_on": "2026-11-01",
            "ends_on": null,
            "state": "current",
            "created_at": "2026-11-01T08:00:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-20T09:00:00Z"
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /driver-roster-entries/{uuid}

يتطلب مفتاحًا Read a roster entry

Reads one standing roster entry by its uuid. An entry of another company, outside the key owner's branch, voided, or that does not exist answers 404 alike. Requires the fleet:driver_shifts:read scope; the read is recorded. Requires the key scope `fleet:driver_shifts:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The roster entry.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "2e8a5d40-1c7b-4b96-9f03-6a4c8e1d7b52",
        "driver_uuid": "7a1c9e30-5b2d-4f68-9d14-2c8e6b0a3f51",
        "template_uuid": "9c4e1b72-6a05-4f3d-8e21-7b0d3a5c9f18",
        "starts_on": "2026-11-01",
        "ends_on": null,
        "state": "current",
        "created_at": "2026-11-01T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-20T09:00:00Z"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /driver-shift-templates

يتطلب مفتاحًا List shift templates

Lists your company's shift templates, one page at a time (at most 100): the name, the working days as ISO weekdays (1 Monday to 7 Sunday), the start and end time in Riyadh and whether the shift runs past midnight. Live templates only unless you ask for the voided ones. Requires the fleet:driver_shifts:read scope. Requires the key scope `fleet:driver_shifts:read`.

الترويسات

statelive (the default) or voided.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of shift templates.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "9c4e1b72-6a05-4f3d-8e21-7b0d3a5c9f18",
            "name": "Morning",
            "weekdays": [
                6,
                7,
                1,
                2,
                3,
                4
            ],
            "starts_at": "06:00",
            "ends_at": "14:00",
            "crosses_midnight": false,
            "company_wide": true,
            "state": "live",
            "created_at": "2026-11-20T08:00:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-20T09:00:00Z"
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /driver-shift-templates/{uuid}

يتطلب مفتاحًا Read a shift template

Reads one shift template by its uuid. A template of another company, outside the key owner's branch, or that does not exist answers 404 alike. Requires the fleet:driver_shifts:read scope. Requires the key scope `fleet:driver_shifts:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The shift template.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "9c4e1b72-6a05-4f3d-8e21-7b0d3a5c9f18",
        "name": "Morning",
        "weekdays": [
            6,
            7,
            1,
            2,
            3,
            4
        ],
        "starts_at": "06:00",
        "ends_at": "14:00",
        "crosses_midnight": false,
        "company_wide": true,
        "state": "live",
        "created_at": "2026-11-20T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-20T09:00:00Z"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /driver-trainings

يتطلب مفتاحًا List driver training

Lists your company's training entries, oldest first, one page at a time. A range of dates (from and to on the completion day, at most 366 days) is required unless you name one driver. Costs, notes and void reasons are never returned. Requires the key scope `driver_trainings:read`.

الترويسات

driverOnly this driver (its uuid).
resultOnly entries with this result: passed, failed, attended or in_progress.
fromFirst completion day of the range (YYYY-MM-DD, Saudi calendar).
toLast completion day of the range (YYYY-MM-DD, Saudi calendar).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of training entries.
مثال
{
    "success": true,
    "data": [
        {
            "uuid": "3f8b2c6e-91d4-4a7b-8c35-5e0a1d9f7b42",
            "driver_uuid": "7a1c9e30-5b2d-4f68-9d14-2c8e6b0a3f51",
            "course": "Defensive driving",
            "provider": "Road Safety Academy",
            "completed_on": "2026-10-12",
            "result": "passed",
            "certificate_ends_on": "2028-10-12",
            "voided": false
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /driver-trainings/{uuid}

يتطلب مفتاحًا Read a training entry

Reads one training entry by its uuid. An entry of another company, outside the key owner's branch, of the owner's own driver, or that does not exist answers 404 alike. Requires the key scope `driver_trainings:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The training entry.
مثال
{
    "success": true,
    "data": {
        "uuid": "3f8b2c6e-91d4-4a7b-8c35-5e0a1d9f7b42",
        "driver_uuid": "7a1c9e30-5b2d-4f68-9d14-2c8e6b0a3f51",
        "course": "Defensive driving",
        "provider": "Road Safety Academy",
        "completed_on": "2026-10-12",
        "result": "passed",
        "certificate_ends_on": "2028-10-12",
        "voided": false
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /video/events

يتطلب مفتاحًا List camera events

Lists your company's camera events, oldest first, one page at a time. Each carries the vehicle, the kind of event, its severity, when it happened and was received, whether a person judged it and its footage as lines (kind, camera, length, size, status, whether pinned and until when it is kept). The driver, the position, the speed, the stored file and the footage itself are never shown. Every successful request is recorded as a read of confidential records. A branch-limited key sees only the events of its branch. Requires the key scope `video:events:read`.

الترويسات

statusOnly events in this review state: unreviewed, valid or invalid.
vehicleOnly the events of this vehicle (its uuid).
branchOnly the events of this branch (its uuid).
updated_sinceOnly events received at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of camera events.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "3c8e1f52-6a47-4d90-b2e1-8f5a0c7d9e14",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "kind": "dsm_phone",
            "severity": 6,
            "occurred_at": "2026-05-12T07:48:00Z",
            "received_at": "2026-05-12T07:48:09Z",
            "review_state": "unreviewed",
            "has_footage": true,
            "footage": [
                {
                    "uuid": "9d2b7c4e-1f63-4a08-8c5d-6e0a3b1f7d25",
                    "kind": "clip",
                    "camera_channel": 1,
                    "duration_seconds": 20,
                    "bytes": 3145728,
                    "mime": "video/mp4",
                    "captured_at": "2026-05-12T07:47:50Z",
                    "status": "available",
                    "pinned": false,
                    "retention_until": "2026-06-11T07:48:09Z"
                }
            ]
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /video/events

يتطلب مفتاحًا Send camera events

Stores camera events (driver monitoring, driving assistance and blind-spot alarms) raised by your camera platform. Each event names its camera by device_id, the id your account maps to a vehicle, and its kind by one of the canonical kinds; the vehicle and the driver of that moment are found from your account's mappings, never from the body. Every event is answered on its own in the same order: accepted, duplicate (the same event_id with the same kind and time was already stored) or refused with a reason: not_enabled (the company has not enabled camera video), plan (the plan does not include it), kind_not_enabled, unknown_device (no vehicle is mapped to that device at that time), identity_mismatch, identity_conflict, identity_unavailable or event_id_reused (the same event_id with another kind or time). An event time is ISO 8601 with a zone or epoch milliseconds, at most five minutes ahead and thirty days old. A batch holds at most 100 events by default; an empty or larger one, or invalid fields, answer 422 with one detail per field; a body over the size limit answers 413. A refused event stores nothing, and clips or snapshots are sent separately.

الترويسات

X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

جسم الطلب

eventsمطلوبOne or more camera events. Fields: event_id (your id, unique per event), device_id (the camera device id your account maps), kind (dsm_fatigue, dsm_distraction, dsm_phone, dsm_smoking, dsm_yawning, dsm_driver_absent, dsm_camera_covered, dsm_seatbelt, adas_forward_collision, adas_headway, adas_lane_departure, adas_pedestrian, bsd_vehicle, bsd_pedestrian), occurred_at or occurred_at_epoch_ms; optional imei (a consistency check), latitude and longitude together, speed_kmh, severity (0 to 10, your device's own scale) and raw (an object of up to 8 KB).
مثال
{
    "events": [
        {
            "event_id": "evt-2026-11-07-0001",
            "device_id": "cam-1234",
            "kind": "dsm_fatigue",
            "occurred_at": "2026-11-07T08:15:30Z",
            "latitude": 24.7136,
            "longitude": 46.6753,
            "speed_kmh": 72.5,
            "severity": 2
        }
    ]
}

الردود

200 Nothing new is stored: every event was already stored or was refused.
مثال
{
    "success": true,
    "data": {
        "received": 1,
        "accepted": 0,
        "duplicates": 1,
        "refused": 0,
        "results": [
            {
                "event_id": "evt-2026-11-07-0001",
                "status": "duplicate",
                "reason": null
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-11-07T08:20:00Z"
    }
}
202 At least one event is stored.
مثال
{
    "success": true,
    "data": {
        "received": 2,
        "accepted": 1,
        "duplicates": 0,
        "refused": 1,
        "results": [
            {
                "event_id": "evt-2026-11-07-0001",
                "status": "accepted",
                "reason": null
            },
            {
                "event_id": "evt-2026-11-07-0002",
                "status": "refused",
                "reason": "unknown_device"
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-11-07T08:15:31Z"
    }
}
401 unauthenticated: the source token is missing, expired or revoked.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "unauthenticated",
        "message": "Authentication is required."
    },
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-11-07T08:15:31Z"
    }
}
413 payload_too_large: the request body is over the size limit.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "payload_too_large",
        "message": "The request body is too large."
    },
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-11-07T08:15:31Z"
    }
}
415 unsupported_media_type: send Content-Type application/json.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "unsupported_media_type",
        "message": "The request body must be application/json."
    },
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-11-07T08:15:31Z"
    }
}
422 validation_failed: one detail per invalid field, or an empty batch or one with more events than allowed.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "validation_failed",
        "message": "The request contains invalid fields.",
        "details": [
            {
                "field": "events.0.kind",
                "code": "unknown_value",
                "message": "This value is not one of the allowed values."
            }
        ]
    },
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-11-07T08:15:31Z"
    }
}
429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /video/events/{uuid}

يتطلب مفتاحًا Read a camera event

Reads one of your company's camera events by its uuid. An event of another company or branch answers 404 exactly like one that does not exist. A successful request is recorded as a read of confidential records. Requires the key scope `video:events:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The camera event.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3c8e1f52-6a47-4d90-b2e1-8f5a0c7d9e14",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "kind": "dsm_phone",
        "severity": 6,
        "occurred_at": "2026-05-12T07:48:00Z",
        "received_at": "2026-05-12T07:48:09Z",
        "review_state": "unreviewed",
        "has_footage": true,
        "footage": [
            {
                "uuid": "9d2b7c4e-1f63-4a08-8c5d-6e0a3b1f7d25",
                "kind": "clip",
                "camera_channel": 1,
                "duration_seconds": 20,
                "bytes": 3145728,
                "mime": "video/mp4",
                "captured_at": "2026-05-12T07:47:50Z",
                "status": "available",
                "pinned": false,
                "retention_until": "2026-06-11T07:48:09Z"
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /expenses

يتطلب مفتاحًا List expenses

Lists your company's vehicle expenses, oldest first, one page at a time. Each carries the vehicle and branch by uuid, type, date, amount in minor units, supplier and reference, which are free text as your staff typed them; notes and receipts are never shown. A branch-limited key sees only the expenses recorded under its own branch: the other record types follow the vehicle's current branch, so when a vehicle moves its old expenses stay with the old branch. Requires the key scope `expenses:read`.

الترويسات

statusOnly expenses in this state: active or voided. Voided expenses are left out unless you ask for them.
vehicleOnly the vehicle expenses of this vehicle (its uuid).
branchOnly expenses of this branch (its uuid).
updated_sinceOnly vehicle expenses changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of vehicle expenses.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "7e1c4a92-3d58-4f06-a9b3-2b6d8e0f5c14",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
            "expense_type_code": "fuel",
            "spent_on": "2026-05-12",
            "amount_minor": 34250,
            "currency": "SAR",
            "supplier": "Al Rajhi Fuel Station",
            "reference": "INV-20481",
            "voided_at": null,
            "created_at": "2026-05-12T12:00:00Z",
            "updated_at": "2026-05-12T12:00:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /expenses

يتطلب مفتاحًا Record a vehicle expense

Records an expense on one of your company's vehicles, as the panel does: its type, the day it was spent (not in the future), the amount in minor units and the supplier, reference and note. The company's rules apply exactly as in the panel. A driver and a receipt cannot be sent. Send an Idempotency-Key header so a retry does not record it twice. Requires the key scope `fleet:expenses:write`. Requires the key scope `fleet:expenses:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The expense that was recorded.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7e1c4a92-3d58-4f06-a9b3-2b6d8e0f5c14",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "expense_type_code": "fuel",
        "spent_on": "2026-05-12",
        "amount_minor": 34250,
        "currency": "SAR",
        "supplier": "Al Rajhi Fuel Station",
        "reference": "INV-20481",
        "voided_at": null,
        "created_at": "2026-05-12T12:00:00Z",
        "updated_at": "2026-05-12T12:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /expenses/{uuid}

يتطلب مفتاحًا Read an expense

Reads one of your company's vehicle expenses by its uuid. A record of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `expenses:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The expense.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7e1c4a92-3d58-4f06-a9b3-2b6d8e0f5c14",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "expense_type_code": "fuel",
        "spent_on": "2026-05-12",
        "amount_minor": 34250,
        "currency": "SAR",
        "supplier": "Al Rajhi Fuel Station",
        "reference": "INV-20481",
        "voided_at": null,
        "created_at": "2026-05-12T12:00:00Z",
        "updated_at": "2026-05-12T12:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

PUT /expenses/types/{code}

يتطلب مفتاحًا Change an expense type

Renames an expense type of your own company or switches it off or on, as the panel does. A type of the platform answers 404, and a type is never deleted. Requires the key scope `fleet:expenses:write`. Requires the key scope `fleet:expenses:write`.

الترويسات

code
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The type, changed.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "code": "c12_a1b2c3d4",
        "name_ar": "رسوم موقف",
        "name_en": "Parking fees",
        "is_active": true
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /expenses/{uuid}/void

يتطلب مفتاحًا Void a vehicle expense

Voids an expense of your company with a reason of at least ten characters; the row stays, frozen, and is shown as voided. Send the `row_version` you read: an expense changed meanwhile answers 409. An expense that is the payment of a violation cannot be voided here (409): reopen the payment on the violation. Requires the key scope `fleet:expenses:write`. Requires the key scope `fleet:expenses:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The expense, now voided.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7e1c4a92-3d58-4f06-a9b3-2b6d8e0f5c14",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "expense_type_code": "fuel",
        "spent_on": "2026-05-12",
        "amount_minor": 34250,
        "currency": "SAR",
        "supplier": "Al Rajhi Fuel Station",
        "reference": "INV-20481",
        "voided_at": null,
        "created_at": "2026-05-12T12:00:00Z",
        "updated_at": "2026-05-12T12:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /file-imports

يتطلب مفتاحًا List fleet file uploads

Lists the fleet files your company uploaded, oldest first, one page at a time: the kind of record, the file name, how many rows were staged and the skipped rows with a closed reason each. Nothing from inside a file is returned. Needs the same right as the uploads page. Requires the key scope `file_imports:read`.

الترويسات

statusOnly uploads of this kind of record: vehicle, driver or device.
updated_sinceOnly uploads made at or after this moment (ISO 8601 with an offset).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of uploads.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "4d8b2f70-1c5e-4a96-b3d7-6e0a9c2f5b18",
            "record_type": "vehicle",
            "file_name": "vehicles.xlsx",
            "rows_staged": 38,
            "rows_skipped": 2,
            "skipped": [
                {
                    "row": 7,
                    "reason": "no_identifier"
                },
                {
                    "row": 19,
                    "reason": "invalid_values"
                }
            ],
            "retries": 0,
            "created_at": "2026-11-14T08:30:00Z",
            "last_retried_at": null
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /file-imports/{uuid}

يتطلب مفتاحًا Read a fleet file upload

Reads one upload by its uuid. Another company's upload answers 404 exactly like one that does not exist. Requires the key scope `file_imports:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The upload.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "4d8b2f70-1c5e-4a96-b3d7-6e0a9c2f5b18",
        "record_type": "vehicle",
        "file_name": "vehicles.xlsx",
        "rows_staged": 38,
        "rows_skipped": 2,
        "skipped": [
            {
                "row": 7,
                "reason": "no_identifier"
            },
            {
                "row": 19,
                "reason": "invalid_values"
            }
        ],
        "retries": 0,
        "created_at": "2026-11-14T08:30:00Z",
        "last_retried_at": null
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fitted-items

يتطلب مفتاحًا List fitted tyres and batteries

Lists your company's fitted tyres and batteries, oldest first, one page at a time. Each carries the vehicle by uuid, the kind, brand, size, position, the dates and kilometres of fitting and removal, and the reason a removed one ended. The cost, the notes and who entered them are never shown. Requires the key scope `fitted_items:read`.

الترويسات

statusOnly items in this state: active or voided. Voided items are left out unless you ask for them.
vehicleOnly the items of this vehicle (its uuid).
updated_sinceOnly items changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of fitted tyres and batteries.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "3a8e1c52-7b40-4d19-9f6e-2c5d0b8a7e31",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "asset_uuid": null,
            "kind": "tyre",
            "brand": "Michelin",
            "model": "XZE",
            "specification": "315/80R22.5",
            "serial_number": "DOT-2024-0113",
            "condition": "new",
            "placement": "wheel",
            "axle": 1,
            "side": "left",
            "slot": 1,
            "fitted_on": "2026-03-02",
            "fitted_km": 85000,
            "removed_on": null,
            "removed_km": null,
            "removal_reason": null,
            "voided_at": null,
            "created_at": "2026-03-02T08:00:00Z",
            "updated_at": "2026-03-02T08:00:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:30:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fitted-items

يتطلب مفتاحًا Fit a tyre or a battery

Records a tyre or a battery fitted to one of your company's vehicles, as the panel does: what it is, the place and the day. A cost is never accepted here; it stays in the panel. Requires the key scope `fleet:fitted_items:write` and a plan with maintenance. Requires the key scope `fleet:fitted_items:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The fitted item.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3a8e1c52-7b40-4d19-9f6e-2c5d0b8a7e31",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "asset_uuid": null,
        "kind": "tyre",
        "brand": "Michelin",
        "model": "XZE",
        "specification": "315/80R22.5",
        "serial_number": "DOT-2024-0113",
        "condition": "new",
        "placement": "wheel",
        "axle": 1,
        "side": "left",
        "slot": 1,
        "fitted_on": "2026-03-02",
        "fitted_km": 85000,
        "removed_on": null,
        "removed_km": null,
        "removal_reason": null,
        "voided_at": null,
        "created_at": "2026-03-02T08:00:00Z",
        "updated_at": "2026-03-02T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fitted-items/{uuid}

يتطلب مفتاحًا Read a fitted tyre or battery

Reads one of your company's fitted tyres or batteries by its uuid. A record of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `fitted_items:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The fitted item.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3a8e1c52-7b40-4d19-9f6e-2c5d0b8a7e31",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "asset_uuid": null,
        "kind": "tyre",
        "brand": "Michelin",
        "model": "XZE",
        "specification": "315/80R22.5",
        "serial_number": "DOT-2024-0113",
        "condition": "new",
        "placement": "wheel",
        "axle": 1,
        "side": "left",
        "slot": 1,
        "fitted_on": "2026-03-02",
        "fitted_km": 85000,
        "removed_on": null,
        "removed_km": null,
        "removal_reason": null,
        "voided_at": null,
        "created_at": "2026-03-02T08:00:00Z",
        "updated_at": "2026-03-02T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:30:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fitted-items/rotate

يتطلب مفتاحًا Rotate tyres

Moves tyres of one vehicle to new places at once, a swap included. Each move names the tyre, the version you read and the new place. A tyre changed meanwhile answers 409. Requires the key scope `fleet:fitted_items:write`. Requires the key scope `fleet:fitted_items:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The moved tyres.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "3a8e1c52-7b40-4d19-9f6e-2c5d0b8a7e31",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "asset_uuid": null,
            "kind": "tyre",
            "brand": "Michelin",
            "model": "XZE",
            "specification": "315/80R22.5",
            "serial_number": "DOT-2024-0113",
            "condition": "new",
            "placement": "wheel",
            "axle": 1,
            "side": "left",
            "slot": 1,
            "fitted_on": "2026-03-02",
            "fitted_km": 85000,
            "removed_on": null,
            "removed_km": null,
            "removal_reason": null,
            "voided_at": null,
            "created_at": "2026-03-02T08:00:00Z",
            "updated_at": "2026-03-02T08:00:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fitted-items/{uuid}/check

يتطلب مفتاحًا Record a reading of a tyre or a battery

Records one reading on a fitted item: a tyre's tread in millimetres or pressure in bar, or a battery's voltage in volts, with the day and optionally the odometer. Send exactly one reading. Requires the key scope `fleet:fitted_items:write`. Requires the key scope `fleet:fitted_items:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The fitted item.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3a8e1c52-7b40-4d19-9f6e-2c5d0b8a7e31",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "asset_uuid": null,
        "kind": "tyre",
        "brand": "Michelin",
        "model": "XZE",
        "specification": "315/80R22.5",
        "serial_number": "DOT-2024-0113",
        "condition": "new",
        "placement": "wheel",
        "axle": 1,
        "side": "left",
        "slot": 1,
        "fitted_on": "2026-03-02",
        "fitted_km": 85000,
        "removed_on": null,
        "removed_km": null,
        "removal_reason": null,
        "voided_at": null,
        "created_at": "2026-03-02T08:00:00Z",
        "updated_at": "2026-03-02T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fitted-items/{uuid}/remove

يتطلب مفتاحًا Take a tyre or a battery off

Records the removal of a fitted item, as the panel does: the day, the reason and optionally a note, the odometer and the last tread. Send the `row_version` you read: an item changed meanwhile answers 409. Voiding an item stays in the panel. Requires the key scope `fleet:fitted_items:write`. Requires the key scope `fleet:fitted_items:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The removed item.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3a8e1c52-7b40-4d19-9f6e-2c5d0b8a7e31",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "asset_uuid": null,
        "kind": "tyre",
        "brand": "Michelin",
        "model": "XZE",
        "specification": "315/80R22.5",
        "serial_number": "DOT-2024-0113",
        "condition": "new",
        "placement": "wheel",
        "axle": 1,
        "side": "left",
        "slot": 1,
        "fitted_on": "2026-03-02",
        "fitted_km": 85000,
        "removed_on": null,
        "removed_km": null,
        "removal_reason": null,
        "voided_at": null,
        "created_at": "2026-03-02T08:00:00Z",
        "updated_at": "2026-03-02T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fleet-asset-categories

يتطلب مفتاحًا List fleet asset categories

Lists the active trailer and equipment categories by code, one page at a time, each with its kind. Requires the key scope `fleet_assets:read`.

الترويسات

kindOnly the categories of this kind.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of categories.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "code": "flatbed_trailer",
            "kind": "trailer",
            "class_code": "trailer",
            "name_ar": "مقطورة مسطحة",
            "name_en": "Flatbed trailer"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fleet-assets/{uuid}/files/{fileUuid}

يتطلب مفتاحًا Open a fleet asset file

One file of an asset with a short-lived signed link that opens it for the key's owner, who must hold the right to view assets. Requires the key scope `fleet_assets:read`.

الترويسات

uuid
fileUuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The file and its link.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5d1c8a47-2e93-4b6f-9a10-3c7e5f9b2d64",
        "kind": "insurance",
        "attached_on": "2026-11-01",
        "expires_on": "2027-11-01",
        "url": "https://example.test/documents/signed/abc"
    },
    "error": null,
    "meta": []
}
404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fleet-assets/{uuid}/maintenance-plans

يتطلب مفتاحًا Read a fleet asset's maintenance plans

The maintenance plans of one of your trailers or pieces of equipment, oldest first, at most 100, with the next due day or hours of each active plan. Needs fleet_assets:read and maintenance:read. An asset of another company or branch answers 404. Requires the key scope `fleet_assets:read,maintenance:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The plans.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "asset_uuid": "9e2b7c14-3d58-4f0a-b6a1-7c4d2e8f5a10",
        "plans": [
            {
                "uuid": "8b4e3f2a-6d7c-4b90-9e21-3c5d7f9a1b44",
                "name": "Brake service",
                "plan_type": "preventive",
                "category_code": null,
                "every_days": 180,
                "every_hours": null,
                "baseline_on": "2026-06-01",
                "baseline_hours": null,
                "status": "active",
                "due_state": "ok",
                "next_due_on": "2026-11-28",
                "days_left": 13,
                "next_due_hours": null,
                "hours_left": null
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-15T09:00:00Z"
    }
}
404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fleet-assets/{uuid}/warranties

يتطلب مفتاحًا Read a fleet asset's warranties

The warranties of one of your trailers or pieces of equipment that were not voided, the one ending last first. An asset of another company or branch answers 404. Requires the key scope `fleet_assets:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The warranties.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "asset_uuid": "9e2b7c14-3d58-4f0a-b6a1-7c4d2e8f5a10",
        "warranties": [
            {
                "uuid": "7a3d2e1f-5c6b-4a89-8d10-2b4c6e8f0a33",
                "coverage": "Axles and brakes",
                "provider_name": "Trailer Works Co",
                "reference": "W-2026-118",
                "starts_on": "2026-01-01",
                "expires_on": "2027-12-31",
                "expired": false
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-15T09:00:00Z"
    }
}
404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /reports/fleet-profitability

يتطلب مفتاحًا Read the fleet profitability figures

The figures of the fleet profitability page for the last 7, 30 or 90 Saudi days against the days just before or the same days a year earlier: revenue, cost, profit and margin with their moves, the profit week by week, where the cost went by kind, the vehicles that made the most and the least, the health of the trips closed in the period with the biggest losses and the reasons the records give for them, and the profit of each lane for each kilometre. Money is a list of lines, one per currency, never added across currencies; a figure that needs one currency is null when there are several. The kinds of cost and the trip health follow what the key owner may see, and no driver is named. Requires the key scope `reporting:fleet_profitability:read`. Requires the key scope `reporting:fleet_profitability:read`.

الترويسات

daysThe period: the last 7, 30 or 90 days up to and including today; 30 when absent.
compareWhat the period is compared with: previous (the days just before it) or year_before (the same days a year earlier); previous when absent.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The figures of the period.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "period": {
            "from": "2026-10-20",
            "until": "2026-11-18",
            "days": 30,
            "compare": "previous"
        },
        "currency": "SAR",
        "now": {
            "revenue": [
                {
                    "currency": "SAR",
                    "amount": "120000.00"
                }
            ],
            "cost": [
                {
                    "currency": "SAR",
                    "amount": "70000.00"
                }
            ],
            "profit": [
                {
                    "currency": "SAR",
                    "amount": "50000.00"
                }
            ],
            "margin_basis_points": 4167
        },
        "before": {
            "revenue": [
                {
                    "currency": "SAR",
                    "amount": "100000.00"
                }
            ],
            "cost": [
                {
                    "currency": "SAR",
                    "amount": "65000.00"
                }
            ],
            "profit": [
                {
                    "currency": "SAR",
                    "amount": "35000.00"
                }
            ],
            "margin_basis_points": 3500
        },
        "change": {
            "revenue_basis_points": 2000,
            "cost_basis_points": 769,
            "profit_basis_points": 4286,
            "margin_move_basis_points": 667
        },
        "weeks": [],
        "cost_kinds": {
            "now": [],
            "before": []
        },
        "vehicles": null,
        "trip_health": {
            "reason": "no_trips"
        },
        "lanes": null,
        "attention": []
    },
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-19T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fleet/search

يتطلب مفتاحًا Search the fleet records

Finds your vehicles, maintenance work orders, spare parts, defects and fleet assets by the text the panel's top search uses, up to 10 of each kind: for every hit its type, its uuid and a short label, nothing else. A kind appears only when your key's owner may list it and your key also holds its own read scope (`vehicles:read`, `maintenance:read`, `defects:read` or `fleet_assets:read`); a key limited to a branch finds that branch's records only. Drivers, money records and personal data are never searched. The text is 2 to 60 characters. Requires the key scope `fleet:search:read`. Requires the key scope `fleet:search:read`.

الترويسات

qThe text to find, 2 to 60 characters of plain text.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The hits, grouped by nothing: each carries its type.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "type": "vehicle",
            "uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "label": "ABC 1234"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fuel-cards

يتطلب مفتاحًا List fuel cards

Lists your company's fuel cards, oldest first, one page at a time. Each carries the provider, the last four digits only, the state, the vehicle and the driver by uuid and the monthly limit. The card number and the note are never part of it. Requires the key scope `fuel_cards:read`.

الترويسات

statusOnly cards in this state: active, stopped or lost.
vehicleOnly the cards held by this vehicle (its uuid).
driverOnly the cards held by this driver (their uuid).
branchOnly cards of this branch (its uuid).
updated_sinceOnly cards changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of fuel cards.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "3b7e5a92-1c4d-4e68-9f03-7a2d8c6b1e45",
            "provider": "Aldrees",
            "label": "Truck 12 card",
            "last4": "4821",
            "state": "active",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "driver_uuid": null,
            "monthly_limit": "5000.00",
            "currency": "SAR",
            "expires_month": "2028-03",
            "row_version": 1,
            "created_at": "2026-05-12T09:20:00Z",
            "updated_at": "2026-05-12T09:20:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:30:00Z"
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fuel-cards

يتطلب مفتاحًا Add a fuel card

Adds a fuel card of your company, as the panel does: the provider and the last four digits only. The full number is refused and never saved. A holder is a vehicle or a driver of your company, by uuid; one you may not see answers like one that does not exist. A note is not accepted here. At most 20 cards an hour for one key. Requires the key scope `fleet:fuel_cards:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The fuel card that was added.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3b7e5a92-1c4d-4e68-9f03-7a2d8c6b1e45",
        "provider": "Aldrees",
        "label": "Truck 12 card",
        "last4": "4821",
        "state": "active",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "driver_uuid": null,
        "monthly_limit": "5000.00",
        "currency": "SAR",
        "expires_month": "2028-03",
        "row_version": 1,
        "created_at": "2026-05-12T09:20:00Z",
        "updated_at": "2026-05-12T09:20:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fuel-cards/{uuid}

يتطلب مفتاحًا Read a fuel card

Reads one of your company's fuel cards by its uuid. A card of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `fuel_cards:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The fuel card.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3b7e5a92-1c4d-4e68-9f03-7a2d8c6b1e45",
        "provider": "Aldrees",
        "label": "Truck 12 card",
        "last4": "4821",
        "state": "active",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "driver_uuid": null,
        "monthly_limit": "5000.00",
        "currency": "SAR",
        "expires_month": "2028-03",
        "row_version": 1,
        "created_at": "2026-05-12T09:20:00Z",
        "updated_at": "2026-05-12T09:20:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:30:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fuel-cards/{uuid}/assign

يتطلب مفتاحًا Change the holder of a fuel card

Changes who holds an active card: a vehicle, a driver or both by uuid, or neither to unassign it. Send the `row_version` you read; a card changed meanwhile answers 409. A stopped or lost card cannot change holder (422). Requires the key scope `fleet:fuel_cards:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The fuel card with its new holder.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3b7e5a92-1c4d-4e68-9f03-7a2d8c6b1e45",
        "provider": "Aldrees",
        "label": "Truck 12 card",
        "last4": "4821",
        "state": "active",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "driver_uuid": null,
        "monthly_limit": "5000.00",
        "currency": "SAR",
        "expires_month": "2028-03",
        "row_version": 1,
        "created_at": "2026-05-12T09:20:00Z",
        "updated_at": "2026-05-12T09:20:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fuel-cards/{uuid}/retire

يتطلب مفتاحًا Stop a fuel card or mark it lost

Stops an active card or marks it lost. It is final: the card keeps its history but never changes state or holder again, so `confirm` must be true. Send the `row_version` you read; a card changed meanwhile answers 409, and one already stopped or lost answers 422. Requires the key scope `fleet:fuel_cards:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The fuel card, now stopped or lost.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3b7e5a92-1c4d-4e68-9f03-7a2d8c6b1e45",
        "provider": "Aldrees",
        "label": "Truck 12 card",
        "last4": "4821",
        "state": "active",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "driver_uuid": null,
        "monthly_limit": "5000.00",
        "currency": "SAR",
        "expires_month": "2028-03",
        "row_version": 1,
        "created_at": "2026-05-12T09:20:00Z",
        "updated_at": "2026-05-12T09:20:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fuel-logs

يتطلب مفتاحًا List refuels

Lists your company's refuels, oldest first, one page at a time. Each carries the vehicle and branch by uuid, when it was filled, the litres, the amount in the currency, the odometer, whether the tank was filled, and the station. Receipts, the driver and who entered the refuel are never shown. Requires the key scope `fuel_logs:read`.

الترويسات

statusOnly refuels in this state: active or voided. Voided refuels are left out unless you ask for them.
vehicleOnly the refuels of this vehicle (its uuid).
branchOnly refuels of this branch (its uuid).
updated_sinceOnly refuels changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of refuels.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "5c2f9a14-8d3e-4b67-a1f0-6e4b7d9c2a58",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
            "target": "engine_tank",
            "filled_at": "2026-05-12T09:15:00Z",
            "litres": "120.50",
            "amount": "289.20",
            "currency": "SAR",
            "odometer_km": 184250,
            "is_full_tank": true,
            "station": "Al Rajhi Fuel Station",
            "card_uuid": "9a4c1d7e-3b52-4f08-b6a1-2d8e5c0f7a33",
            "voided_at": null,
            "created_at": "2026-05-12T09:20:00Z",
            "updated_at": "2026-05-12T09:20:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:30:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fuel-logs

يتطلب مفتاحًا Record a refuel

Records a refuel of the engine tank of one of your company's vehicles, as the panel does, with the same checks (not in the future, the litres range, the odometer order, no second refuel of the tank in the same minute) and the same review flags. A driver, a receipt, a compartment and a cargo tank load are not accepted here. Retry safely with the same Idempotency-Key. A refuel older than 45 days is refused. At most 120 refuels an hour for one key, 24 an hour for one vehicle and 2000 a day for one company. Requires the key scope `fleet:fuel_logs:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The refuel that was recorded.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5c2f9a14-8d3e-4b67-a1f0-6e4b7d9c2a58",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "target": "engine_tank",
        "filled_at": "2026-05-12T09:15:00Z",
        "litres": "120.50",
        "amount": "289.20",
        "currency": "SAR",
        "odometer_km": 184250,
        "is_full_tank": true,
        "station": "Al Rajhi Fuel Station",
        "card_uuid": "9a4c1d7e-3b52-4f08-b6a1-2d8e5c0f7a33",
        "voided_at": null,
        "created_at": "2026-05-12T09:20:00Z",
        "updated_at": "2026-05-12T09:20:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fuel-logs/{uuid}

يتطلب مفتاحًا Read a refuel

Reads one of your company's refuels by its uuid. A record of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `fuel_logs:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The refuel.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5c2f9a14-8d3e-4b67-a1f0-6e4b7d9c2a58",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "target": "engine_tank",
        "filled_at": "2026-05-12T09:15:00Z",
        "litres": "120.50",
        "amount": "289.20",
        "currency": "SAR",
        "odometer_km": 184250,
        "is_full_tank": true,
        "station": "Al Rajhi Fuel Station",
        "card_uuid": "9a4c1d7e-3b52-4f08-b6a1-2d8e5c0f7a33",
        "voided_at": null,
        "created_at": "2026-05-12T09:20:00Z",
        "updated_at": "2026-05-12T09:20:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:30:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fuel-log-reviews

يتطلب مفتاحًا List refuel reviews

Lists the refuels the checks flagged for review, newest first, one page at a time; the open ones unless you name a state or an outcome. Requires the key scope `fleet:fuel_reviews:write` and an owner who may review refuels. Requires the key scope `fleet:fuel_reviews:write`.

الترويسات

stateopen (default), follow_up or reviewed.
outcomecorrect, entry_error or follow_up.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of reviews.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "9e2b7c14-6d3a-4a58-8b01-4f7c2d9e6a30",
            "fuel_log_uuid": "1a7d3c52-8e4b-4f09-b6a2-5c0d9e1f7b84",
            "reasons": [
                {
                    "code": "over_tank",
                    "values": {
                        "litres": 80,
                        "tank_litres": 60
                    }
                }
            ],
            "state": "open",
            "outcome": null,
            "flagged_at": "2026-11-17T08:00:00Z",
            "reviewed_at": null,
            "row_version": 1
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-17T09:00:00Z"
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fuel-log-reviews/{uuid}/review

يتطلب مفتاحًا Answer a refuel review

Answers the review of a flagged refuel with an outcome and a note, as the panel does. A stale `row_version` or a review already answered gives 409. The refuel itself is never changed. Requires the key scope `fleet:fuel_reviews:write`, an owner who may review refuels and who did not enter the refuel, and an `Idempotency-Key` header. Requires the key scope `fleet:fuel_reviews:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The review, now answered.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "9e2b7c14-6d3a-4a58-8b01-4f7c2d9e6a30",
        "fuel_log_uuid": "1a7d3c52-8e4b-4f09-b6a2-5c0d9e1f7b84",
        "reasons": [
            {
                "code": "over_tank",
                "values": {
                    "litres": 80,
                    "tank_litres": 60
                }
            }
        ],
        "state": "reviewed",
        "outcome": "correct",
        "flagged_at": "2026-11-17T08:00:00Z",
        "reviewed_at": null,
        "row_version": 2
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-17T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fuel-logs/{uuid}/void

يتطلب مفتاحًا Void a refuel

Voids an engine-tank refuel with a reason of ten to five hundred characters, as the panel does; the voided refuel stays in the record and no longer counts, and your company's fuel managers are told. A cargo tank load is voided in the panel only (422). Send the `row_version` you read; a refuel changed meanwhile answers 409, and one already voided answers 422. The voids of one key and of one company in a day are capped by governed settings. Requires the key scope `fleet:fuel_logs:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The refuel, now voided.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5c2f9a14-8d3e-4b67-a1f0-6e4b7d9c2a58",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "target": "engine_tank",
        "filled_at": "2026-05-12T09:15:00Z",
        "litres": "120.50",
        "amount": "289.20",
        "currency": "SAR",
        "odometer_km": 184250,
        "is_full_tank": true,
        "station": "Al Rajhi Fuel Station",
        "card_uuid": "9a4c1d7e-3b52-4f08-b6a1-2d8e5c0f7a33",
        "voided_at": null,
        "created_at": "2026-05-12T09:20:00Z",
        "updated_at": "2026-05-12T09:20:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fuel-prices

يتطلب مفتاحًا List fuel prices

Lists the price of a litre of fuel your company recorded for itself, by fuel type and the day it starts, oldest first, one page at a time. The official prices and the notes are not part of this list. Requires the key scope `fuel_prices:read`.

الترويسات

updated_sinceOnly prices recorded at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of fuel prices.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "9d4e2b61-3a7c-4f58-b0e9-1c6a8d5f7e32",
            "fuel_type_code": "diesel",
            "price_minor": 166,
            "currency": "SAR",
            "effective_from": "2026-05-01",
            "created_at": "2026-05-01T08:00:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:30:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fuel-prices/{uuid}

يتطلب مفتاحًا Read a fuel price

Reads one fuel price your company recorded, by its uuid. A record of another company answers 404 exactly like one that does not exist. Requires the key scope `fuel_prices:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The fuel price.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "9d4e2b61-3a7c-4f58-b0e9-1c6a8d5f7e32",
        "fuel_type_code": "diesel",
        "price_minor": 166,
        "currency": "SAR",
        "effective_from": "2026-05-01",
        "created_at": "2026-05-01T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:30:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /reports/fuel

يتطلب مفتاحًا Read the fuel report

Lists, for each of your vehicles that refuelled in the period, the refuels, the litres, the distance and the consumption. A key whose owner may see fuel costs also gets the amounts paid, one line per currency, the fuel cost per kilometre (the average price paid per litre times the litres burned per km, in the one currency paid, never from the estimate) and a separate estimate for the refuels that carry no amount, valued at the price list of the day; the estimate is never part of the amounts. The period is required and at most 366 days. Never a driver. Requires the key scope `reporting:reports_fuel:read`.

الترويسات

fromStart of the period, ISO 8601 with an offset.
toEnd of the period, after from and at most 366 days later.
vehicleOnly this vehicle (its uuid).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 One page of vehicles that refuelled in the period; the amount fields appear only for a key whose owner may see fuel costs.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "vehicle_uuid": "7c1d2e44-5b6a-4f0e-9a3b-1d2c3e4f5a66",
            "plate": "ABC 1234",
            "refuels": 6,
            "litres": 412.5,
            "distance_km": 3120,
            "litres_per_100km": 13.2,
            "consumption_source": "receipts",
            "rated_litres_per_100km": null,
            "trip_distance_km": null,
            "expected_litres": null
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /geofences

يتطلب مفتاحًا List geofences

Lists your company's geofences, oldest first, one page at a time, each with its current shape: a circle (centre and radius), a polygon (its vertices) or a corridor (its route as vertices, radius_m as its width on each side, and its own stop, fuel-drop, planned-stop and active-window limits; empty for the other shapes). Times are UTC; meta.timezone names the platform time zone. Requires the key scope `geofences:read`.

الترويسات

statusOnly geofences in this state: active, paused or retired.
updated_sinceOnly geofences changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of geofences.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "4d2a6e91-7b35-4c08-9f1e-3a8c5d0b2e99",
            "name": {
                "ar": "مستودع الرياض",
                "en": "Riyadh depot"
            },
            "status": "active",
            "shape": "circle",
            "center_latitude": 24.7136,
            "center_longitude": 46.6753,
            "radius_m": 500,
            "vertices": [],
            "dwell_limit_minutes": 60,
            "stop_limit_minutes": null,
            "gps_tolerance_m": null,
            "fuel_drop_percent": null,
            "fuel_drop_litres": null,
            "planned_stops": [],
            "active_from": null,
            "active_until": null,
            "group": null,
            "events_enabled": false,
            "scope": {
                "kind": "all",
                "vehicle_uuids": []
            },
            "version": 3,
            "row_version": 3,
            "created_at": "2026-03-01T08:30:00Z",
            "updated_at": "2026-05-12T11:05:42Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /geofences

يتطلب مفتاحًا Create a geofence

Creates a geofence for your company: a circle (centre and radius), a polygon (its vertices) or a corridor (its route as vertices, radius_m as its width on each side, and its own limits). It watches all your vehicles unless you send scope: kind all, refrigerated, or vehicles with vehicle_uuids. Send an Idempotency-Key header. Plan limits and the shape rules are the same as in the portal. Answers 403 for a key limited to one branch. Requires the key scope `compliance:geofences:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The new geofence; its row_version is the token for the next change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "4d2a6e91-7b35-4c08-9f1e-3a8c5d0b2e99",
        "name": {
            "ar": "مستودع الرياض",
            "en": "Riyadh depot"
        },
        "status": "active",
        "shape": "circle",
        "center_latitude": 24.7136,
        "center_longitude": 46.6753,
        "radius_m": 500,
        "vertices": [],
        "dwell_limit_minutes": 60,
        "stop_limit_minutes": null,
        "gps_tolerance_m": null,
        "fuel_drop_percent": null,
        "fuel_drop_litres": null,
        "planned_stops": [],
        "active_from": null,
        "active_until": null,
        "group": null,
        "events_enabled": false,
        "scope": {
            "kind": "all",
            "vehicle_uuids": []
        },
        "version": 3,
        "row_version": 1,
        "created_at": "2026-03-01T08:30:00Z",
        "updated_at": "2026-05-12T11:05:42Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /geofences/{uuid}

يتطلب مفتاحًا Read a geofence

Reads one of your company's geofences by its uuid, with its current shape. A geofence of another company answers 404 exactly like one that does not exist. Requires the key scope `geofences:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The geofence.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "4d2a6e91-7b35-4c08-9f1e-3a8c5d0b2e99",
        "name": {
            "ar": "مستودع الرياض",
            "en": "Riyadh depot"
        },
        "status": "active",
        "shape": "circle",
        "center_latitude": 24.7136,
        "center_longitude": 46.6753,
        "radius_m": 500,
        "vertices": [],
        "dwell_limit_minutes": 60,
        "stop_limit_minutes": null,
        "gps_tolerance_m": null,
        "fuel_drop_percent": null,
        "fuel_drop_litres": null,
        "planned_stops": [],
        "active_from": null,
        "active_until": null,
        "group": null,
        "events_enabled": false,
        "scope": {
            "kind": "all",
            "vehicle_uuids": []
        },
        "version": 3,
        "row_version": 3,
        "created_at": "2026-03-01T08:30:00Z",
        "updated_at": "2026-05-12T11:05:42Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

PUT /geofences/{uuid}

يتطلب مفتاحًا Replace a geofence

Replaces the name and shape of one of your geofences with the body, as a new version: anything you leave out is cleared. Without scope the vehicles it watches stay as they are; without group its group stays. Send the row_version you read and an Idempotency-Key header; a stale row_version answers 409. A retired geofence never changes again. A geofence of another company answers 404 exactly like one that does not exist. Requires the key scope `compliance:geofences:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The geofence with its new row_version.
مثال
{
    "success": true,
    "data": {
        "uuid": "4d2a6e91-7b35-4c08-9f1e-3a8c5d0b2e99",
        "name": {
            "ar": "مستودع الرياض",
            "en": "Riyadh depot"
        },
        "status": "active",
        "shape": "circle",
        "center_latitude": 24.7136,
        "center_longitude": 46.6753,
        "radius_m": 500,
        "vertices": [],
        "dwell_limit_minutes": 60,
        "stop_limit_minutes": null,
        "gps_tolerance_m": null,
        "fuel_drop_percent": null,
        "fuel_drop_litres": null,
        "planned_stops": [],
        "active_from": null,
        "active_until": null,
        "group": null,
        "events_enabled": false,
        "scope": {
            "kind": "all",
            "vehicle_uuids": []
        },
        "version": 3,
        "row_version": 4,
        "created_at": "2026-03-01T08:30:00Z",
        "updated_at": "2026-05-12T11:05:42Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /geofence-visits

يتطلب مفتاحًا List geofence visits

Lists the stays of your company's vehicles in its geofences, oldest first, one page at a time; each carries the geofence, the vehicle and the driver by uuid and when it began and ended (exited_at is null while the vehicle is inside), under an opaque ref. A branch-limited key sees only its own branch. Times are UTC; meta.timezone names the platform time zone. Requires the key scope `geofences:read`.

الترويسات

statusOnly visits still open (open) or already ended (closed).
geofenceOnly the visits to this geofence (its uuid).
vehicleOnly the visits of this vehicle (its uuid).
branchOnly visits of this branch (its uuid).
entered_sinceOnly visits that began at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of geofence visits.
مثال
{
    "success": true,
    "data": [
        {
            "ref": "Zk3Q8vTn0aXy7mP2cLw9dA",
            "geofence_uuid": "4d2a6e91-7b35-4c08-9f1e-3a8c5d0b2e99",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "driver_uuid": null,
            "entered_at": "2026-06-01T08:15:00Z",
            "exited_at": "2026-06-01T09:40:12Z",
            "dwell_exceeded": false,
            "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable: the platform has no public-id key configured; the visit calls refuse until its operator sets it.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "service_unavailable",
        "message": "The service is temporarily unavailable. Retry later."
    },
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /geofence-visits/{ref}

يتطلب مفتاحًا Read a geofence visit

Reads one stay of your company's vehicles in a geofence by its ref. A visit of another company or branch and an unknown ref answer 404. Requires the key scope `geofences:read`.

الترويسات

ref
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The geofence visit.
مثال
{
    "success": true,
    "data": {
        "ref": "Zk3Q8vTn0aXy7mP2cLw9dA",
        "geofence_uuid": "4d2a6e91-7b35-4c08-9f1e-3a8c5d0b2e99",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "driver_uuid": null,
        "entered_at": "2026-06-01T08:15:00Z",
        "exited_at": "2026-06-01T09:40:12Z",
        "dwell_exceeded": false,
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable: the platform has no public-id key configured; the visit calls refuse until its operator sets it.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "service_unavailable",
        "message": "The service is temporarily unavailable. Retry later."
    },
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /geofences/import

يتطلب مفتاحًا Import geofences

Creates up to 50 geofences in one call, all or nothing, with the plan and company limits of the portal, whose import is also a direct creation by a manager. With dry_run true nothing is written and each zone gets its verdict. All zones share the optional scope. One key creates at most 500 zones a day by import. Send an Idempotency-Key header. Answers 403 for a key limited to one branch. Requires the key scope `compliance:geofences:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The verdict of each zone (dry_run true) or the number created.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "dry_run": true,
        "ready": 1,
        "refused": 0,
        "zones": [
            {
                "position": 1,
                "ready": true,
                "reason": null
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /geofences/{uuid}/status

يتطلب مفتاحًا Change the state of a geofence

Pauses (paused), resumes (active) or retires (retired) one of your geofences. Retiring is final: a retired geofence cannot be resumed. Send the row_version you read and an Idempotency-Key header; a stale row_version answers 409. A geofence of another company answers 404. Requires the key scope `compliance:geofences:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The geofence with its new state and row_version.
مثال
{
    "success": true,
    "data": {
        "uuid": "4d2a6e91-7b35-4c08-9f1e-3a8c5d0b2e99",
        "name": {
            "ar": "مستودع الرياض",
            "en": "Riyadh depot"
        },
        "status": "paused",
        "shape": "circle",
        "center_latitude": 24.7136,
        "center_longitude": 46.6753,
        "radius_m": 500,
        "vertices": [],
        "dwell_limit_minutes": 60,
        "stop_limit_minutes": null,
        "gps_tolerance_m": null,
        "fuel_drop_percent": null,
        "fuel_drop_litres": null,
        "planned_stops": [],
        "active_from": null,
        "active_until": null,
        "group": null,
        "events_enabled": false,
        "scope": {
            "kind": "all",
            "vehicle_uuids": []
        },
        "version": 3,
        "row_version": 5,
        "created_at": "2026-03-01T08:30:00Z",
        "updated_at": "2026-05-12T11:05:42Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /geofences/{uuid}/group

يتطلب مفتاحًا Change the group of a geofence

Puts one of your geofences into a group, or out of every group with group null: a label only, so the shape keeps its version. Send the row_version you read and an Idempotency-Key header; a stale row_version answers 409. A retired geofence cannot change. Requires the key scope `compliance:geofences:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The geofence with its new group and row_version.
مثال
{
    "success": true,
    "data": {
        "uuid": "4d2a6e91-7b35-4c08-9f1e-3a8c5d0b2e99",
        "name": {
            "ar": "مستودع الرياض",
            "en": "Riyadh depot"
        },
        "status": "active",
        "shape": "circle",
        "center_latitude": 24.7136,
        "center_longitude": 46.6753,
        "radius_m": 500,
        "vertices": [],
        "dwell_limit_minutes": 60,
        "stop_limit_minutes": null,
        "gps_tolerance_m": null,
        "fuel_drop_percent": null,
        "fuel_drop_litres": null,
        "planned_stops": [],
        "active_from": null,
        "active_until": null,
        "group": "Riyadh",
        "events_enabled": false,
        "scope": {
            "kind": "all",
            "vehicle_uuids": []
        },
        "version": 3,
        "row_version": 6,
        "created_at": "2026-03-01T08:30:00Z",
        "updated_at": "2026-05-12T11:05:42Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /geofences/{uuid}/events

يتطلب مفتاحًا Switch the events of a geofence

Switches the entry and exit events of one of your geofences on or off for your company's webhooks and notices; the same rules and plan limits as the portal apply. Send the row_version you read and an Idempotency-Key header; a stale row_version answers 409. A retired geofence cannot change. Requires the key scope `compliance:geofences:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The geofence with its events flag and row_version.
مثال
{
    "success": true,
    "data": {
        "uuid": "4d2a6e91-7b35-4c08-9f1e-3a8c5d0b2e99",
        "name": {
            "ar": "مستودع الرياض",
            "en": "Riyadh depot"
        },
        "status": "active",
        "shape": "circle",
        "center_latitude": 24.7136,
        "center_longitude": 46.6753,
        "radius_m": 500,
        "vertices": [],
        "dwell_limit_minutes": 60,
        "stop_limit_minutes": null,
        "gps_tolerance_m": null,
        "fuel_drop_percent": null,
        "fuel_drop_litres": null,
        "planned_stops": [],
        "active_from": null,
        "active_until": null,
        "group": null,
        "events_enabled": true,
        "scope": {
            "kind": "all",
            "vehicle_uuids": []
        },
        "version": 3,
        "row_version": 7,
        "created_at": "2026-03-01T08:30:00Z",
        "updated_at": "2026-05-12T11:05:42Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /handover-records

يتطلب مفتاحًا List vehicle handover records

Lists the records of a vehicle passing from one main driver to the next, newest first, one page at a time (at most 100). A row names the vehicle and the two drivers by uuid, where the record stands, the fuel level, the inspection result and the two confirmations as time and channel; never a name, a note, a finding or who made it. A record whose vehicle or driver is outside the key owner's branch or rights is left out. Requires the key scope `fleet:handover_records:read`. Requires the key scope `fleet:handover_records:read`.

الترويسات

vehicleOnly this vehicle (its uuid).
driverOnly records where this driver hands over or receives (its uuid).
stateOnly records in this state: awaiting_inspection, awaiting_outgoing, awaiting_incoming or complete.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of handover records.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "6d1c0b7e-52f4-4c58-8a0e-3f6a9b2d7c10",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "outgoing_driver_uuid": "3c1e9a52-8d47-4b6a-a2f0-5e7d9b4c1a44",
            "incoming_driver_uuid": "8a2f4c10-1b3d-4e5f-9a6b-7c8d9e0f1a22",
            "opened_at": "2026-03-01T08:30:00Z",
            "state": "complete",
            "fuel_level": "half",
            "inspection_result": "ok",
            "outgoing_confirmed_at": "2026-03-01T09:00:00Z",
            "outgoing_channel": "app",
            "incoming_confirmed_at": "2026-03-01T09:10:00Z",
            "incoming_channel": "app"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /health

دون مفتاح Check that the API is up

Answers 200 with status "up" while the service runs. Needs no token and returns no version, environment or data; use it for uptime monitoring.

الترويسات

X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The API is up.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "status": "up"
    },
    "error": null,
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-10-18T09:00:00Z"
    }
}
429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /roadside/hints

يتطلب مفتاحًا List the reasons to open a roadside case

Lists what the platform already knows that justifies a roadside case for one of your vehicles: an open critical defect, a recent accident, a breakdown the market reported, a long standstill. A reason that already has a case is not listed again. Each carries its type, the symptom, the help it needs when known and a short plain label; nothing else. Each kind needs its own read scope on the key (`defects:read` for a defect, `trips:read` for a standstill, `alerts:read` for an accident) and the owner's own right to that kind; a market breakdown is not offered here. A vehicle of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `assistance:cases:read`.

الترويسات

vehicle_uuidThe vehicle whose reasons to read.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The reasons, possibly none.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "type": "critical_defect",
            "symptom": "other",
            "need": null,
            "label": "A critical defect is open on this vehicle."
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /reports/impact

يتطلب مفتاحًا Read the impact report

The change the platform made over a period against a baseline period (the same length before it, unless you give one): fuel per 100 km, idling, driving events, roadside help and the fuel saved, metric by metric, each with its evidence or the named reason it is not available. The maintenance cost, the camera metrics and the money of the fuel saved appear only for a key whose owner holds the matching right. The period is required and at most 366 days. Never a driver. Requires the key scope `reporting:reports_impact:read`.

الترويسات

fromStart of the period, ISO 8601 with an offset.
toEnd of the period, after from and at most 366 days later.
baseline_fromStart of the baseline period; give it with baseline_to or neither.
baseline_toEnd of the baseline period.
vehicleOnly this vehicle (its uuid).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The period against its baseline, one entry per metric; a metric the plan or the key owner's rights do not cover is absent.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "period": {
            "from": "2026-05-01T00:00:00Z",
            "to": "2026-06-01T00:00:00Z"
        },
        "vehicles": 24,
        "metrics": [
            {
                "key": "fuel_per_100_km",
                "unit": "l/100km",
                "period": {
                    "value": 12.4,
                    "gap": null,
                    "evidence": 18200
                },
                "baseline": {
                    "value": 13.1,
                    "gap": null,
                    "evidence": 17650
                },
                "change_percent": -5.3,
                "improved": true
            }
        ],
        "fuel_saved_litres": 1280,
        "baseline": {
            "from": "2026-04-01T00:00:00Z",
            "to": "2026-05-01T00:00:00Z"
        }
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /incomes

يتطلب مفتاحًا List incomes

Lists your company's vehicle incomes, oldest first, one page at a time. Each carries the vehicle and branch by uuid, type, date, amount in minor units, payer and reference, which are free text as your staff typed them; notes and attached files are never shown. A branch-limited key sees only the incomes recorded under its own branch: the other record types follow the vehicle's current branch, so when a vehicle moves its old incomes stay with the old branch. Requires the key scope `incomes:read`.

الترويسات

statusOnly incomes in this state: active or voided. Voided incomes are left out unless you ask for them.
vehicleOnly the vehicle incomes of this vehicle (its uuid).
branchOnly incomes of this branch (its uuid).
updated_sinceOnly vehicle incomes changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of vehicle incomes.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "7e1c4a92-3d58-4f06-a9b3-2b6d8e0f5c14",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
            "income_type_code": "rental",
            "earned_on": "2026-05-12",
            "amount_minor": 34250,
            "currency": "SAR",
            "payer": "Al Noor Rentals",
            "reference": "RCPT-20481",
            "voided_at": null,
            "created_at": "2026-05-12T12:00:00Z",
            "updated_at": "2026-05-12T12:00:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /incomes

يتطلب مفتاحًا Record a vehicle income

Records an income on one of your company's vehicles, as the panel does: its type, the day it was spent (not in the future), the amount in minor units and the supplier, reference and note. The company's rules apply exactly as in the panel. A driver and a file cannot be sent. Send an Idempotency-Key header so a retry does not record it twice. Requires the key scope `fleet:incomes:write`. Requires the key scope `fleet:incomes:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The income that was recorded.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7e1c4a92-3d58-4f06-a9b3-2b6d8e0f5c14",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "income_type_code": "rental",
        "earned_on": "2026-05-12",
        "amount_minor": 34250,
        "currency": "SAR",
        "payer": "Al Noor Rentals",
        "reference": "RCPT-20481",
        "voided_at": null,
        "created_at": "2026-05-12T12:00:00Z",
        "updated_at": "2026-05-12T12:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /incomes/{uuid}

يتطلب مفتاحًا Read an income

Reads one of your company's vehicle incomes by its uuid. A record of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `incomes:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The income.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7e1c4a92-3d58-4f06-a9b3-2b6d8e0f5c14",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "income_type_code": "rental",
        "earned_on": "2026-05-12",
        "amount_minor": 34250,
        "currency": "SAR",
        "payer": "Al Noor Rentals",
        "reference": "RCPT-20481",
        "voided_at": null,
        "created_at": "2026-05-12T12:00:00Z",
        "updated_at": "2026-05-12T12:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /incomes/{uuid}/void

يتطلب مفتاحًا Void a vehicle income

Voids an income of your company with a reason of at least ten characters; the row stays, frozen, and is shown as voided. Send the `row_version` you read: an income changed meanwhile answers 409. Requires the key scope `fleet:incomes:write`. Requires the key scope `fleet:incomes:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The income, now voided.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7e1c4a92-3d58-4f06-a9b3-2b6d8e0f5c14",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "income_type_code": "rental",
        "earned_on": "2026-05-12",
        "amount_minor": 34250,
        "currency": "SAR",
        "payer": "Al Noor Rentals",
        "reference": "RCPT-20481",
        "voided_at": null,
        "created_at": "2026-05-12T12:00:00Z",
        "updated_at": "2026-05-12T12:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /telemetry/ingest

يتطلب مفتاحًا Send vehicle observations

Stores one batch of readings from your tracking platform. A 202 means the batch is stored, not yet placed on a vehicle: matching to vehicles and checks run afterwards, and readings for an unknown device wait for review. Each observation names its vehicle by imei or vehicle_external_id and its time by observed_at (ISO 8601 UTC) or observed_at_epoch_ms. An empty batch or one larger than your agreed size answers 422 batch_too_large; invalid fields answer 422 validation_failed with one detail per field; a body over the size limit answers 413 payload_too_large. Send in batches: each source key may make a limited number of requests a minute (120 by default) and each IP address another (300 by default, shared by all your keys from it), so one reading per request is soon refused with 429. Collect the readings of every vehicle and send one batch every 15 seconds, or when it reaches your batch size (500 readings by default), whichever comes first. Requires a source token with the ability `telemetry:ingest`.

الترويسات

Idempotency-KeyOptional; up to 100 of A-Z a-z 0-9 . _ : -. The same key with the same body answers 200 with duplicate true; with a different body, 409 idempotency_conflict.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

جسم الطلب

batch_idاختياريOptional id of this batch in your system.
observationsمطلوبOne or more readings. Fields: imei or vehicle_external_id; observed_at or observed_at_epoch_ms; latitude, longitude and speed (required); optional heading, speed_unit (kmh, knots, mph), ignition, gps_valid (false: the receiver reports the fix invalid; it is kept but never sent), weight_kg, weight_mv, temperature_c, humidity_pct, fuel_level_pct, driver_external_id, event_id, native_event_code.
مثال
{
    "batch_id": "batch-2026-10-18-0001",
    "observations": [
        {
            "imei": "000000000000000",
            "observed_at": "2026-10-18T09:00:00Z",
            "latitude": 24.7136,
            "longitude": 46.6753,
            "speed": 62.5,
            "speed_unit": "kmh",
            "heading": 270,
            "ignition": true
        }
    ]
}

الردود

200 The same batch was already stored; nothing new is written.
مثال
{
    "success": true,
    "data": {
        "receipt_id": "00000000-0000-4000-8000-000000000001",
        "idempotency_key": "batch-2026-10-18-0001",
        "item_count": 1,
        "duplicate": true,
        "received_at": "2026-10-18T09:00:01.000Z",
        "units": {
            "speed": null,
            "confirmed": false
        }
    },
    "error": null,
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-10-18T09:05:00Z"
    }
}
202 The batch is stored.
مثال
{
    "success": true,
    "data": {
        "receipt_id": "00000000-0000-4000-8000-000000000001",
        "idempotency_key": "batch-2026-10-18-0001",
        "item_count": 1,
        "duplicate": false,
        "received_at": "2026-10-18T09:00:01.000Z",
        "units": {
            "speed": null,
            "confirmed": false
        }
    },
    "error": null,
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-10-18T09:00:01Z"
    }
}
401 unauthenticated: the source token is missing, expired or revoked.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "unauthenticated",
        "message": "Authentication is required."
    },
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-10-18T09:00:01Z"
    }
}
409 idempotency_conflict: the Idempotency-Key was already used with a different body.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "idempotency_conflict",
        "message": "The idempotency key was already used with a different body."
    },
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-10-18T09:00:01Z"
    }
}
413 payload_too_large: the request body is over the size limit.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "payload_too_large",
        "message": "The request body is too large."
    },
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-10-18T09:00:01Z"
    }
}
415 unsupported_media_type: send Content-Type application/json.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "unsupported_media_type",
        "message": "The request body must be application/json."
    },
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-10-18T09:00:01Z"
    }
}
422 validation_failed (one detail per invalid field) or batch_too_large.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "validation_failed",
        "message": "The request contains invalid fields.",
        "details": [
            {
                "field": "observations.0.latitude",
                "code": "out_of_range",
                "message": "This value is out of range."
            }
        ]
    },
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-10-18T09:00:01Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /inspections

يتطلب مفتاحًا List inspections

Lists your company's vehicle inspections, oldest first, one page at a time. Each carries the vehicle and driver by uuid, when it was done, the odometer and the result; inspectors' notes are never shown. A branch-limited key sees only the inspections of the vehicles that are currently in its branch. Requires the key scope `inspections:read`.

الترويسات

statusOnly inspections with this result: passed, passed_with_findings or failed.
vehicleOnly the vehicle inspections of this vehicle (its uuid).
updated_sinceOnly vehicle inspections changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of vehicle inspections.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "4e2b7c10-9a35-4d68-b1f4-2c8a6e0d5b77",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "driver_uuid": "3c1e9a52-8d47-4b6a-a2f0-5e7d9b4c1a44",
            "result": "passed_with_findings",
            "odometer_km": 125340.5,
            "performed_at": "2026-05-12T07:45:00Z",
            "created_at": "2026-05-12T07:50:12Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /inspections/{uuid}

يتطلب مفتاحًا Read an inspection

Reads one of your company's vehicle inspections by its uuid. A record of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `inspections:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The inspection.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "4e2b7c10-9a35-4d68-b1f4-2c8a6e0d5b77",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "driver_uuid": "3c1e9a52-8d47-4b6a-a2f0-5e7d9b4c1a44",
        "result": "passed_with_findings",
        "odometer_km": 125340.5,
        "performed_at": "2026-05-12T07:45:00Z",
        "created_at": "2026-05-12T07:50:12Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /inspections/schedules

يتطلب مفتاحًا List inspection schedules

Lists your company's inspection schedules («this checklist every N days» for a vehicle), oldest first, one page at a time. Each carries the vehicle by uuid, the checklist by its code (a ready one) or uuid (your own), the interval in days, the status, and for an active schedule where the next inspection stands: ok, due_soon or overdue. A branch-limited key sees only the schedules of the vehicles that are currently in its branch. Requires the key scope `inspections:read`.

الترويسات

statusOnly schedules with this status: active, paused or retired. Retired ones are listed only when asked for.
vehicleOnly the schedules of this vehicle (its uuid).
updated_sinceOnly schedules changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of inspection schedules.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "6d2f8b13-7a54-4c90-8e21-1b3c5d7e9f02",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "checklist_code": "pre_trip",
            "checklist_uuid": null,
            "every_days": 30,
            "baseline_on": "2026-05-01",
            "status": "active",
            "state": "ok",
            "last_inspection_on": "2026-05-12",
            "next_inspection_on": "2026-06-11",
            "created_at": "2026-05-01T08:00:00Z",
            "updated_at": "2026-05-12T09:10:00Z",
            "row_version": 2
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /inspections/schedules

يتطلب مفتاحًا Create an inspection schedule

Schedules a checklist on one of your company's vehicles every N days, as the panel does: the vehicle by uuid, the checklist by `checklist_code` (a ready one, from the inspection templates) or `checklist_uuid` (one of your own, never both), and `every_days`. The days count from the vehicle's last inspection with that checklist, or from today. A vehicle holds one live schedule per checklist. At most 20 schedules an hour for one vehicle. A vehicle of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `fleet:inspection_schedules:write` and an `Idempotency-Key` header. Requires the key scope `fleet:inspection_schedules:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The schedule that was created.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6d2f8b13-7a54-4c90-8e21-1b3c5d7e9f02",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "checklist_code": "pre_trip",
        "checklist_uuid": null,
        "every_days": 30,
        "baseline_on": "2026-05-01",
        "status": "active",
        "state": "ok",
        "last_inspection_on": "2026-05-12",
        "next_inspection_on": "2026-06-11",
        "created_at": "2026-05-01T08:00:00Z",
        "updated_at": "2026-05-12T09:10:00Z",
        "row_version": 2
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /inspections/schedules/{uuid}

يتطلب مفتاحًا Read an inspection schedule

Reads one of your company's inspection schedules by its uuid. A record of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `inspections:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The inspection schedule.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6d2f8b13-7a54-4c90-8e21-1b3c5d7e9f02",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "checklist_code": "pre_trip",
        "checklist_uuid": null,
        "every_days": 30,
        "baseline_on": "2026-05-01",
        "status": "active",
        "state": "ok",
        "last_inspection_on": "2026-05-12",
        "next_inspection_on": "2026-06-11",
        "created_at": "2026-05-01T08:00:00Z",
        "updated_at": "2026-05-12T09:10:00Z",
        "row_version": 2
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

PATCH /inspections/schedules/{uuid}

يتطلب مفتاحًا Change an inspection schedule

Changes the days between two inspections of a schedule that has not ended. Send the `row_version` you read: a schedule changed meanwhile or already ended answers 409. Requires the key scope `fleet:inspection_schedules:write` and an `Idempotency-Key` header. Requires the key scope `fleet:inspection_schedules:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The schedule after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6d2f8b13-7a54-4c90-8e21-1b3c5d7e9f02",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "checklist_code": "pre_trip",
        "checklist_uuid": null,
        "every_days": 30,
        "baseline_on": "2026-05-01",
        "status": "active",
        "state": "ok",
        "last_inspection_on": "2026-05-12",
        "next_inspection_on": "2026-06-11",
        "created_at": "2026-05-01T08:00:00Z",
        "updated_at": "2026-05-12T09:10:00Z",
        "row_version": 2
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /inspections/schedules/{uuid}/pause

يتطلب مفتاحًا Pause an inspection schedule

Stops an active schedule from raising notices until it is resumed. Send the `row_version` you read; a schedule that is already paused or ended answers 409. Requires the key scope `fleet:inspection_schedules:write` and an `Idempotency-Key` header. Requires the key scope `fleet:inspection_schedules:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The schedule, now paused.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6d2f8b13-7a54-4c90-8e21-1b3c5d7e9f02",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "checklist_code": "pre_trip",
        "checklist_uuid": null,
        "every_days": 30,
        "baseline_on": "2026-05-01",
        "status": "active",
        "state": "ok",
        "last_inspection_on": "2026-05-12",
        "next_inspection_on": "2026-06-11",
        "created_at": "2026-05-01T08:00:00Z",
        "updated_at": "2026-05-12T09:10:00Z",
        "row_version": 2
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /inspections/schedules/{uuid}/resume

يتطلب مفتاحًا Resume an inspection schedule

Makes a paused schedule active again. Send the `row_version` you read; a schedule that is already active or ended answers 409. Requires the key scope `fleet:inspection_schedules:write` and an `Idempotency-Key` header. Requires the key scope `fleet:inspection_schedules:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The schedule, now active.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6d2f8b13-7a54-4c90-8e21-1b3c5d7e9f02",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "checklist_code": "pre_trip",
        "checklist_uuid": null,
        "every_days": 30,
        "baseline_on": "2026-05-01",
        "status": "active",
        "state": "ok",
        "last_inspection_on": "2026-05-12",
        "next_inspection_on": "2026-06-11",
        "created_at": "2026-05-01T08:00:00Z",
        "updated_at": "2026-05-12T09:10:00Z",
        "row_version": 2
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /inspections/schedules/{uuid}/retire

يتطلب مفتاحًا End an inspection schedule

Ends a schedule for good: it stays in the record, sends no more notices and cannot be changed, paused or resumed afterwards. Send the `row_version` you read and `confirm` set to true. Requires the key scope `fleet:inspection_schedules:write` and an `Idempotency-Key` header. Requires the key scope `fleet:inspection_schedules:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The schedule, now ended.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6d2f8b13-7a54-4c90-8e21-1b3c5d7e9f02",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "checklist_code": "pre_trip",
        "checklist_uuid": null,
        "every_days": 30,
        "baseline_on": "2026-05-01",
        "status": "active",
        "state": "ok",
        "last_inspection_on": "2026-05-12",
        "next_inspection_on": "2026-06-11",
        "created_at": "2026-05-01T08:00:00Z",
        "updated_at": "2026-05-12T09:10:00Z",
        "row_version": 2
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /journeys

يتطلب مفتاحًا List journeys

Lists the closed journeys of your vehicles that began between from (included) and to (excluded), oldest first, at most 31 days at a time, one page at a time. A journey is named by its vehicle and its start time. A branch-limited key sees only its own branch. Times are UTC; meta.timezone names the platform time zone. Requires the key scope `positions:read`.

الترويسات

fromStart of the window, ISO 8601 with an offset (e.g. 2026-06-01T00:00:00Z); included.
toEnd of the window, after from and at most 31 days later; excluded.
vehicleOnly the journeys of this vehicle (its uuid).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of journeys.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "driver_uuid": "3c1e9a52-8d47-4b6a-a2f0-5e7d9b4c1a44",
            "started_at": "2026-06-01T05:10:00Z",
            "ended_at": "2026-06-01T07:42:30Z",
            "distance_m": 184200,
            "max_speed_kmh": 96,
            "idle_seconds": 420,
            "start_latitude": 24.7136,
            "start_longitude": 46.6753,
            "end_latitude": 26.4207,
            "end_longitude": 50.0888
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /leases

يتطلب مفتاحًا List vehicle leases

Lists the leases of your company's vehicles, one page at a time (at most 100): the vehicle by uuid, the lessor, the contract number, the dates, the monthly cost in minor units with its currency, and who looks after maintenance. Requires the key scope `fleet:leases:read`; money, so no app session carries it. Requires the key scope `fleet:leases:read`.

الترويسات

vehicleOnly this vehicle (its uuid).
activetrue for the leases running today.
ending_within_daysOnly leases that end within this many days from today (1 to 366).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of leases.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "6d2f8a14-3b7e-4c59-8a21-9e0c5d7b1f33",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "lessor_name": "Gulf Leasing Co.",
            "contract_number": "LS-2026-0412",
            "starts_on": "2026-01-01",
            "ends_on": "2028-12-31",
            "monthly_cost_minor": 450000,
            "currency": "SAR",
            "maintenance_responsibility": "lessor"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /leases/{uuid}

يتطلب مفتاحًا Read a vehicle lease

Reads one lease by its uuid. A lease of another company, outside the key owner's branch, or that does not exist answers 404 alike. Requires the key scope `fleet:leases:read`. Requires the key scope `fleet:leases:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The lease.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6d2f8a14-3b7e-4c59-8a21-9e0c5d7b1f33",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "lessor_name": "Gulf Leasing Co.",
        "contract_number": "LS-2026-0412",
        "starts_on": "2026-01-01",
        "ends_on": "2028-12-31",
        "monthly_cost_minor": 450000,
        "currency": "SAR",
        "maintenance_responsibility": "lessor"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

يتطلب مفتاحًا List legal operators

Lists the active legal operators of your company with the uuid that `legal_operator_uuid` takes when you register a vehicle; no other company's operator is ever shown. Requires the key scope `vehicles:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The active legal operators of the company.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "7a9c3d2e-1b44-4a6f-9c5d-6e8f0a1b2c33",
            "name": "شركة النقل المتحدة"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /licences

يتطلب مفتاحًا List licences

Lists your company's licences, oldest first, one page at a time. Each carries its type (a code of your company's licence types), issuer (free text as typed), holder by uuid and the issue date, expiry date and validity of its current version. The licence number, the evidence file and who registered it are never shown. Archived licences are not shown. A branch-limited key sees only its own branch. updated_since also lists a licence whose current version was renewed or amended, and updated_at then shows that moment; validity moves with the calendar (valid, then expiring, then expired) without any change to the record, so a client that syncs by updated_since should also read the licences it holds by expiry_date or ask with status=expiring or status=expired. Requires the key scope `licences:read`.

الترويسات

statusOnly licences whose current version has this validity: valid, expiring, expired, cancelled, suspended or unknown.
vehicleOnly the licences of this vehicle (its uuid).
branchOnly licences of this branch (its uuid).
updated_sinceOnly licences changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of licences.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "5b8e2d71-6c04-4a39-9e17-3f0a1d6c8b52",
            "licence_type": "vehicle_registration",
            "holder": "vehicle",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "driver_uuid": null,
            "operator_uuid": null,
            "issuer": "Traffic Department",
            "issue_date": "2025-03-01",
            "expiry_date": "2027-03-01",
            "validity": "valid",
            "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
            "created_at": "2025-03-02T08:00:00Z",
            "updated_at": "2025-03-02T08:00:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /licences/{uuid}

يتطلب مفتاحًا Read a licence

Reads one of your company's licences by its uuid. A licence of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `licences:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The licence.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5b8e2d71-6c04-4a39-9e17-3f0a1d6c8b52",
        "licence_type": "vehicle_registration",
        "holder": "vehicle",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "driver_uuid": null,
        "operator_uuid": null,
        "issuer": "Traffic Department",
        "issue_date": "2025-03-01",
        "expiry_date": "2027-03-01",
        "validity": "valid",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "created_at": "2025-03-02T08:00:00Z",
        "updated_at": "2025-03-02T08:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicles/{uuid}/lifecycle

يتطلب مفتاحًا Read a vehicle's lifecycle

The stages of one of your vehicles, oldest first. The deal and the note of a stage appear only when the key's owner holds the finance right, and are left out otherwise; the reading of them is recorded. A vehicle of another company or branch answers 404. Requires the key scope `lifecycle:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The stages.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "stages": [
            {
                "stage": "disposed",
                "occurred_on": "2026-11-10",
                "voided": false,
                "note": "Sold at auction",
                "deal": {
                    "kind": "sale",
                    "counterparty": "Example Trading Co",
                    "reference": "INV-77",
                    "amount_minor": 800000,
                    "currency": "SAR",
                    "book_value_minor": 720000
                }
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /vehicles/{uuid}/lifecycle

يتطلب مفتاحًا Record a lifecycle stage

Records the purchase or the in-service stage of one of your vehicles, as the vehicle page does, with the same rights and rules. A purchase may carry the seller, a reference and the price. A sale, a scrapping and a retirement are not accepted here. Needs the Idempotency-Key header. Requires the key scope `fleet:lifecycle:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The stage that was recorded.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "stage": "acquired",
        "occurred_on": "2026-01-15",
        "version": 1,
        "voided": false
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /fleet-assets/{uuid}/lifecycle

يتطلب مفتاحًا Read a fleet asset's lifecycle

The stages of one of your trailers or pieces of equipment, oldest first, with the same rules as a vehicle: the deal and the note appear only for an owner with the finance right and the reading of them is recorded. An asset of another company or branch answers 404. Requires the key scope `lifecycle:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The stages.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "asset_uuid": "9e2b7c14-3d58-4f0a-b6a1-7c4d2e8f5a10",
        "stages": [
            {
                "stage": "disposed",
                "occurred_on": "2026-11-10",
                "voided": false,
                "note": "Sold at auction",
                "deal": {
                    "kind": "sale",
                    "counterparty": "Example Trading Co",
                    "reference": "INV-77",
                    "amount_minor": 800000,
                    "currency": "SAR",
                    "book_value_minor": 720000
                }
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fleet-assets/{uuid}/lifecycle

يتطلب مفتاحًا Record a fleet asset lifecycle stage

Records the purchase or the in-service stage of one of your trailers or pieces of equipment, as its page does, with the same rights and rules. A sale, a scrapping and a retirement are not accepted here. Needs the Idempotency-Key header. Requires the key scope `fleet:lifecycle:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The stage that was recorded.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "stage": "acquired",
        "occurred_on": "2026-01-15",
        "version": 1,
        "voided": false
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /vehicles/{uuid}/lifecycle/void

يتطلب مفتاحًا Cancel the last lifecycle stage

Cancels the last stage of one of your vehicles when it is a purchase or an in-service stage, with the version you read and a written reason. The stage stays in the log. A sale, a scrapping or a retirement cannot be cancelled here. Needs the Idempotency-Key header. Requires the key scope `fleet:lifecycle:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The stage after it was cancelled.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "stage": "acquired",
        "occurred_on": "2026-01-15",
        "version": 2,
        "voided": true
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /fleet-assets/{uuid}/lifecycle/void

يتطلب مفتاحًا Cancel the last fleet asset lifecycle stage

Cancels the last stage of one of your trailers or pieces of equipment when it is a purchase or an in-service stage, with the version you read and a written reason. The stage stays in the log. Needs the Idempotency-Key header. Requires the key scope `fleet:lifecycle:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The stage after it was cancelled.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "stage": "acquired",
        "occurred_on": "2026-01-15",
        "version": 2,
        "voided": true
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /live-links

يتطلب مفتاحًا List live vehicle links

Lists your company's 24-hour live vehicle links, newest first, one page at a time: the link's uuid, the vehicle's uuid, when it was made and when it ends, and its state (live, ended or withdrawn). It never shows the link address, its token, a title or who opened it. A key limited to one branch sees none. Answers 404 while the live link feature is off. Requires the key scope `reporting:live_links:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of live links.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "0b6f6d0e-4a3e-4c52-9d51-8f0f6b3f4c11",
            "vehicle_uuid": "7c1c1f3e-2e0a-4a6e-8a39-5f6f1d2b9a10",
            "created_at": "2026-06-01T09:00:00Z",
            "expires_at": "2026-06-02T09:00:00Z",
            "state": "live"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /live-links/{uuid}/revoke

يتطلب مفتاحًا Withdraw a live vehicle link

Ends one of your company's live vehicle links at once; asking again for a link that is already withdrawn answers the same state and changes nothing. Send an Idempotency-Key header. A link of another company answers 404 exactly like one that does not exist. Answers 404 while the live link feature is off. Requires the key scope `reporting:live_links:revoke`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The link with its state.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "0b6f6d0e-4a3e-4c52-9d51-8f0f6b3f4c11",
        "vehicle_uuid": "7c1c1f3e-2e0a-4a6e-8a39-5f6f1d2b9a10",
        "created_at": "2026-06-01T09:00:00Z",
        "expires_at": "2026-06-02T09:00:00Z",
        "state": "withdrawn"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /maintenance/costs

يتطلب مفتاحًا Read the maintenance costs of each vehicle

Lists, for each of your vehicles with finished work orders in the period, the parts cost, the labour cost and their total in minor units of the currency, and the number of work orders; one line per vehicle and currency, never added across currencies. An order counts on the day it was finished; cancelled orders are left out. A key limited to a branch sees that branch's vehicles only. Never a driver, a workshop or an order text. The period is required and at most 366 days. Requires the key scope `fleet:maintenance_costs:read`, whose owner must still see maintenance costs on every call. Requires the key scope `fleet:maintenance_costs:read`.

الترويسات

fromStart of the period, ISO 8601 with an offset.
toEnd of the period, after from and at most 366 days later.
vehicleOnly this vehicle (its uuid).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of vehicle cost lines.
مثال
{
    "success": true,
    "data": [
        {
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "currency": "SAR",
            "work_orders": 2,
            "parts_cost_minor": 11050,
            "labour_cost_minor": 2525,
            "total_cost_minor": 13575
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /maintenance/plans

يتطلب مفتاحًا List maintenance plans

Lists your company's maintenance plans, oldest first, one page at a time. Each carries the vehicle, its name (free text as typed), the schedule by distance and days, its type and status. A branch-limited key sees only the plans of the vehicles that are currently in its branch. Requires the key scope `maintenance:read`.

الترويسات

statusOnly plans in this state: active, paused or retired. Retired plans are left out unless you ask for them.
vehicleOnly the maintenance plans of this vehicle (its uuid).
updated_sinceOnly maintenance plans changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of maintenance plans.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "2a7d9e41-5c63-4b18-9f20-8d1e4a6c3b99",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "name": {
                "ar": "تغيير الزيت",
                "en": "Oil change"
            },
            "plan_type": "preventive",
            "category_code": "oil_change",
            "every_km": 10000,
            "every_days": 180,
            "baseline_km": 120000,
            "baseline_at": "2026-01-15T00:00:00Z",
            "status": "active",
            "created_at": "2026-01-15T08:00:00Z",
            "updated_at": "2026-03-02T10:30:00Z",
            "row_version": 3
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/plans

يتطلب مفتاحًا Create a maintenance plan

Creates a repeating maintenance plan on one of your company's vehicles, as the panel does: a name in Arabic (English optional), the plan type and the interval in kilometres, days or hours, optionally the due-soon margins, the day and reading the cycle starts from, and a category code. A plan cannot be created from a template with a key. At most 20 plans an hour for one vehicle. A vehicle of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `fleet:plans:write` and an `Idempotency-Key` header. Requires the key scope `fleet:plans:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The plan that was created.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "2a7d9e41-5c63-4b18-9f20-8d1e4a6c3b99",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "name": {
            "ar": "تغيير الزيت",
            "en": "Oil change"
        },
        "plan_type": "preventive",
        "category_code": "oil_change",
        "every_km": 10000,
        "every_days": 180,
        "baseline_km": 120000,
        "baseline_at": "2026-01-15T00:00:00Z",
        "status": "active",
        "created_at": "2026-01-15T08:00:00Z",
        "updated_at": "2026-03-02T10:30:00Z",
        "row_version": 3
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /maintenance/plans/{uuid}

يتطلب مفتاحًا Read a maintenance plan

Reads one of your company's maintenance plans by its uuid. A record of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `maintenance:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The maintenance plan.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "2a7d9e41-5c63-4b18-9f20-8d1e4a6c3b99",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "name": {
            "ar": "تغيير الزيت",
            "en": "Oil change"
        },
        "plan_type": "preventive",
        "category_code": "oil_change",
        "every_km": 10000,
        "every_days": 180,
        "baseline_km": 120000,
        "baseline_at": "2026-01-15T00:00:00Z",
        "status": "active",
        "created_at": "2026-01-15T08:00:00Z",
        "updated_at": "2026-03-02T10:30:00Z",
        "row_version": 3
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

PATCH /maintenance/plans/{uuid}

يتطلب مفتاحًا Change a maintenance plan

Changes the terms of a plan that is not retired; what you leave out stays as it is. Send the `row_version` you read: a plan changed meanwhile or already retired answers 409. Requires the key scope `fleet:plans:write` and an `Idempotency-Key` header. Requires the key scope `fleet:plans:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The plan after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "2a7d9e41-5c63-4b18-9f20-8d1e4a6c3b99",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "name": {
            "ar": "تغيير الزيت",
            "en": "Oil change"
        },
        "plan_type": "preventive",
        "category_code": "oil_change",
        "every_km": 10000,
        "every_days": 180,
        "baseline_km": 120000,
        "baseline_at": "2026-01-15T00:00:00Z",
        "status": "active",
        "created_at": "2026-01-15T08:00:00Z",
        "updated_at": "2026-03-02T10:30:00Z",
        "row_version": 3
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /module-prices

يتطلب مفتاحًا List module prices

Lists the module price table in force today, the same one the website shows: one price for each module, fleet band and cadence, in halalas before VAT. A draft, a proposal and a price that starts later are never listed. Requires the key scope `commercial:module_plans:read`. Requires the key scope `commercial:module_plans:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 Every current price in one page; next_cursor is always null.
مثال
{
    "success": true,
    "data": [
        {
            "module_code": "tracking",
            "band": {
                "code": "b1",
                "min_vehicles": 1,
                "max_vehicles": 10
            },
            "cadence": "month",
            "unit": "per_vehicle",
            "amount_minor": 1500,
            "currency": "SAR",
            "effective_from": "2026-09-01"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /module-subscriptions

يتطلب مفتاحًا List module subscriptions

Lists your company's module subscriptions, one page at a time: the module, the fleet band, the quantity, the price frozen when it started, its state and its term. Ended subscriptions are left out unless you ask state=ended. Requires the key scope `commercial:module_plans:read` and an owner who may view subscriptions; nothing can be bought or changed over the API. Requires the key scope `commercial:module_plans:read`.

الترويسات

stateOnly subscriptions in this state: active, cancel_at_term_end or ended; without it, every subscription that has not ended.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 One page of subscriptions; next_cursor is null on the last page.
مثال
{
    "success": true,
    "data": [
        {
            "uuid": "0198c3a2-7d41-7b0e-9a55-3f6e1c2d8b47",
            "module_code": "tracking",
            "cadence": "month",
            "band": {
                "code": "b1",
                "min_vehicles": 1,
                "max_vehicles": 10
            },
            "unit": "per_vehicle",
            "quantity": 8,
            "unit_amount_minor": 1500,
            "currency": "SAR",
            "state": "active",
            "started_on": "2026-09-01",
            "term_start": "2026-11-01",
            "term_end": "2026-11-30",
            "ended_on": null
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /module-subscriptions/{uuid}

يتطلب مفتاحًا Read a module subscription

Reads one of your company's module subscriptions by its uuid. A subscription of another company and an unknown uuid both answer 404. Requires the key scope `commercial:module_plans:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The subscription.
مثال
{
    "success": true,
    "data": {
        "uuid": "0198c3a2-7d41-7b0e-9a55-3f6e1c2d8b47",
        "module_code": "tracking",
        "cadence": "month",
        "band": {
            "code": "b1",
            "min_vehicles": 1,
            "max_vehicles": 10
        },
        "unit": "per_vehicle",
        "quantity": 8,
        "unit_amount_minor": 1500,
        "currency": "SAR",
        "state": "active",
        "started_on": "2026-09-01",
        "term_start": "2026-11-01",
        "term_end": "2026-11-30",
        "ended_on": null
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /reports/monthly-pnl

يتطلب مفتاحًا Read the monthly profit and loss report

Lists, for each closed month the period touches (at most 24, never the month in progress), the revenue, the fuel, the expenses recorded by drivers, the total cost, the margin and its percent of the revenue. Money is a list of lines, one per currency, never added across currencies. A part the daily figures have not built for a month is null, never zero, and then that month has no margin. The revenue and what needs it are absent when the key's owner may not see the company's revenue. Requires the key scope `reporting:reports_monthly_pnl:read`.

الترويسات

fromStart of the period, ISO 8601 with an offset.
toEnd of the period, after from and at most 731 days later; its Saudi day is included.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The months, oldest first; meta.revenue_shown says whether the revenue is part of them.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "month": "2026-09",
            "revenue": [
                {
                    "currency": "SAR",
                    "amount": "210000.00"
                }
            ],
            "unpriced_orders": 2,
            "fuel": [
                {
                    "currency": "SAR",
                    "amount": "52000.00"
                }
            ],
            "expenses": [
                {
                    "currency": "SAR",
                    "amount": "9000.00"
                }
            ],
            "total_cost": [
                {
                    "currency": "SAR",
                    "amount": "61000.00"
                }
            ],
            "margin": [
                {
                    "currency": "SAR",
                    "amount": "149000.00"
                }
            ],
            "margin_percent": [
                {
                    "currency": "SAR",
                    "percent": "71.0"
                }
            ]
        }
    ],
    "meta": {
        "revenue_shown": true
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicles/nearest

يتطلب مفتاحًا List the vehicles nearest to a point

Lists up to 20 of your vehicles that the live map shows, nearest first in a straight line from a point you give in the X-Position header as "latitude,longitude" (kept out of the address on purpose): the vehicle uuid, name, plate, distance in kilometres, state (moving, idle, stopped or no_signal), speed and the time of its last fix. It shows no coordinates, no address and no driver. A key limited to one branch sees only that branch's vehicles. Requires the key scope `positions:read`.

الترويسات

lat
lng
signal_only
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The nearest vehicles.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "vehicle": "7c1c1f3e-2e0a-4a6e-8a39-5f6f1d2b9a10",
            "name": "Truck 12",
            "plate": "ABC 1234",
            "distance_km": 3.4,
            "state": "moving",
            "speed_kmh": 62,
            "fix_at": "2026-06-01T09:00:00+00:00"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /orders

يتطلب مفتاحًا List orders

Lists your company's transport orders, oldest first, one page at a time. A branch-limited key sees only its own branch. Staff notes are never returned. Free text (addresses, cancel_reason) is shown as your staff typed it. The pickup window is pickup_from and pickup_until. Times are UTC; meta.timezone names the platform time zone; money is in minor units of the order's currency. Requires the key scope `orders:read`.

الترويسات

statusOnly orders in this state: draft, confirmed, planned, in_transit, delivered, delivery_failed, delivered_partial, closed or cancelled.
branchOnly orders of this branch (its uuid).
updated_sinceOnly orders changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of orders.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "6a8d1f3c-2b94-4e7a-8c05-1d9e7f2b3a66",
            "reference": "ORD-20260601-0042",
            "status": "confirmed",
            "status_correction": false,
            "shipper_uuid": "2f7b9c14-6d38-4a5e-b1c0-8e4a3d7f9b77",
            "shipper_name": {
                "ar": "شركة المثال",
                "en": "Example Co"
            },
            "service_type": "full_truckload",
            "cargo_type": "general",
            "cargo_weight_kg": "18000.000",
            "cargo_volume_m3": null,
            "quantity": null,
            "quantity_unit": null,
            "pickup_city": "Riyadh",
            "pickup_address": "Second Industrial City",
            "pickup_latitude": 24.6012,
            "pickup_longitude": 46.8231,
            "dropoff_city": "Dammam",
            "dropoff_address": null,
            "dropoff_latitude": null,
            "dropoff_longitude": null,
            "pickup_from": null,
            "pickup_until": null,
            "due_by": "2026-06-03T12:00:00Z",
            "agreed_price_minor": 450000,
            "currency": "SAR",
            "cancel_reason": null,
            "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
            "created_at": "2026-06-01T08:30:00Z",
            "updated_at": "2026-06-01T09:12:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /orders/{uuid}

يتطلب مفتاحًا Read an order

Reads one of your company's transport orders by its uuid. An order of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `orders:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The order.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6a8d1f3c-2b94-4e7a-8c05-1d9e7f2b3a66",
        "reference": "ORD-20260601-0042",
        "status": "confirmed",
        "status_correction": false,
        "shipper_uuid": "2f7b9c14-6d38-4a5e-b1c0-8e4a3d7f9b77",
        "shipper_name": {
            "ar": "شركة المثال",
            "en": "Example Co"
        },
        "service_type": "full_truckload",
        "cargo_type": "general",
        "cargo_weight_kg": "18000.000",
        "cargo_volume_m3": null,
        "quantity": null,
        "quantity_unit": null,
        "pickup_city": "Riyadh",
        "pickup_address": "Second Industrial City",
        "pickup_latitude": 24.6012,
        "pickup_longitude": 46.8231,
        "dropoff_city": "Dammam",
        "dropoff_address": null,
        "dropoff_latitude": null,
        "dropoff_longitude": null,
        "pickup_from": null,
        "pickup_until": null,
        "due_by": "2026-06-03T12:00:00Z",
        "agreed_price_minor": 450000,
        "currency": "SAR",
        "cancel_reason": null,
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "created_at": "2026-06-01T08:30:00Z",
        "updated_at": "2026-06-01T09:12:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /maintenance/stock

يتطلب مفتاحًا List what each warehouse holds

Lists, one page at a time, the quantity of each spare part in each of your warehouses with its reorder level; only the warehouses your key's owner may see. A part of another company answers 404. Never a cost. Requires the key scope `maintenance:read`.

الترويسات

partOnly this part (its uuid).
below_reordertrue: only the rows below their reorder level.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of stock rows.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "8a1c3e55-6b2d-4f90-a7c4-0d9e2b1f3a77",
            "part_uuid": "3c5d8e12-4f6a-4b79-8a21-7d9e0f1b2c34",
            "part_number": "OF-1234",
            "warehouse": "Main store",
            "quantity": "12.000",
            "reorder_level": "4.000",
            "is_below_reorder_level": false,
            "row_version": 4,
            "updated_at": "2026-05-12T11:30:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /maintenance/spare-parts/{uuid}/movements

يتطلب مفتاحًا List the movements of a spare part

Lists, oldest first and one page at a time, the movements of one of your spare parts: opening balance, receipts, issues, returns, adjustments and transfers, each with its signed quantity, the warehouse, the balance after and the work order it served. Only the warehouses your key's owner may see. A part of another company answers 404 exactly like one that does not exist. Never a cost, a reason or a person. Requires the key scope `maintenance:read`.

الترويسات

uuid
statusOnly movements of this kind: opening, receipt, issue, return, adjustment, transfer_out or transfer_in.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of movements.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "4d6e8f10-2a3b-4c5d-9e7f-8a1b2c3d4e55",
            "kind": "issue",
            "quantity": "-2.000",
            "balance_after": "10.000",
            "warehouse": "Main store",
            "counterpart_warehouse": null,
            "work_order_uuid": "6c3f8b24-1e79-4a50-b3d6-9a2e7f4c1d08",
            "created_at": "2026-05-12T09:15:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /wasl/registrations

يتطلب مفتاحًا Read WASL registration states

Answers, for up to 100 of your own device ids, the WASL registration state of the vehicle each device is mapped to on your account right now: registered, in_progress, waiting_on_facts, not_completed, held_elsewhere, not_registered or not_requested, with the stored vehicle eligibility and when either last changed. A device id your account does not map to a vehicle right now answers found false, whether or not it exists elsewhere. The token needs the source:read ability; tokens issued before it was added carry ingest only and must be issued again.

الترويسات

device_ids[]Your own device ids, 1 to 100, each up to 128 characters; repeat as device_ids[]=…
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 One entry per distinct asked device id, in the order each was first asked.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "registrations": [
            {
                "device_id": "dev-1001",
                "found": true,
                "state": "registered",
                "eligibility": "eligible",
                "updated_at": "2026-10-18T09:00:00Z"
            },
            {
                "device_id": "dev-1002",
                "found": false,
                "state": null,
                "eligibility": null,
                "updated_at": null
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-10-18T09:00:01Z"
    }
}
401 unauthenticated: the source token is missing, expired or revoked.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "unauthenticated",
        "message": "Authentication is required."
    },
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-10-18T09:00:01Z"
    }
}
422 validation_failed: device_ids is missing, holds more than 100 ids, or an id is not text of up to 128 characters.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "validation_failed",
        "message": "The request contains invalid fields.",
        "details": [
            {
                "field": "device_ids",
                "code": "out_of_range",
                "message": "This value is out of range."
            }
        ]
    },
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-10-18T09:00:01Z"
    }
}
429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /per-diem-rate-proposals

يتطلب مفتاحًا List per diem rate proposals

Lists your company's proposed daily driver allowance rates, newest first, with their state (proposed, approved, rejected or cancelled) and, once approved, the ref of the rate it became. No reason, decision note or person is returned. Requires the key scope `fleet:per_diem_rates:read`.

الترويسات

stateOnly proposals in this state.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 One page of proposals.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "ref": "Pq9dQ0m1v8aB2cD4eF5gHw",
            "state": "proposed",
            "activity_code": null,
            "effective_from": "2026-12-01",
            "daily_amount": "60.00",
            "currency": "SAR",
            "rate_ref": null
        }
    ],
    "meta": {
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /per-diem-rate-proposals

يتطلب مفتاحًا Propose a per diem rate

Proposes a daily driver allowance rate, general or for one activity, as the panel would add it. The key's owner is the proposer, so a different person must approve it in the panel before it counts; nothing changes until then. The start day is today or later and after the latest rate of the activity. The amount is in minor units. Capped per key and per company in a day. Requires the key scope `fleet:per_diem_rates:propose`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The proposal that was made.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "ref": "Pq9dQ0m1v8aB2cD4eF5gHw",
        "state": "proposed"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /per-diem-rate-proposals/{ref}/cancel

يتطلب مفتاحًا Cancel a per diem rate proposal

Cancels a proposal that is still waiting for a decision. A proposal that was approved, rejected or cancelled already answers 409: an approved proposal is already a rate, and rates are never changed here. Requires the key scope `fleet:per_diem_rates:cancel`.

الترويسات

ref
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The proposal after the cancellation.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "ref": "Pq9dQ0m1v8aB2cD4eF5gHw",
        "state": "cancelled"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /per-diem-rates

يتطلب مفتاحًا List per diem rates

Lists your company's daily driver allowance rates, oldest first: the activity (empty for the general rate), the day it starts, the daily amount and its currency. A rate runs from its start day until a newer one of the same activity starts. Rates are never changed here, and no driver or reason text is returned. Requires the key scope `fleet:per_diem_rates:read`.

الترويسات

activityOnly the rates of this activity code.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 One page of rates.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "ref": "Xk3dQ0m1v8aB2cD4eF5gHw",
            "activity_code": null,
            "effective_from": "2026-01-01",
            "daily_amount": "50.00",
            "currency": "SAR"
        }
    ],
    "meta": {
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /branches

يتطلب مفتاحًا List the branches

Lists the active branches of your company, the main one first, at most 200: the uuid, the name in Arabic and English and the address. Requires the key scope `fleet:places:read`. Requires the key scope `fleet:places:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The branches.
مثال
{
    "success": true,
    "data": [
        {
            "uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
            "name": {
                "ar": "الفرع الرئيسي",
                "en": "Main branch"
            },
            "address": "Riyadh, Industrial City"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "page": {
            "limit": 200,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /facilities

يتطلب مفتاحًا List the places of the company

Lists the active workshops, warehouses and fuel stations of your company, at most 200: the uuid, the kind, the name in Arabic and English, whether the place is the company's own (internal) or an outside one (external), the branch it belongs to by uuid and the address. No contact person, phone, e-mail or position is returned. A work order may name a workshop from this list. Requires the key scope `fleet:places:read`. Requires the key scope `fleet:places:read`.

الترويسات

kindOnly places of this kind: workshop, warehouse or fuel_station.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The places.
مثال
{
    "success": true,
    "data": [
        {
            "uuid": "8e1c2d3f-6a47-4b90-9d15-2f3a4b5c6d77",
            "kind": "workshop",
            "name": {
                "ar": "ورشة الشرق",
                "en": "East workshop"
            },
            "ownership": "internal",
            "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
            "address": "Riyadh, Second Industrial City"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "page": {
            "limit": 200,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/plans/{uuid}/pause

يتطلب مفتاحًا Pause a maintenance plan

Stops an active plan from raising due notices until it is resumed. Send the `row_version` you read; a plan that is already paused or retired answers 409. Requires the key scope `fleet:plans:write` and an `Idempotency-Key` header. Requires the key scope `fleet:plans:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The plan, now paused.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "2a7d9e41-5c63-4b18-9f20-8d1e4a6c3b99",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "name": {
            "ar": "تغيير الزيت",
            "en": "Oil change"
        },
        "plan_type": "preventive",
        "category_code": "oil_change",
        "every_km": 10000,
        "every_days": 180,
        "baseline_km": 120000,
        "baseline_at": "2026-01-15T00:00:00Z",
        "status": "active",
        "created_at": "2026-01-15T08:00:00Z",
        "updated_at": "2026-03-02T10:30:00Z",
        "row_version": 3
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/plans/{uuid}/resume

يتطلب مفتاحًا Resume a maintenance plan

Makes a paused plan active again. Send the `row_version` you read; a plan that is already active or retired answers 409. Requires the key scope `fleet:plans:write` and an `Idempotency-Key` header. Requires the key scope `fleet:plans:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The plan, now active.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "2a7d9e41-5c63-4b18-9f20-8d1e4a6c3b99",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "name": {
            "ar": "تغيير الزيت",
            "en": "Oil change"
        },
        "plan_type": "preventive",
        "category_code": "oil_change",
        "every_km": 10000,
        "every_days": 180,
        "baseline_km": 120000,
        "baseline_at": "2026-01-15T00:00:00Z",
        "status": "active",
        "created_at": "2026-01-15T08:00:00Z",
        "updated_at": "2026-03-02T10:30:00Z",
        "row_version": 3
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/plans/{uuid}/retire

يتطلب مفتاحًا Retire a maintenance plan

Retires a plan for good: it is final and cannot be changed, paused or resumed afterwards. Send the `row_version` you read and `confirm` set to true. Requires the key scope `fleet:plans:write` and an `Idempotency-Key` header. Requires the key scope `fleet:plans:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The plan, now retired.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "2a7d9e41-5c63-4b18-9f20-8d1e4a6c3b99",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "name": {
            "ar": "تغيير الزيت",
            "en": "Oil change"
        },
        "plan_type": "preventive",
        "category_code": "oil_change",
        "every_km": 10000,
        "every_days": 180,
        "baseline_km": 120000,
        "baseline_at": "2026-01-15T00:00:00Z",
        "status": "active",
        "created_at": "2026-01-15T08:00:00Z",
        "updated_at": "2026-03-02T10:30:00Z",
        "row_version": 3
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /positions/latest

يتطلب مفتاحًا List latest positions

Lists the latest accepted position and state (moving, idle, parked or offline) of each of your vehicles that has reported, ordered by vehicle, one page at a time. A branch-limited key sees only its own branch. Times are UTC; meta.timezone names the platform time zone. Requires the key scope `positions:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of latest positions.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "state": "moving",
            "observed_at": "2026-06-01T08:59:10Z",
            "latitude": 24.7136,
            "longitude": 46.6753,
            "speed_kmh": 62,
            "ignition": true,
            "weight_kg": null,
            "temperature_c": null,
            "humidity_pct": null
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicles/{uuid}/position

يتطلب مفتاحًا Read a vehicle's latest position

Reads the latest accepted position and state of one vehicle by its uuid. A vehicle that has not reported yet, or one of another company or branch, answers 404. Requires the key scope `positions:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The latest position.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "state": "moving",
        "observed_at": "2026-06-01T08:59:10Z",
        "latitude": 24.7136,
        "longitude": 46.6753,
        "speed_kmh": 62,
        "ignition": true,
        "weight_kg": null,
        "temperature_c": null,
        "humidity_pct": null
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicles/{uuid}/positions

يتطلب مفتاحًا List a vehicle's position history

Lists the accepted positions of one vehicle between from (included) and to (excluded), oldest first, at most 7 days at a time and at most 1000 points per page. Follow meta.page.next_cursor for the rest of the window; at a page boundary one point may repeat, so identify points by observed_at. Times are UTC; meta.timezone names the platform time zone. Requires the key scope `positions:read`.

الترويسات

uuid
fromStart of the window, ISO 8601 with an offset (e.g. 2026-06-01T00:00:00Z); included.
toEnd of the window, after from and at most 7 days later; excluded.
limitPoints per page, 1 to 1000.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of positions.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "observed_at": "2026-06-01T08:59:10Z",
            "received_at": "2026-06-01T08:59:12Z",
            "latitude": 24.7136,
            "longitude": 46.6753,
            "speed_kmh": 62,
            "heading": 90,
            "ignition": true,
            "temperature_c": null,
            "humidity_pct": null,
            "weight_kg": null,
            "fuel_level_pct": null,
            "fuel_level_l": null
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 500,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: from or to is missing or not an ISO 8601 time with an offset, to is not after from or is more than 7 days later, or the limit or cursor is not valid.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "validation_failed",
        "message": "The request contains invalid fields.",
        "details": [
            {
                "field": "to",
                "code": "out_of_range",
                "message": "This value is out of range."
            }
        ]
    },
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicles/{uuid}/positions/export

يتطلب مفتاحًا Download a vehicle's positions as a file

Streams the positions of one of your vehicles between from (included) and to (excluded), ISO 8601 with an offset and at most 31 days apart, as csv, gpx or kml, oldest first and at most 10,000 points. It needs the key scope positions:export, which is never part of positions:read, and a written reason of 10 to 300 characters that is recorded with the key as a privileged read before any point is read (without a record, 503). Per day there is a cap per vehicle and a cap per company, and your live map administrators are told once a day for each vehicle. A vehicle of another company, or out of your scope, answers 404 exactly like one that does not exist; a plan without route history answers 403 plan_feature_required. A vehicle sold earlier shows nothing after its sale day. Requires the key scope `positions:export`.

الترويسات

uuid
formatThe file format: csv, gpx or kml.
fromThe start of the window, included (ISO 8601 with an offset).
toThe end of the window, excluded.
reasonWhy the track is needed, 10 to 300 characters; never a card number.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The file, in the format asked.

Transfer-Encoding

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /roadside/cases/{uuid}/provider-candidates

يتطلب مفتاحًا List the providers that may be asked for a roadside case

Lists, nearest first, up to twenty bases of the provider network within 100 km of the case that offer what its symptom needs: the base, the provider's public name, its service codes, the distance in kilometres and whether it is open now; never a phone, a contact, an address or a coordinate. A case with no position, or a company whose plan does not read the network, answers an empty list. A case of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `assistance:provider_messages:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The bases that may be asked, possibly none.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "location_uuid": "1d7f3a98-4b2c-4e65-9a10-6f8c2b5d0e47",
            "provider_name": "Al Amal Garage",
            "location_name": "Riyadh",
            "services": [
                "truck_repair",
                "engine"
            ],
            "distance_km": 18.3,
            "open_now": true
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /roadside/cases/{uuid}/requests

يتطلب مفتاحًا List the provider requests of a roadside case

Lists the requests for help the case sent to providers, oldest first: the state (asked, accepted, declined, withdrawn, expired), the minutes the provider gave, the expected arrival and the provider's public name; never a phone, a contact, a reason or terms. A request to a place that is not in the provider network carries no name. A case of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `assistance:provider_messages:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The requests of the case, possibly none.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "6c2e9b14-5d3a-4f81-b7a0-1e8d4c9a2f55",
            "case_uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
            "service": "help",
            "status": "accepted",
            "provider_name": "Al Amal Garage - Riyadh",
            "eta_minutes": 45,
            "expected_arrival_at": "2026-06-01T09:45:00Z",
            "asked_at": "2026-06-01T09:00:00Z",
            "decided_at": "2026-06-01T09:02:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /roadside/cases/{uuid}/requests

يتطلب مفتاحًا Ask a provider for help on a roadside case

Asks one base of the provider network for help on one of your company's roadside cases, with the panel's own rules: the base must be one that may be asked for the case now (see the candidates), at most the allowed number of requests wait at once, and the same base is not asked twice while it waits. The request is recorded and the case moves on as in the panel; the provider answers through the status link you send with the link call. Counts against the daily message cap of the company. A base that may not be asked answers 422, a rule that blocks it 409 with its name in `reason`, and a case of another company or branch 404. Requires the key scope `assistance:provider_messages:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The request.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6c2e9b14-5d3a-4f81-b7a0-1e8d4c9a2f55",
        "case_uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "service": "help",
        "status": "accepted",
        "provider_name": "Al Amal Garage - Riyadh",
        "eta_minutes": 45,
        "expected_arrival_at": "2026-06-01T09:45:00Z",
        "asked_at": "2026-06-01T09:00:00Z",
        "decided_at": "2026-06-01T09:02:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /roadside/requests/{uuid}

يتطلب مفتاحًا Read a provider request

Reads one request for help by its uuid: the state, the minutes the provider gave and the provider's public name. A request of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `assistance:provider_messages:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The request.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6c2e9b14-5d3a-4f81-b7a0-1e8d4c9a2f55",
        "case_uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "service": "help",
        "status": "accepted",
        "provider_name": "Al Amal Garage - Riyadh",
        "eta_minutes": 45,
        "expected_arrival_at": "2026-06-01T09:45:00Z",
        "asked_at": "2026-06-01T09:00:00Z",
        "decided_at": "2026-06-01T09:02:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

يتطلب مفتاحًا Mail a provider the status link of a request

Mails the provider the link of its request, to the provider's own registered contact at that base and never to an address you give; the link opens the provider-facing view of the request with its expiry and nothing more of the case. A new link ends the one before. A base with no registered email answers 409 link_no_contact, a link sent in the last minutes 409 link_recent, a request already answered or ended 409 request_answered. Counts against the daily message cap of the company. A request of another company or branch answers 404. Requires the key scope `assistance:provider_messages:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The request.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6c2e9b14-5d3a-4f81-b7a0-1e8d4c9a2f55",
        "case_uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "service": "help",
        "status": "accepted",
        "provider_name": "Al Amal Garage - Riyadh",
        "eta_minutes": 45,
        "expected_arrival_at": "2026-06-01T09:45:00Z",
        "asked_at": "2026-06-01T09:00:00Z",
        "decided_at": "2026-06-01T09:02:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /roadside/requests/{uuid}/withdraw

يتطلب مفتاحًا Withdraw a provider request

Takes back a request that is waiting or accepted, as the panel does; the provider is not mailed. It is not counted against the message cap. A request already ended answers 409. A request of another company or branch answers 404. Requires the key scope `assistance:provider_messages:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The request after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6c2e9b14-5d3a-4f81-b7a0-1e8d4c9a2f55",
        "case_uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "service": "help",
        "status": "accepted",
        "provider_name": "Al Amal Garage - Riyadh",
        "eta_minutes": 45,
        "expected_arrival_at": "2026-06-01T09:45:00Z",
        "asked_at": "2026-06-01T09:00:00Z",
        "decided_at": "2026-06-01T09:02:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /roadside/ratings

يتطلب مفتاحًا List roadside ratings

Lists the ratings your company gave to the help on its roadside cases, oldest first, one page at a time: the case, the provider and the whole-number scores; never the comment or who rated, and never a rating still under review. Requires the key scope `assistance:case_ratings:read`.

الترويسات

statusOnly ratings with this overall score, 1 to 5.
updated_sinceOnly ratings given at or after this moment (ISO 8601 with an offset).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of ratings.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "3f6a8d12-0b5c-4e97-8c41-a2d7e9b03c66",
            "case_uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
            "provider_uuid": "8a1c5e33-2d7f-4b90-a6e4-5c0b9f1d7a02",
            "stars": 4,
            "arrival": 5,
            "quality": 4,
            "price": 3,
            "communication": 4,
            "rated_at": "2026-06-02T10:15:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /roadside/ratings/{uuid}

يتطلب مفتاحًا Read a roadside rating

Reads one rating of your company's roadside cases by its uuid. A rating of another company, or one still under review, answers 404 exactly like one that does not exist. Requires the key scope `assistance:case_ratings:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The rating.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3f6a8d12-0b5c-4e97-8c41-a2d7e9b03c66",
        "case_uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "provider_uuid": "8a1c5e33-2d7f-4b90-a6e4-5c0b9f1d7a02",
        "stars": 4,
        "arrival": 5,
        "quality": 4,
        "price": 3,
        "communication": 4,
        "rated_at": "2026-06-02T10:15:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /roadside/cases/{uuid}/rating

يتطلب مفتاحًا Rate the help of a roadside case

Rates the help given on one of your company's roadside cases once it is done: from 1 to 5 stars, with four optional aspects and a short comment. A case is rated once and a rating is never changed. A case that is not done answers 422; one that is already rated answers 422. A rating of two stars or less opens a review item for the platform staff. A case of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `assistance:case_ratings:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The rating.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3f6a8d12-0b5c-4e97-8c41-a2d7e9b03c66",
        "case_uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "provider_uuid": "8a1c5e33-2d7f-4b90-a6e4-5c0b9f1d7a02",
        "stars": 4,
        "arrival": 5,
        "quality": 4,
        "price": 3,
        "communication": 4,
        "rated_at": "2026-06-02T10:15:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /maintenance/reliability

يتطلب مفتاحًا Read the reliability of each vehicle

Lists, for each of your vehicles with a breakdown repair in the period or a fault open now, the failures, the mean time between two failures, the mean time from the work order's opening and from its start to its finish, the faults open now and the age of the oldest. A mean is null while it rests on too few observations; the count it rests on is shown beside it. Most failures first. A key limited to a branch sees that branch's vehicles only. Never an amount of money, a driver, a workshop, a cause or an order text. The period is required and at most 366 days. When more than 20,000 repairs fall in the range, the read is cut and `meta.incomplete` is true. Requires the key scope `maintenance:read`.

الترويسات

fromStart of the period, ISO 8601 with an offset.
toEnd of the period, after from and at most 366 days later.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of vehicles with their reliability figures.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "failures": 4,
            "failure_gaps": 3,
            "mean_seconds_between_failures": 2592000,
            "repairs_timed": 4,
            "mean_seconds_opened_to_finished": 172800,
            "mean_seconds_started_to_finished": 86400,
            "open_faults": 1,
            "oldest_open_fault_seconds": 432000
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /maintenance/repeat-faults

يتطلب مفتاحًا Read the repeat faults

Lists, newest repeat first, each finished breakdown repair of the period that repeats an earlier repair of the same vehicle inside your company's own repeat window: the vehicle, what the two repairs share (category, a part or an inspection item; the category name only when it is the category), the two days, the days between them and the kilometres between when both repairs recorded an odometer reading. A key limited to a branch sees that branch's vehicles only. Never a workshop, a part, an item, a person or an order text. The period is required and at most 366 days. When more than 20,000 repairs fall in the range, the read is cut and `meta.incomplete` is true. Requires the key scope `maintenance:read`.

الترويسات

fromStart of the period, ISO 8601 with an offset.
toEnd of the period, after from and at most 366 days later.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of repeat faults.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "basis": "category",
            "category": "Brakes",
            "first_day": "2026-10-01",
            "repeat_day": "2026-10-11",
            "days_between": 10,
            "km_between": 820
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /replay-shares

يتطلب مفتاحًا List route replay links

Lists your company's route replay links, newest first, one page at a time: the link's uuid, the vehicle's uuid, the route period it shows (from, until), when it was made and when it ends, how many times it was opened, and its state (live, ended, used_up or withdrawn). It never shows the link address, its token, a title or who opened it. A key limited to one branch sees none. Answers 404 while route replay sharing is off. Requires the key scope `reporting:replay_shares:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of route replay links.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "0b6f6d0e-4a3e-4c52-9d51-8f0f6b3f4c11",
            "vehicle_uuid": "7c1c1f3e-2e0a-4a6e-8a39-5f6f1d2b9a10",
            "created_at": "2026-06-01T09:00:00Z",
            "expires_at": "2026-06-02T09:00:00Z",
            "from": "2026-05-31T06:00:00Z",
            "until": "2026-05-31T18:00:00Z",
            "opens": 1,
            "state": "live"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /replay-shares/{uuid}/revoke

يتطلب مفتاحًا Withdraw a route replay link

Ends one of your company's route replay links at once; asking again for a link that is already withdrawn answers the same state and changes nothing. Send an Idempotency-Key header. A link of another company answers 404 exactly like one that does not exist. Answers 404 while route replay sharing is off. Requires the key scope `reporting:replay_shares:revoke`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The link with its state.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "0b6f6d0e-4a3e-4c52-9d51-8f0f6b3f4c11",
        "vehicle_uuid": "7c1c1f3e-2e0a-4a6e-8a39-5f6f1d2b9a10",
        "created_at": "2026-06-01T09:00:00Z",
        "expires_at": "2026-06-02T09:00:00Z",
        "from": "2026-05-31T06:00:00Z",
        "until": "2026-05-31T18:00:00Z",
        "opens": 1,
        "state": "withdrawn"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /road-hazards

يتطلب مفتاحًا List live road hazards

Lists the road hazards that drivers have reported and that are still live, soonest to end first and then by place, up to 300: the kind, its Arabic label, the place at three decimals and the seconds left. It never shows who reported a hazard or from which company. truncated is true when more than 300 are live: the ones that end last are then left out, so ask for an area (min_lat, min_lng, max_lat, max_lng, no wider than 5 degrees each way) instead of reading the whole country. Answers 404 while the road hazards feature is off. Requires the key scope `hazards:read`.

الترويسات

min_lat
max_lat
min_lng
max_lng
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The live road hazards.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "hazards": [
            {
                "type": "accident",
                "label": "حادث",
                "lat": 24.713,
                "lng": 46.675,
                "seconds_left": 5400
            }
        ],
        "truncated": false
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /sensors/ingest

يتطلب مفتاحًا Send waste container sensor readings

Stores readings from the level sensors on your waste containers. Each reading names its sensor by device_ref (the reference your sensor was registered under), its time by observed_at (ISO 8601 with a time zone) or observed_at_epoch_ms, and either fill_pct (0 to 100) or distance_mm (the distance from the sensor to the waste); battery_pct, temperature_c, tilt_deg, fire and signal_dbm are optional, and event_id makes a retry safe. The answer is 200 with how many readings were stored, how many were already stored, and the index and reason of every one that was not stored (unknown_device: no active sensor of yours has that reference; unusable_reading: the sensor profile cannot use what was sent; storage_error: the reading could not be stored, send it again). A reading is never stored for another company. An empty batch or one over 200 readings answers 422 batch_too_large; invalid fields answer 422 validation_failed with one detail per field; a plan without sensor readings answers 403 forbidden.

الترويسات

X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

جسم الطلب

readingsمطلوبOne or more readings. Fields: device_ref, observed_at or observed_at_epoch_ms, fill_pct or distance_mm (one of them required), battery_pct, temperature_c, tilt_deg, fire, signal_dbm, event_id.
مثال
{
    "readings": [
        {
            "device_ref": "sensor-0001",
            "observed_at": "2026-11-10T08:00:00Z",
            "distance_mm": 640,
            "battery_pct": 87,
            "event_id": "e-0001"
        }
    ]
}

الردود

200 The batch was processed.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "received": 2,
        "accepted": 1,
        "duplicates": 0,
        "rejected": [
            {
                "index": 1,
                "code": "unknown_device"
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-11-10T08:00:01Z"
    }
}
401 unauthenticated: the source token is missing, expired or revoked.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "unauthenticated",
        "message": "Authentication is required."
    },
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-11-10T08:00:01Z"
    }
}
403 forbidden: the token lacks the sensor ability or the plan has no sensor readings.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "forbidden",
        "message": "You are not allowed to do this."
    },
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-11-10T08:00:01Z"
    }
}
422 validation_failed (one detail per invalid field) or batch_too_large.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "validation_failed",
        "message": "The request contains invalid fields.",
        "details": [
            {
                "field": "readings.0.fill_pct",
                "code": "out_of_range",
                "message": "This value is out of range."
            }
        ]
    },
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-11-10T08:00:01Z"
    }
}
429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /maintenance/spare-parts

يتطلب مفتاحًا List spare parts

Lists your company's spare parts, oldest first, one page at a time. Each carries its part number, name, category, unit and status, the minimum reorder level and the quantity on hand in all your warehouses; never a cost or a supplier. Discontinued parts are left out unless you ask for them. Requires the key scope `maintenance:read`.

الترويسات

statusOnly parts in this state: active or discontinued. Discontinued parts are left out unless you ask for them.
updated_sinceOnly parts changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of spare parts.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "3c5d8e12-4f6a-4b79-8a21-7d9e0f1b2c34",
            "part_number": "OF-1234",
            "name": "Oil filter",
            "category": "filter",
            "unit_of_measure": "piece",
            "status": "active",
            "row_version": 3,
            "min_reorder_level": "4.000",
            "on_hand_quantity": "12.000",
            "warehouses": 2,
            "is_below_reorder_level": false,
            "created_at": "2026-05-10T09:00:00Z",
            "updated_at": "2026-05-12T11:30:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/spare-parts

يتطلب مفتاحًا Create a spare part

Defines a spare part of your company, as the panel does: its number (unique in the company), name, category code, unit (piece, set, litre, kg or meter), minimum reorder level and currency. It has no stock until stock is received with the key scope `fleet:stock:manage`. At most 200 parts a day for one company. Requires the key scope `fleet:parts:write` and an `Idempotency-Key` header. Requires the key scope `fleet:parts:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The part that was created.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3c5d8e12-4f6a-4b79-8a21-7d9e0f1b2c34",
        "part_number": "OF-1234",
        "name": "Oil filter",
        "category": "filter",
        "unit_of_measure": "piece",
        "status": "active",
        "row_version": 3,
        "min_reorder_level": "4.000",
        "on_hand_quantity": "12.000",
        "warehouses": 2,
        "is_below_reorder_level": false,
        "created_at": "2026-05-10T09:00:00Z",
        "updated_at": "2026-05-12T11:30:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /maintenance/spare-parts/{uuid}

يتطلب مفتاحًا Read a spare part

Reads one of your company's spare parts by its uuid, with the quantity on hand. A record of another company answers 404 exactly like one that does not exist. Requires the key scope `maintenance:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The spare part.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3c5d8e12-4f6a-4b79-8a21-7d9e0f1b2c34",
        "part_number": "OF-1234",
        "name": "Oil filter",
        "category": "filter",
        "unit_of_measure": "piece",
        "status": "active",
        "row_version": 3,
        "min_reorder_level": "4.000",
        "on_hand_quantity": "12.000",
        "warehouses": 2,
        "is_below_reorder_level": false,
        "created_at": "2026-05-10T09:00:00Z",
        "updated_at": "2026-05-12T11:30:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

PATCH /maintenance/spare-parts/{uuid}

يتطلب مفتاحًا Change a spare part

Changes what a spare part is: number, name, category, unit or minimum reorder level; what you leave out stays as it is. Never its currency or its stock. Send the `row_version` you read: a part changed meanwhile answers 409. Requires the key scope `fleet:parts:write` and an `Idempotency-Key` header. Requires the key scope `fleet:parts:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The part after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3c5d8e12-4f6a-4b79-8a21-7d9e0f1b2c34",
        "part_number": "OF-1234",
        "name": "Oil filter",
        "category": "filter",
        "unit_of_measure": "piece",
        "status": "active",
        "row_version": 3,
        "min_reorder_level": "4.000",
        "on_hand_quantity": "12.000",
        "warehouses": 2,
        "is_below_reorder_level": false,
        "created_at": "2026-05-10T09:00:00Z",
        "updated_at": "2026-05-12T11:30:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/spare-parts/{uuid}/discontinue

يتطلب مفتاحًا Discontinue a spare part

Stops new receipts and issues of a part; its stock can still be counted, moved and returned. Send the `row_version` you read; a part already discontinued answers 409. Requires the key scope `fleet:parts:write` and an `Idempotency-Key` header. Requires the key scope `fleet:parts:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The part, now discontinued.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3c5d8e12-4f6a-4b79-8a21-7d9e0f1b2c34",
        "part_number": "OF-1234",
        "name": "Oil filter",
        "category": "filter",
        "unit_of_measure": "piece",
        "status": "active",
        "row_version": 3,
        "min_reorder_level": "4.000",
        "on_hand_quantity": "12.000",
        "warehouses": 2,
        "is_below_reorder_level": false,
        "created_at": "2026-05-10T09:00:00Z",
        "updated_at": "2026-05-12T11:30:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/spare-parts/{uuid}/reactivate

يتطلب مفتاحًا Bring a spare part back

Makes a discontinued part active again. Send the `row_version` you read; a part already active answers 409. Requires the key scope `fleet:parts:write` and an `Idempotency-Key` header. Requires the key scope `fleet:parts:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The part, now active.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3c5d8e12-4f6a-4b79-8a21-7d9e0f1b2c34",
        "part_number": "OF-1234",
        "name": "Oil filter",
        "category": "filter",
        "unit_of_measure": "piece",
        "status": "active",
        "row_version": 3,
        "min_reorder_level": "4.000",
        "on_hand_quantity": "12.000",
        "warehouses": 2,
        "is_below_reorder_level": false,
        "created_at": "2026-05-10T09:00:00Z",
        "updated_at": "2026-05-12T11:30:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/spare-parts/{uuid}/stock/receive

يتطلب مفتاحًا Receive stock of a spare part

Receives a quantity of one of your spare parts into one of your warehouses at a unit price, as the panel does: the stock goes up and the warehouse's average price moves with it. The unit price must be within the part's recent receipt prices (the company's factor, 5 times unless it set another), else 422 with reason cost_out_of_range. A discontinued part answers 409; a part or warehouse you cannot see answers 404. Requires the key scope `fleet:stock:manage` and an `Idempotency-Key` header. The answer shows quantities only, never a price. Requires the key scope `fleet:stock:manage`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The receipt that was recorded.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "4d6e8f10-2a3b-4c5d-9e7f-8a1b2c3d4e55",
        "kind": "issue",
        "quantity": "-2.000",
        "balance_after": "10.000",
        "warehouse": "Main store",
        "counterpart_warehouse": null,
        "work_order_uuid": "6c3f8b24-1e79-4a50-b3d6-9a2e7f4c1d08",
        "created_at": "2026-05-12T09:15:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/spare-parts/{uuid}/stock/count

يتطلب مفتاحًا Count the stock of a spare part in a warehouse

Sets what a warehouse holds of one of your spare parts to what was counted, at the version the counter saw (the row_version of the stock read), with a reason of 5 to 500 characters, as the panel does. A count that changes the quantity by more than the company's share (20 percent unless it set another) of what the warehouse held, and any count of a warehouse that holds nothing, answers 422 with reason needs_review and is made in the panel. A stale version answers 409. Requires the key scope `fleet:stock:manage` and an `Idempotency-Key` header. Requires the key scope `fleet:stock:manage`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The adjustment that was recorded.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "4d6e8f10-2a3b-4c5d-9e7f-8a1b2c3d4e55",
        "kind": "issue",
        "quantity": "-2.000",
        "balance_after": "10.000",
        "warehouse": "Main store",
        "counterpart_warehouse": null,
        "work_order_uuid": "6c3f8b24-1e79-4a50-b3d6-9a2e7f4c1d08",
        "created_at": "2026-05-12T09:15:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/spare-parts/{uuid}/stock/transfer

يتطلب مفتاحًا Move stock of a spare part between warehouses

Moves a quantity of one of your spare parts from one of your warehouses to another at the source's average price, with a reason of 5 to 500 characters, as the panel does. More than the source holds answers 422; the same warehouse twice answers 422; a part or warehouse you cannot see answers 404. Requires the key scope `fleet:stock:manage` and an `Idempotency-Key` header. Requires the key scope `fleet:stock:manage`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The movement out of the source that was recorded.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "4d6e8f10-2a3b-4c5d-9e7f-8a1b2c3d4e55",
        "kind": "issue",
        "quantity": "-2.000",
        "balance_after": "10.000",
        "warehouse": "Main store",
        "counterpart_warehouse": null,
        "work_order_uuid": "6c3f8b24-1e79-4a50-b3d6-9a2e7f4c1d08",
        "created_at": "2026-05-12T09:15:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

PATCH /maintenance/spare-parts/{uuid}/stock/reorder-level

يتطلب مفتاحًا Set the reorder level of a spare part in a warehouse

Sets the quantity at or below which one warehouse's stock of one of your spare parts calls for an order, at the version the sender saw (the row_version of the stock read), as the panel does. A stale version answers 409; a part or warehouse you cannot see, or a warehouse that has no stock row of the part, answers 404. Requires the key scope `fleet:stock:manage` and an `Idempotency-Key` header. Requires the key scope `fleet:stock:manage`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The stock after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "8a1c3e55-6b2d-4f90-a7c4-0d9e2b1f3a77",
        "part_uuid": "3c5d8e12-4f6a-4b79-8a21-7d9e0f1b2c34",
        "part_number": "OF-1234",
        "warehouse": "Main store",
        "quantity": "12.000",
        "reorder_level": "4.000",
        "is_below_reorder_level": false,
        "row_version": 4,
        "updated_at": "2026-05-12T11:30:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/work-orders/{uuid}/parts/issue

يتطلب مفتاحًا Issue a part to a work order

Issues a quantity of one of your spare parts from one of your warehouses to a work order that is open or in progress, as the panel does: the stock goes down and the order's parts cost follows at the warehouse's own average price, which you never send and are never shown. Send the part and the warehouse by uuid and the quantity as a decimal string with at most three places. A finished or cancelled order answers 409; stock that is not enough, or a part in another currency than the order, answers 422. A record you cannot see, another company's or a warehouse that is not yours answers 404. At most 30 issues an hour for one order. Requires the key scope `fleet:stock:write` and an `Idempotency-Key` header. Requires the key scope `fleet:stock:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The part line that was issued.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5e7f9a21-3b4c-4d68-9e0a-1f2b3c4d5e66",
        "work_order_uuid": "6c3f8b24-1e79-4a50-b3d6-9a2e7f4c1d08",
        "part_uuid": "3c5d8e12-4f6a-4b79-8a21-7d9e0f1b2c34",
        "part_number": "OF-1234",
        "kind": "issue",
        "quantity": "2.000",
        "created_at": "2026-05-12T09:15:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/work-orders/{uuid}/parts/{line}/return

يتطلب مفتاحًا Return a part from a work order

Returns a quantity of a part that was issued to a work order to the warehouse it came from, at the cost it left at, as the panel does. The line is the part line of the issue, by its uuid, and must belong to the work order in the path. You cannot return more than is still out on the line, and a finished or cancelled order answers 409. Send the quantity as a decimal string with at most three places and, if you like, a plain reason. A record you cannot see answers 404. Requires the key scope `fleet:stock:write` and an `Idempotency-Key` header. Requires the key scope `fleet:stock:write`.

الترويسات

uuid
line
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The return line that was recorded.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5e7f9a21-3b4c-4d68-9e0a-1f2b3c4d5e66",
        "work_order_uuid": "6c3f8b24-1e79-4a50-b3d6-9a2e7f4c1d08",
        "part_uuid": "3c5d8e12-4f6a-4b79-8a21-7d9e0f1b2c34",
        "part_number": "OF-1234",
        "kind": "issue",
        "quantity": "2.000",
        "created_at": "2026-05-12T09:15:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /maintenance/suppliers

يتطلب مفتاحًا List suppliers

Lists your company's suppliers, oldest first, one page at a time. Each carries its name, kind, status and tax number. The contact person, phone, email and note are never shown. Archived suppliers are left out unless you ask for them. Requires the key scope `suppliers:read`.

الترويسات

statusOnly suppliers in this state: active or archived. Archived suppliers are left out unless you ask for them.
updated_sinceOnly suppliers changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of suppliers.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "7b2f4e90-1c3d-4a58-9e6b-0d8a5c7f1e24",
            "name": "Modern Tyres Est.",
            "kind": "tyres",
            "status": "active",
            "tax_number": "300000000000003",
            "row_version": 2,
            "archived_at": null,
            "created_at": "2026-05-10T09:00:00Z",
            "updated_at": "2026-05-12T11:30:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/suppliers

يتطلب مفتاحًا Add a supplier

Adds a supplier to your company, as the suppliers page does: its name, kind and optionally its tax number. A contact person, phone, email or note is never accepted over a key. A name or tax number that an active supplier of your company already has answers 422. Requires the key scope `fleet:suppliers:write` and a plan with maintenance. Requires the key scope `fleet:suppliers:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The supplier.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7b2f4e90-1c3d-4a58-9e6b-0d8a5c7f1e24",
        "name": "Modern Tyres Est.",
        "kind": "tyres",
        "status": "active",
        "tax_number": "300000000000003",
        "row_version": 2,
        "archived_at": null,
        "created_at": "2026-05-10T09:00:00Z",
        "updated_at": "2026-05-12T11:30:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /maintenance/suppliers/{uuid}

يتطلب مفتاحًا Read a supplier

Reads one of your company's suppliers by its uuid. A record of another company answers 404 exactly like one that does not exist. Requires the key scope `suppliers:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The supplier.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7b2f4e90-1c3d-4a58-9e6b-0d8a5c7f1e24",
        "name": "Modern Tyres Est.",
        "kind": "tyres",
        "status": "active",
        "tax_number": "300000000000003",
        "row_version": 2,
        "archived_at": null,
        "created_at": "2026-05-10T09:00:00Z",
        "updated_at": "2026-05-12T11:30:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

PATCH /maintenance/suppliers/{uuid}

يتطلب مفتاحًا Change a supplier

Changes a supplier's name, kind or tax number. Send the `row_version` you read: a supplier changed meanwhile answers 409. Send `tax_number` to set or clear it, leave it out to keep it. The contact details are never touched. An archived supplier is not changed. Requires the key scope `fleet:suppliers:write`. Requires the key scope `fleet:suppliers:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The supplier.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7b2f4e90-1c3d-4a58-9e6b-0d8a5c7f1e24",
        "name": "Modern Tyres Est.",
        "kind": "tyres",
        "status": "active",
        "tax_number": "300000000000003",
        "row_version": 2,
        "archived_at": null,
        "created_at": "2026-05-10T09:00:00Z",
        "updated_at": "2026-05-12T11:30:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/suppliers/{uuid}/archive

يتطلب مفتاحًا Archive a supplier

Archives a supplier, as the suppliers page does: it leaves the default list and keeps its data; it is never deleted. Send the `row_version` you read. Requires the key scope `fleet:suppliers:write`. Requires the key scope `fleet:suppliers:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The archived supplier.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7b2f4e90-1c3d-4a58-9e6b-0d8a5c7f1e24",
        "name": "Modern Tyres Est.",
        "kind": "tyres",
        "status": "active",
        "tax_number": "300000000000003",
        "row_version": 2,
        "archived_at": null,
        "created_at": "2026-05-10T09:00:00Z",
        "updated_at": "2026-05-12T11:30:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/suppliers/{uuid}/restore

يتطلب مفتاحًا Bring a supplier back

Brings an archived supplier back to the active list with its data. A name or tax number that an active supplier already has answers 422. Send the `row_version` you read. Requires the key scope `fleet:suppliers:write`. Requires the key scope `fleet:suppliers:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The restored supplier.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "7b2f4e90-1c3d-4a58-9e6b-0d8a5c7f1e24",
        "name": "Modern Tyres Est.",
        "kind": "tyres",
        "status": "active",
        "tax_number": "300000000000003",
        "row_version": 2,
        "archived_at": null,
        "created_at": "2026-05-10T09:00:00Z",
        "updated_at": "2026-05-12T11:30:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /roadside/swaps

يتطلب مفتاحًا List roadside head swaps

Lists the replacements of a broken tractor head on your company's roadside cases, oldest first, one page at a time: the state, the two vehicles and the times; never a driver, a note or a position. Requires the key scope `assistance:case_swaps:read`.

الترويسات

statusOnly swaps in this state: proposed, approved, head_dispatched, applying, applied, refused, withdrawn or cancelled.
updated_sinceOnly swaps changed at or after this moment (ISO 8601 with an offset).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of head swaps.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "2e8c1f70-9a4b-4d3e-b6c5-71a0f3d92b18",
            "case_uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
            "status": "approved",
            "driver_mode": "same_driver_moves",
            "from_vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "to_vehicle_uuid": "9d4a2c11-7b6e-4f08-8a35-c1e7d0b25f64",
            "requested_at": "2026-06-01T08:40:00Z",
            "decided_at": null,
            "applied_at": null,
            "updated_at": "2026-06-01T08:40:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /roadside/swaps/{uuid}

يتطلب مفتاحًا Read a roadside head swap

Reads one head swap of your company's roadside cases by its uuid. A swap of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `assistance:case_swaps:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The head swap.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "2e8c1f70-9a4b-4d3e-b6c5-71a0f3d92b18",
        "case_uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "status": "approved",
        "driver_mode": "same_driver_moves",
        "from_vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "to_vehicle_uuid": "9d4a2c11-7b6e-4f08-8a35-c1e7d0b25f64",
        "requested_at": "2026-06-01T08:40:00Z",
        "decided_at": null,
        "applied_at": null,
        "updated_at": "2026-06-01T08:40:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /roadside/swaps/{uuid}/approve

يتطلب مفتاحًا Approve a roadside head swap

Approves a proposed head swap. The approver is always a different person from the proposer (403 when it is the same person or the session is impersonated), and a proposal that needed a confirmation of the lines marked unknown needs the approver's own `confirm_compatibility` (409 swap_confirm_needed otherwise). Approving moves nothing: the head is sent, coupled and applied in the panel. A swap that is not waiting answers 409 swap_state. A swap of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `assistance:case_swap_approvals:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The swap after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "2e8c1f70-9a4b-4d3e-b6c5-71a0f3d92b18",
        "case_uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "status": "approved",
        "driver_mode": "same_driver_moves",
        "from_vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "to_vehicle_uuid": "9d4a2c11-7b6e-4f08-8a35-c1e7d0b25f64",
        "requested_at": "2026-06-01T08:40:00Z",
        "decided_at": null,
        "applied_at": null,
        "updated_at": "2026-06-01T08:40:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /roadside/swaps/{uuid}/refuse

يتطلب مفتاحًا Refuse a roadside head swap

Refuses a proposed head swap with a reason; the reason goes on the case timeline and is never returned by the read endpoints. A swap that is not waiting answers 409 swap_state. A swap of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `assistance:case_swap_approvals:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The swap after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "2e8c1f70-9a4b-4d3e-b6c5-71a0f3d92b18",
        "case_uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "status": "approved",
        "driver_mode": "same_driver_moves",
        "from_vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "to_vehicle_uuid": "9d4a2c11-7b6e-4f08-8a35-c1e7d0b25f64",
        "requested_at": "2026-06-01T08:40:00Z",
        "decided_at": null,
        "applied_at": null,
        "updated_at": "2026-06-01T08:40:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /roadside/cases/{uuid}/swap-candidates

يتطلب مفتاحًا List the replacement heads of a roadside case

Lists, nearest and most ready first, up to ten tractors of your company that could replace the broken head of one roadside case: the vehicle, its plain label, the distance from the case in kilometres when known, a verdict (`ready`, `needs_confirmation` when a line is unknown, or `ruled_out`) and one outcome per check (`pass`, `fail`, `unknown`); never a driver, a trip reference or a position. A case whose vehicle is not a tractor pulling a trailer answers an empty list. The list is read fresh; propose a swap with the vehicle you choose. A case of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `assistance:case_swaps:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The candidates, possibly none.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "vehicle_uuid": "9d4a2c11-7b6e-4f08-8a35-c1e7d0b25f64",
            "label": "ABC 1234",
            "distance_km": 12.4,
            "verdict": "ready",
            "checks": [
                {
                    "key": "availability",
                    "outcome": "pass"
                },
                {
                    "key": "busy",
                    "outcome": "pass"
                },
                {
                    "key": "coupling",
                    "outcome": "pass"
                },
                {
                    "key": "position",
                    "outcome": "pass"
                },
                {
                    "key": "driver",
                    "outcome": "pass"
                },
                {
                    "key": "wasl",
                    "outcome": "pass"
                }
            ]
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /roadside/cases/{uuid}/swaps

يتطلب مفتاحًا Propose a roadside head swap

Proposes replacing the broken tractor head of one of your company's roadside cases with another tractor of the company, with the panel's own checks (the case is on a running trip with a trailer, the tractor fits and is free). A different person approves it in the panel or with an approval key; nothing moves until the new head is coupled. A rule that blocks it answers 409 with its name in `reason` (swap_no_trailer, swap_wasl_trip, swap_candidate, swap_ruled_out, swap_confirm_needed, swap_no_head_driver, swap_no_trip_driver, swap_pending). A tractor of another company or one that does not exist answers 404, and so does a case of another company or branch. Requires the key scope `assistance:case_swaps:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The proposed swap.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "2e8c1f70-9a4b-4d3e-b6c5-71a0f3d92b18",
        "case_uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "status": "approved",
        "driver_mode": "same_driver_moves",
        "from_vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "to_vehicle_uuid": "9d4a2c11-7b6e-4f08-8a35-c1e7d0b25f64",
        "requested_at": "2026-06-01T08:40:00Z",
        "decided_at": null,
        "applied_at": null,
        "updated_at": "2026-06-01T08:40:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /roadside/swaps/{uuid}/withdraw

يتطلب مفتاحًا Withdraw a roadside head swap proposal

Takes back a head swap that the same person proposed and nobody has decided yet. A swap already decided answers 409 swap_state; one proposed by someone else answers 403. A swap of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `assistance:case_swaps:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The swap after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "2e8c1f70-9a4b-4d3e-b6c5-71a0f3d92b18",
        "case_uuid": "5b1d7a20-3c4e-4f6a-9d11-8e2a0c7b6f33",
        "status": "approved",
        "driver_mode": "same_driver_moves",
        "from_vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "to_vehicle_uuid": "9d4a2c11-7b6e-4f08-8a35-c1e7d0b25f64",
        "requested_at": "2026-06-01T08:40:00Z",
        "decided_at": null,
        "applied_at": null,
        "updated_at": "2026-06-01T08:40:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /tracking-proposals

يتطلب مفتاحًا List tracking platform proposals

Lists the device links your tracking platforms propose, oldest first, one page at a time. Pending ones by default; ask status=applied, rejected, superseded or failed for the rest. Only your own linked platforms appear. The reported values, device names and credentials are never returned; a proposal changes nothing until a person decides it in the panel. Needs the same right as the proposals page; closed (403) until your company's identity check is approved. Requires the key scope `tracking_proposals:read`.

الترويسات

statusOnly proposals in this state (default pending).
updated_sinceOnly proposals created at or after this moment (ISO 8601 with an offset).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of proposals.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "6c1d7a52-0e3b-4b9a-8f61-2d5e9a7b3c10",
            "kind": "link",
            "state": "pending",
            "match_rule": "imei_exact",
            "match_confidence": 100,
            "is_conflict": false,
            "needs_completion": [],
            "waiting_for": null,
            "failure_reason": null,
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "created_at": "2026-11-14T08:30:00Z",
            "decided_at": null
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /tracking-proposals/{uuid}

يتطلب مفتاحًا Read a tracking platform proposal

Reads one proposal of your own linked platforms by its uuid. Another company's proposal answers 404 exactly like one that does not exist. Requires the key scope `tracking_proposals:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The proposal.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6c1d7a52-0e3b-4b9a-8f61-2d5e9a7b3c10",
        "kind": "link",
        "state": "pending",
        "match_rule": "imei_exact",
        "match_confidence": 100,
        "is_conflict": false,
        "needs_completion": [],
        "waiting_for": null,
        "failure_reason": null,
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "created_at": "2026-11-14T08:30:00Z",
        "decided_at": null
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T12:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /trips

يتطلب مفتاحًا List trips

Lists your company's trips, oldest first, one page at a time; each carries its vehicle, driver and orders by uuid. A branch-limited key sees only its own branch. Staff notes are never returned; cancel_reason is free text shown as your staff typed it. Times are UTC; meta.timezone names the platform time zone. Requires the key scope `trips:read`.

الترويسات

statusOnly trips in this state: planned, assigned, loading, en_route, delivered, closed or cancelled.
branchOnly trips of this branch (its uuid).
updated_sinceOnly trips changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of trips.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "8b3e5a70-4c19-4d2f-9a6e-7f1c0d2b4e88",
            "reference": "TRP-20260601-0007",
            "status": "en_route",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "driver_uuid": "3c1e9a52-8d47-4b6a-a2f0-5e7d9b4c1a44",
            "order_uuids": [
                "6a8d1f3c-2b94-4e7a-8c05-1d9e7f2b3a66"
            ],
            "planned_from": "2026-06-01T05:00:00Z",
            "planned_until": "2026-06-01T17:00:00Z",
            "dispatched_at": "2026-06-01T04:40:00Z",
            "loading_at": "2026-06-01T05:10:00Z",
            "started_at": "2026-06-01T06:00:00Z",
            "delivered_at": null,
            "closed_at": null,
            "cancelled_at": null,
            "cancel_reason": null,
            "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
            "created_at": "2026-06-01T04:00:00Z",
            "updated_at": "2026-06-01T06:00:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /trips/{uuid}

يتطلب مفتاحًا Read a trip

Reads one of your company's trips by its uuid. A trip of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `trips:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The trip.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "8b3e5a70-4c19-4d2f-9a6e-7f1c0d2b4e88",
        "reference": "TRP-20260601-0007",
        "status": "en_route",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "driver_uuid": "3c1e9a52-8d47-4b6a-a2f0-5e7d9b4c1a44",
        "order_uuids": [
            "6a8d1f3c-2b94-4e7a-8c05-1d9e7f2b3a66"
        ],
        "planned_from": "2026-06-01T05:00:00Z",
        "planned_until": "2026-06-01T17:00:00Z",
        "dispatched_at": "2026-06-01T04:40:00Z",
        "loading_at": "2026-06-01T05:10:00Z",
        "started_at": "2026-06-01T06:00:00Z",
        "delivered_at": null,
        "closed_at": null,
        "cancelled_at": null,
        "cancel_reason": null,
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "created_at": "2026-06-01T04:00:00Z",
        "updated_at": "2026-06-01T06:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /trips/{uuid}/delay-excuse

يتطلب مفتاحًا Excuse the delay of a trip

Excuses the delay of one of your company's trips in writing, as a manager does in the panel: the excuse needs a roadside case of your company opened no later than the delay ended, the setting that allows excuses, and the key's owner may not excuse a trip they made or dispatched unless they are a company administrator. One open excuse per trip; at most 5 attempts in 10 minutes per trip. Requires the key scope `logistics:trip_delay_excuses:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The excuse: its id and state only.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "state": "active"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T20:00:00Z"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /trips/{uuid}/delay-excuse/revoke

يتطلب مفتاحًا Revoke the delay excuse of a trip

Revokes the open excuse of one of your company's trips in writing; the excuse stays as history and is never deleted. At most 5 attempts in 10 minutes per trip. Requires the key scope `logistics:trip_delay_excuses:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The excuse: its id and state only.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "state": "revoked"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T20:00:00Z"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /trips/{uuid}/driver-messages

يتطلب مفتاحًا Write to the driver of a trip

Sends a short message to the driver of one of your company's trips, as the dispatcher does in the panel; the driver reads it in the app and is told only that a message waits. The trip must have a driver; at most 5 messages in 10 minutes to one driver by keys, on top of the panel's own limits. Requires the key scope `logistics:trip_driver_messages:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The message that was sent: its id only.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T20:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /trips/{uuid}/file

يتطلب مفتاحًا Read the trip file figures

The figures of the trip file page for one of your company's trips: the six stages (planned, assigned, loading, en route, delivered, closed) with the time each was reached and which is current, how late the latest drop-off arrival was against the planned end, the stops reached out of all the pickups and drop-offs, the stops of the line with their city and coordinates, when the vehicle last reported, the load against its capacity, the WASL registration state of the vehicle per activity and, for a key owner who may open the trip profit report and see drivers' pay and whose key also holds the scope `reporting:fleet_profitability:read`, the trip's money as the report words it (display lines per currency, never added across currencies). No person, phone or vehicle position is returned. A trip of another company or branch answers 404. Requires the key scope `logistics:trip_file:read`. Requires the key scope `logistics:trip_file:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The trip file figures.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "reference": "TRP-1001",
        "status": "en_route",
        "stages": [
            {
                "stage": "planned",
                "at": "2026-06-01T05:00:00Z",
                "status": "done"
            }
        ],
        "delay_minutes": null,
        "stops": {
            "reached": 1,
            "total": 4,
            "line": [
                {
                    "city": "الرياض",
                    "kind": "pickup",
                    "state": "done",
                    "lat": 24.7136,
                    "lng": 46.6753
                }
            ]
        },
        "last_signal_at": "2026-06-01T08:30:00Z",
        "load": null,
        "compliance": [
            {
                "activity_code": "FREIGHT",
                "registration_state": "active"
            }
        ],
        "money": null
    },
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /trips/{uuid}/proofs

يتطلب مفتاحًا List the proofs of a trip

Lists the delivery proofs recorded on one of your company's trips: the proof's id, its order, its kind, when it was recorded and whether the office recorded it. No file, receiver name, reason or position is returned. A trip of another company or branch answers 404. Requires the key scope `logistics:trip_records:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of proofs.

Cache-Control

مثال
{
    "success": true,
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "page": {
            "limit": 25,
            "next_cursor": null
        }
    },
    "data": [
        {
            "uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "order_uuid": "7c1d2f3e-1a2b-4c3d-8e9f-0a1b2c3d4e5f",
            "kind": "signature",
            "recorded_at": "2026-06-01T08:30:00Z",
            "recorded_by_office": false
        }
    ]
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /trips/{uuid}/stop-facts

يتطلب مفتاحًا List the stop facts of a trip

Lists what tracking observed at the trip's pickups and drop-offs, oldest first: the order, the fact, the visit number and the time. No position or distance is returned. The cursor is an opaque token for the next page and belongs to this trip. Requires the key scope `logistics:trip_records:read`.

الترويسات

uuid
limitRows per page, 1 to 200 (default 100).
cursorThe next_cursor of the previous page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of stop facts.

Cache-Control

مثال
{
    "success": true,
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "page": {
            "limit": 25,
            "next_cursor": null
        }
    },
    "data": [
        {
            "order_uuid": "7c1d2f3e-1a2b-4c3d-8e9f-0a1b2c3d4e5f",
            "fact": "arrived_pickup",
            "visit": 1,
            "observed_at": "2026-06-01T07:45:00Z"
        }
    ]
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /trips/{uuid}/reports

يتطلب مفتاحًا List the stop reports of a trip

Lists the stop reports recorded on one of your company's trips: the report's id, its order, its kind, when it was made and whether the office made it. No reason or person is returned. Requires the key scope `logistics:trip_records:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of stop reports.

Cache-Control

مثال
{
    "success": true,
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "page": {
            "limit": 25,
            "next_cursor": null
        }
    },
    "data": [
        {
            "uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a12",
            "order_uuid": "7c1d2f3e-1a2b-4c3d-8e9f-0a1b2c3d4e5f",
            "kind": "delay",
            "reported_at": "2026-06-01T08:00:00Z",
            "recorded_by_office": false
        }
    ]
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /trips/{uuid}/history

يتطلب مفتاحًا List the history of a trip

Lists the state changes of one of your company's trips, oldest first: the two states, when it happened, its kind (moved, window_changed or recorded), the kind of actor (user, driver or system) and, only for a cancellation, its reason, or for a change of window the old and new window. No person is returned. The cursor is an opaque token for the next page and belongs to this trip. A trip of another company or branch answers 404. Requires the key scope `logistics:trip_records:read`.

الترويسات

uuid
limitRows per page, 1 to 200 (default 100).
cursorThe next_cursor of the previous page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of history entries.

Cache-Control

مثال
{
    "success": true,
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "page": {
            "limit": 25,
            "next_cursor": null
        }
    },
    "data": [
        {
            "from_status": "planned",
            "to_status": "assigned",
            "at": "2026-06-01T06:00:00Z",
            "kind": "moved",
            "actor_kind": "user",
            "note": null,
            "window": null
        }
    ]
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /trips/summary

يتطلب مفتاحًا Read the trips summary

The figures above the trips list: how many trips are in each state and how many are still open, how many need a person now (late beyond the manager's tolerance, silent beyond the tracking limit, or delivered and waiting too long to be closed), what waits and the time of the oldest wait (unassigned, unassigned for tomorrow, late now, without a signal, waiting to close) and how the last 14 Saudi days ended (delivered, delivered late, cancelled per day). Counts and times only: no plate, driver, price or coordinate. The silent counts and the silent part of the attention count are given only when the key also holds `positions:read` and its owner may see the live map. Requires the key scope `logistics:trips_summary:read` and the view right. Requires the key scope `logistics:trips_summary:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The summary.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "states": {
            "planned": 2,
            "assigned": 1,
            "loading": 0,
            "en_route": 3,
            "delivered": 1,
            "closed": 40,
            "cancelled": 2
        },
        "open": 7,
        "attention": 2,
        "waiting": {
            "unassigned": {
                "count": 2,
                "since": "2026-11-19T06:00:00Z"
            },
            "unassigned_tomorrow": 1,
            "late": {
                "count": 1,
                "minutes": 35
            },
            "silent": {
                "count": null,
                "minutes": null,
                "unavailable": "silence_denied"
            },
            "to_close": {
                "count": 1,
                "since": "2026-11-19T14:00:00Z"
            }
        },
        "outcome": {
            "days": 14,
            "daily": [
                {
                    "date": "2026-11-19",
                    "delivered": 3,
                    "late": 1,
                    "cancelled": 0
                }
            ],
            "unavailable": null
        }
    },
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-19T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicles

يتطلب مفتاحًا List vehicles

Lists your company's vehicles, oldest first, one page at a time. Archived vehicles are left out unless you ask for status=archived. A branch-limited key sees only its own branch (records shared with your branch are included; their branch_uuid is empty). Times are UTC; meta.timezone names the platform time zone. Requires the key scope `vehicles:read`.

الترويسات

statusOnly vehicles in this state.
branchOnly vehicles of this branch (its uuid).
updated_sinceOnly vehicles changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
classOnly vehicles whose type belongs to this class (its code, as the vehicle's class field shows it).
typeOnly vehicles of this type (its code, as the vehicle's type field shows it).
makeOnly vehicles of this make (its code, as make_code shows it).
modelOnly vehicles of this model (its code, as model_code shows it); a model code is read inside its make, so make is required with it.
year_fromOnly vehicles built in this year or later.
year_toOnly vehicles built in this year or earlier; not before year_from.
plate_numberOnly vehicles whose plate digits are exactly these (1 to 8 digits, as plate_number shows them); several vehicles may share digits with different letters.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of vehicles.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "status": "active",
            "sequence_number": "123456789",
            "plate_number": "1234",
            "plate_right_letter": "أ",
            "plate_middle_letter": "ب",
            "plate_left_letter": "ج",
            "plate_type": 1,
            "latin_plate": null,
            "vin": "WDB9634031L123456",
            "make": "Mercedes-Benz",
            "make_code": "mercedes_benz",
            "model": "Actros",
            "model_code": "actros",
            "model_version_code": "actros_mp4",
            "variant_code": "actros_1845_4x2",
            "manufacture_year": 2022,
            "type": "truck",
            "class": "heavy_truck",
            "category": "heavy",
            "body_type": "flatbed",
            "colour": "white",
            "ownership_type": "owned",
            "display_name": {
                "ar": "شاحنة 12",
                "en": "Truck 12"
            },
            "capacity_value": "20.000",
            "capacity_unit": "ton",
            "fuel_consumption_l_per_100km": "32.5",
            "equipment_serial_number": null,
            "hours_meter_reading": null,
            "coupling_type": "fifth_wheel",
            "max_combination_weight_kg": 44000,
            "thumbnail_url": "https://api.example.com/api/v1/vehicles/0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11/photo/thumbnail",
            "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
            "legal_operator_uuid": "7a9c3d2e-1b44-4a6f-9c5d-6e8f0a1b2c33",
            "archived_at": null,
            "created_at": "2026-03-01T08:30:00Z",
            "updated_at": "2026-05-12T11:05:42Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /vehicles

يتطلب مفتاحًا Register a vehicle

Registers a road vehicle of your company, as the panel does: the sequence number, the plate (number and three letters), the plate type and the legal operator by its uuid, optionally the VIN, the model year, the vehicle type code and the catalogue make and model by code. Every plate, sequence number, plan-limit, licence and identity check of the panel applies and a refusal answers 422 with the field; at most 30 registrations an hour for the company. Equipment, ownership, catalogue versions, branch and visibility are set in the panel. Requires the key scope `fleet:vehicles:register`, its owner's right to create vehicles, and an `Idempotency-Key` header. Requires the key scope `fleet:vehicles:register`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The vehicle that was registered.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "status": "active",
        "sequence_number": "123456789",
        "plate_number": "1234",
        "plate_right_letter": "أ",
        "plate_middle_letter": "ب",
        "plate_left_letter": "ج",
        "plate_type": 1,
        "latin_plate": null,
        "vin": "WDB9634031L123456",
        "make": "Mercedes-Benz",
        "make_code": "mercedes_benz",
        "model": "Actros",
        "model_code": "actros",
        "model_version_code": "actros_mp4",
        "variant_code": "actros_1845_4x2",
        "manufacture_year": 2022,
        "type": "truck",
        "class": "heavy_truck",
        "category": "heavy",
        "body_type": "flatbed",
        "colour": "white",
        "ownership_type": "owned",
        "display_name": {
            "ar": "شاحنة 12",
            "en": "Truck 12"
        },
        "capacity_value": "20.000",
        "capacity_unit": "ton",
        "fuel_consumption_l_per_100km": "32.5",
        "equipment_serial_number": null,
        "hours_meter_reading": null,
        "coupling_type": "fifth_wheel",
        "max_combination_weight_kg": 44000,
        "thumbnail_url": "https://api.example.com/api/v1/vehicles/0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11/photo/thumbnail",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "legal_operator_uuid": "7a9c3d2e-1b44-4a6f-9c5d-6e8f0a1b2c33",
        "archived_at": null,
        "created_at": "2026-03-01T08:30:00Z",
        "updated_at": "2026-05-12T11:05:42Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicles/{uuid}

يتطلب مفتاحًا Read a vehicle

Reads one of your company's vehicles by its uuid. A vehicle of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `vehicles:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The vehicle.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "status": "active",
        "sequence_number": "123456789",
        "plate_number": "1234",
        "plate_right_letter": "أ",
        "plate_middle_letter": "ب",
        "plate_left_letter": "ج",
        "plate_type": 1,
        "latin_plate": null,
        "vin": "WDB9634031L123456",
        "make": "Mercedes-Benz",
        "make_code": "mercedes_benz",
        "model": "Actros",
        "model_code": "actros",
        "model_version_code": "actros_mp4",
        "variant_code": "actros_1845_4x2",
        "manufacture_year": 2022,
        "type": "truck",
        "class": "heavy_truck",
        "category": "heavy",
        "body_type": "flatbed",
        "colour": "white",
        "ownership_type": "owned",
        "display_name": {
            "ar": "شاحنة 12",
            "en": "Truck 12"
        },
        "capacity_value": "20.000",
        "capacity_unit": "ton",
        "fuel_consumption_l_per_100km": "32.5",
        "equipment_serial_number": null,
        "hours_meter_reading": null,
        "coupling_type": "fifth_wheel",
        "max_combination_weight_kg": 44000,
        "thumbnail_url": "https://api.example.com/api/v1/vehicles/0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11/photo/thumbnail",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "legal_operator_uuid": "7a9c3d2e-1b44-4a6f-9c5d-6e8f0a1b2c33",
        "archived_at": null,
        "created_at": "2026-03-01T08:30:00Z",
        "updated_at": "2026-05-12T11:05:42Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

PUT /vehicles/{uuid}

يتطلب مفتاحًا Change a vehicle

Changes the descriptive fields of one of your company's vehicles, as the panel does. Send the `row_version` you read: a vehicle changed meanwhile, or a body without it, answers 409. The hours meter of equipment can only go up; a capacity cannot change while the vehicle holds a live market commitment. Plate, sequence number, VIN, identifier kind, legal operator, ownership, vehicle type, catalogue, branch and archive are changed in the panel and any such key is refused. `fuel_consumption_l_per_100km` only feeds the fuel estimate. Requires the key scope `fleet:vehicles:write`, its owner's right to update vehicles, and an `Idempotency-Key` header. Requires the key scope `fleet:vehicles:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The vehicle after the change.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "status": "active",
        "sequence_number": "123456789",
        "plate_number": "1234",
        "plate_right_letter": "أ",
        "plate_middle_letter": "ب",
        "plate_left_letter": "ج",
        "plate_type": 1,
        "latin_plate": null,
        "vin": "WDB9634031L123456",
        "make": "Mercedes-Benz",
        "make_code": "mercedes_benz",
        "model": "Actros",
        "model_code": "actros",
        "model_version_code": "actros_mp4",
        "variant_code": "actros_1845_4x2",
        "manufacture_year": 2022,
        "type": "truck",
        "class": "heavy_truck",
        "category": "heavy",
        "body_type": "flatbed",
        "colour": "white",
        "ownership_type": "owned",
        "display_name": {
            "ar": "شاحنة 12",
            "en": "Truck 12"
        },
        "capacity_value": "20.000",
        "capacity_unit": "ton",
        "fuel_consumption_l_per_100km": "32.5",
        "equipment_serial_number": null,
        "hours_meter_reading": null,
        "coupling_type": "fifth_wheel",
        "max_combination_weight_kg": 44000,
        "thumbnail_url": "https://api.example.com/api/v1/vehicles/0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11/photo/thumbnail",
        "branch_uuid": "5d1f0f4a-52f6-4e3b-8f8e-0c1f2b7e9a22",
        "legal_operator_uuid": "7a9c3d2e-1b44-4a6f-9c5d-6e8f0a1b2c33",
        "archived_at": null,
        "created_at": "2026-03-01T08:30:00Z",
        "updated_at": "2026-05-12T11:05:42Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicle-calendar

يتطلب مفتاحًا Read the vehicle calendar

For each vehicle of the company and each Saudi day from `from` to `until` (at most 62 days), what the vehicle holds that day: its trips (planned, live, late or finished) by uuid, whether the workshop holds it for the whole day, the plan or inspection that falls due, an open critical fault, the main driver's leave kind (only for a key that also holds the leave scope and an owner who may read leave) and whether it has a main driver; the kind of the day (finished, live, late, planned, workshop, leave, idle for a past day with no trip, free for a future one); and the fleet's use over the days that have come. Vehicles are named by uuid and plate; no driver is named. A stretch that would draw more than 20,000 vehicle-days is refused with 422. Requires the key scope `logistics:vehicle_calendar:read` and the rights to see trips and maintenance. Requires the key scope `logistics:vehicle_calendar:read`.

الترويسات

fromThe first day, Y-m-d.
untilThe last day, Y-m-d, not before the first and at most 62 days from it.
empty_onlyOnly the vehicles that have an empty day in the stretch.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The calendar.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "from": "2026-11-14",
        "until": "2026-11-20",
        "truncated": false,
        "figures": {
            "use_percent": 43,
            "worked_days": 6,
            "available_days": 14,
            "idle_days": 8,
            "in_workshop_today": 1,
            "due_soon": 2,
            "overdue": 1
        },
        "vehicles": [
            {
                "vehicle_uuid": "3c1e9a52-8d47-4b6a-a2f0-5e7d9b4c1a44",
                "plate": "ر س ط 7310",
                "overdue": false,
                "next_due_on": "2026-11-25",
                "days": [
                    {
                        "date": "2026-11-14",
                        "kind": "finished",
                        "available": true,
                        "trips": [
                            {
                                "trip_uuid": "9f1c2d3e-4b5a-6c7d-8e9f-0a1b2c3d4e5f",
                                "reference": "T-118",
                                "group": "finished",
                                "from": "2026-11-14T03:00:00Z",
                                "until": "2026-11-14T09:00:00Z"
                            }
                        ],
                        "workshop": false,
                        "due_kinds": [],
                        "fault": false,
                        "leave": null,
                        "has_driver": true
                    }
                ]
            }
        ]
    },
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-20T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicle-catalogue/makes

يتطلب مفتاحًا List vehicle makes

Lists the makes of the vehicle catalogue by code, one page at a time. Only active, reviewed makes are listed. Requires the key scope `vehicles:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of makes.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "code": "mercedes_benz",
            "name_ar": "مرسيدس بنز",
            "name_en": "Mercedes-Benz"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicle-catalogue/models

يتطلب مفتاحًا List vehicle models

Lists the models of the vehicle catalogue, one page at a time, each with the code of its make. Only active, reviewed models of active, reviewed makes are listed. Requires the key scope `vehicles:read`.

الترويسات

makeOnly the models of this make (its code).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of models.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "code": "actros",
            "make_code": "mercedes_benz",
            "name_ar": "أكتروس",
            "name_en": "Actros",
            "default_type_code": "tractor_unit"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicle-catalogue/types

يتطلب مفتاحًا List vehicle types

Lists the vehicle types of the catalogue by code, one page at a time, each with the code of its class. Only active, reviewed types are listed. Requires the key scope `vehicles:read`.

الترويسات

classOnly the types of this class (its code).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of types.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "code": "tractor_unit",
            "class_code": "heavy_truck",
            "name_ar": "رأس شاحنة",
            "name_en": "Tractor unit"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicle-catalogue/versions

يتطلب مفتاحًا List vehicle model versions

Lists the versions of the vehicle catalogue, one page at a time, each with the codes of its model and make and the years it was built. A version is identified by `make.model.version`. Only active, reviewed versions of active, reviewed models and makes are listed. Requires the key scope `vehicles:read`.

الترويسات

modelOnly the versions of this model, as `make.model`.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of versions.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "code": "mp4",
            "make_code": "mercedes_benz",
            "model_code": "actros",
            "name_ar": "الجيل الرابع",
            "name_en": "MP4",
            "year_from": 2011,
            "year_to": 2018
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicle-catalogue/variants

يتطلب مفتاحًا List vehicle variants

Lists the variants of the vehicle catalogue, one page at a time, each with the codes of its version, model and make and its technical figures. A variant is identified by `make.model.version.variant`. Only active, reviewed variants of active, reviewed versions, models and makes are listed. Requires the key scope `vehicles:read`.

الترويسات

versionOnly the variants of this version, as `make.model.version`.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of variants.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "code": "1845",
            "make_code": "mercedes_benz",
            "model_code": "actros",
            "version_code": "mp4",
            "name_ar": "1845",
            "name_en": "1845",
            "axle_configuration": "4x2",
            "axle_count": 2,
            "gross_weight_kg": 18000,
            "engine_displacement_cc": 12809,
            "engine_power_kw": "330.0",
            "fuel_type_code": "diesel",
            "cab_type": "sleeper"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicle-catalogue/classes

يتطلب مفتاحًا List vehicle classes

Lists the vehicle classes of the catalogue by code, one page at a time. Only active, reviewed classes are listed. Requires the key scope `vehicles:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of classes.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "code": "heavy_truck",
            "name_ar": "شاحنة ثقيلة",
            "name_en": "Heavy truck"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicle-catalogue/body-types

يتطلب مفتاحًا List body types

Lists the body types of the catalogue by code, one page at a time, with the flags that say a body is a tank, a vehicle carrier or refrigerated. Only active, reviewed body types are listed. Requires the key scope `vehicles:read`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of body types.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "code": "tanker",
            "name_ar": "صهريج",
            "name_en": "Tanker",
            "is_tank": true,
            "is_vehicle_carrier": false,
            "is_refrigerated": false
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /reports/comparison

يتطلب مفتاحًا Compare vehicles

Compares two to six of your vehicles over a period, measure by measure: distance, moving hours, idle hours, the idle share and trips; a key whose owner may see expenses also gets the expenses of each currency and the expenses per 10,000 km. The first vehicle is the reference; every other cell shows its change from it. A vehicle with no figure is unknown, never zero; a rate under its distance or engine floor says there is not enough; only rates of comparable vehicles are marked best. The period is in Saudi days, required and at most 366 days. Never a driver. Requires the key scope `reporting:reports_comparison:read`.

الترويسات

vehicles[]
fromStart of the period, ISO 8601 with an offset; its Saudi day is the first day.
toEnd of the period, after from and at most 366 days later; its Saudi day is excluded.
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The vehicles compared and one row per measure, a cell per vehicle; a vehicle with no data is unknown, never zero, and a total gets no verdict.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "period": {
            "from": "2026-05-01",
            "to": "2026-06-01"
        },
        "vehicles": [
            {
                "vehicle_uuid": "7c1d2e44-5b6a-4f0e-9a3b-1d2c3e4f5a66",
                "plate": "ABC 1234",
                "is_reference": true,
                "is_comparable": true,
                "warnings": []
            }
        ],
        "rows": [
            {
                "key": "idle_share",
                "currency": null,
                "is_rate": true,
                "better": "lower",
                "group_average": 14.2,
                "cells": [
                    {
                        "vehicle_uuid": "7c1d2e44-5b6a-4f0e-9a3b-1d2c3e4f5a66",
                        "state": "value",
                        "value": 12.5,
                        "is_best": true,
                        "change_percent": null,
                        "change_direction": null,
                        "change_verdict": null
                    }
                ]
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicle-days

يتطلب مفتاحًا List vehicle days

Lists, for each of your vehicles and each day on the platform calendar (Asia/Riyadh) from the day of from up to the day of to (excluded), the distance, the trips, how the time split between moving, idling with the engine on, parked and without signal, the top speed and the times of the first and last signal. Days are built overnight for the last closed days; a figure that was not recorded for a day is null, never zero. At most 31 days at a time, one page at a time, oldest day first. A branch-limited key sees only its own branch. A vehicle you sold or scrapped shows its days up to its sale day and none after it. Times are UTC; meta.timezone names the platform time zone. Requires the key scope `positions:read`.

الترويسات

fromStart of the window, ISO 8601 with an offset (e.g. 2026-06-01T00:00:00Z); the platform day it falls in is included.
toEnd of the window, after from and at most 31 days later; the platform day it falls in is excluded.
vehicleOnly the days of this vehicle (its uuid).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of vehicle days.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "day": "2026-06-01",
            "distance_m": 184200,
            "trip_count": 3,
            "moving_seconds": 14400,
            "idle_seconds": 1800,
            "parked_seconds": 58800,
            "no_signal_seconds": 3600,
            "max_speed_kmh": 96,
            "first_signal_at": "2026-06-01T02:10:00Z",
            "last_signal_at": "2026-06-01T20:55:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicles/{uuid}/documents

يتطلب مفتاحًا List the files of a vehicle

Lists the files attached to one of your company's vehicles, newest first, up to 200: the document's uuid, its kind (vehicle_registration, vehicle_photo or other), where it came from, and whether it is the approved public photo of the vehicle. It gives the metadata only, never the file, its name or its title. A vehicle of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `vehicles:read`.

الترويسات

uuid
kindOnly the files of this kind; vehicle_photo lists the photos.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The files of the vehicle.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "document_uuid": "1c9f4e82-7a35-4b60-8d12-5e3b0a7c9f46",
            "kind": "vehicle_photo",
            "origin": "person",
            "is_public_photo": true,
            "public_position": 1,
            "created_at": "2026-04-19T11:00:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 200,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /vehicles/{uuid}/documents

يتطلب مفتاحًا Attach a document to a vehicle

Attaches a PDF, JPEG or PNG to one of your company's vehicles as a registration copy or another vehicle document, as the panel does. Other kinds, driver files, photos and sale contracts are refused. The file is scanned before it is stored and an infected file or a scanner outage is refused (422), so the answer carries the document in its `state`, `available`; there is nothing to poll. A company may upload a limited number of bytes a day, and a key a limited number of files an hour, through the API (429 with the reason `daily_quota` or `hourly_uploads`). Requires the key scope `fleet:documents:write`, its owner's right to attach documents, and an `Idempotency-Key` header. Requires the key scope `fleet:documents:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The attached document; state is available once the scan is clean, otherwise pending.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "5e8f1a22-3b4c-4d6e-8a9b-0c1d2e3f4a55",
        "kind": "vehicle_registration",
        "state": "available",
        "mime_type": "application/pdf",
        "size_bytes": 184320,
        "created_at": "2026-06-01T09:00:00Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicles/{uuid}/facts

يتطلب مفتاحًا Read the facts of a vehicle

Reads what other parts of the platform say about one of your company's vehicles by its uuid, for example that it is out on hire until a date. The read is closed (404) until your administration opens it in the settings; a vehicle of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `vehicles:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The facts.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "9f1c6a3e-6d1b-4f6e-8f55-0a1b2c3d4e5f",
        "hire": {
            "on_hire": true,
            "ends_at": "2026-12-01T07:00:00Z",
            "reference": null
        }
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicles/{uuid}/now

يتطلب مفتاحًا Read what a vehicle is doing now

Reads the last known position of one of your vehicles by its uuid, with its speed, whether its engine ran, the time of the fix (UTC) and the state of the trip it is on, if any. A vehicle with no position yet answers 200 with has_position false and null fields. A vehicle of another company, or out of your scope, answers 404 exactly like one that does not exist. A vehicle sold earlier shows nothing after its sale day. Requires the key scope `positions:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The vehicle now.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "has_position": true,
        "latitude": 24.7136,
        "longitude": 46.6753,
        "speed_kmh": 62,
        "ignition": true,
        "fix_at": "2026-06-01T09:00:00Z",
        "trip_state": "in_progress"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:05Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicles/{uuid}/odometer-readings

يتطلب مفتاحًا List the odometer readings of a vehicle

Lists the odometer readings of one of your company's vehicles, newest first, one page at a time: the reading's uuid, the kilometres, when it was read (UTC), its source (manual, fuel_log, service, handover or handover_device: the last two are claims made at a hand-over, a device number a person confirmed is never a measurement) and the note the vehicle page shows to the same person. A reading that was withdrawn is listed with withdrawn=true. A vehicle of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `vehicles:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of odometer readings.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "1c9f4e82-7a35-4b60-8d12-5e3b0a7c9f46",
            "km": 125430.5,
            "read_at": "2026-06-01T08:00:00Z",
            "source": "manual",
            "note": null,
            "withdrawn": false
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /vehicles/{uuid}/odometer-readings

يتطلب مفتاحًا Record an odometer reading

Records a manual odometer reading of one of your company's vehicles, as the vehicle page does: not below an earlier reading, not above a later one, not in the future. The source is always manual. A reading cannot be withdrawn with a key. At most 12 readings an hour for one vehicle. A vehicle of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `fleet:odometer:write`. Requires the key scope `fleet:odometer:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The reading that was recorded.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "1c9f4e82-7a35-4b60-8d12-5e3b0a7c9f46",
        "km": 125430.5,
        "read_at": "2026-06-01T05:00:00Z",
        "source": "manual",
        "note": null,
        "withdrawn": false
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicles/{uuid}/overview

يتطلب مفتاحًا Read a vehicle's overview

This month's figures of one of your vehicles against last month, and what ends soon on it (inspection, maintenance, warranty, lease, registration, insurance, operation card, inspection certificate): a label, a day and the days left. It never carries a position, a driver's name, a document number or the vehicle's activity. Another company's or branch's vehicle is a 404. Requires the key scope `fleet:overview:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The overview.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "tiles": [
            {
                "label": "Distance",
                "value": "1,240 km",
                "change": "+8%",
                "sentence": "Against last month"
            }
        ],
        "expiring": [
            {
                "label": "Registration",
                "detail": "Ends 2026-12-20",
                "days": 36
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-14T10:00:00+00:00"
    }
}
404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicles/{uuid}/photos

يتطلب مفتاحًا List the photos of a vehicle

Lists the photos of one of your company's vehicles, at most 50: the photo's id, whether it is approved for the public market, and its place among the approved ones. No file, link or name is returned and no route reads the file by this id with a key. Requires the key scope `fleet:vehicle_photos:read`. Requires the key scope `fleet:vehicle_photos:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The photos of the vehicle.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "id": "5c1e0b7a-4f2d-4a8e-9b63-0d2f7a9c1e55",
            "state": "approved",
            "position": 1
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z"
    }
}
401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /vehicles/{uuid}/photo/thumbnail

يتطلب مفتاحًا Get the main photo of a vehicle as a thumbnail

Returns the main photo of one of your company's vehicles as a small jpeg: the first approved photo, else the first added. The optional `width` is 160, 320 (default) or 640 pixels for the longer side. Only this reduced copy is served, never the original file. Requires the key scope `fleet:vehicle_photos:read`. Requires the key scope `fleet:vehicle_photos:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /reports/vehicle-profit

يتطلب مفتاحًا Read the vehicle profitability report

Lists, for each of your vehicles, what it earned and cost in the period: delivered and unpriced orders, revenue, fuel, maintenance, expenses, the daily allowance of its drivers, the margin, its percent of the earnings and the distance. Money is a list of lines, one per currency, never added across currencies. Other income, roadside help and depreciation appear only for a key whose owner may also see them, and so do the net profit after lease, depreciation, roadside help and insurance and its percent. The period is whole Saudi days, at most a year; no driver is named. Requires the key scope `reporting:reports_vehicle_profit:read`.

الترويسات

fromStart of the period, ISO 8601 with an offset.
toEnd of the period, after from and at most 366 days later; its Saudi day is included.
vehicleOnly this vehicle (its uuid).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 One page of vehicles; a figure the key owner may not see is absent.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "vehicle_uuid": "7c1d2e44-5b6a-4f0e-9a3b-1d2c3e4f5a6b",
            "plate": "ABC 1234",
            "delivered_orders": 12,
            "unpriced_orders": 0,
            "distance_km": 4210.5,
            "revenue": [
                {
                    "currency": "SAR",
                    "amount": "36000.00"
                }
            ],
            "fuel": [
                {
                    "currency": "SAR",
                    "amount": "9100.00"
                }
            ],
            "maintenance": [],
            "expenses": [
                {
                    "currency": "SAR",
                    "amount": "800.00"
                }
            ],
            "per_diem": {
                "amounts": [
                    {
                        "currency": "SAR",
                        "amount": "1200.00"
                    }
                ],
                "days_without_rate": 0
            },
            "lease": [],
            "margin": [
                {
                    "currency": "SAR",
                    "amount": "24900.00"
                }
            ],
            "margin_percent": [
                {
                    "currency": "SAR",
                    "percent": "69.2"
                }
            ]
        }
    ],
    "meta": {
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /vehicles/{uuid}/archive

يتطلب مفتاحًا Archive a vehicle

Archives one of your company's vehicles, as the panel does: it leaves the active lists and cannot be put back by a key. A vehicle that still has an open driver assignment, a device installed, a trip in progress or a live booking on the transport market, or is already archived, answers 422. Send `confirm` set to true. A vehicle of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `fleet:vehicles:register`, its owner's right to archive vehicles, and an `Idempotency-Key` header. Requires the key scope `fleet:vehicles:register`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The vehicle that was archived.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "archived": true
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /video/clips

يتطلب مفتاحًا Send a camera clip or snapshot

Stores the video clip or the still picture of a camera event you already sent to /video/events. Send multipart/form-data with the event_id of that event, kind (clip or snapshot), captured_at (ISO 8601 with a zone, within ten minutes of the event), optionally camera_channel (1 to 8, default 1) and duration_seconds (clips only, 1 to 300), and the file: an MP4 for a clip, a JPEG or PNG for a snapshot. The file is recognised by its content, scanned and stored encrypted; it is kept for the company's retention period from its capture and then deleted for good. One event holds one clip and one snapshot per camera channel: sending the same bytes again answers 200 with the stored clip, other bytes answer 409 idempotency_conflict. A refusal stores nothing: 403 forbidden when the company has not enabled video, the plan does not include it or the month's clips are used; 413 payload_too_large; 422 validation_failed with a detail per field, an unknown event, a file that is not what its kind says or is infected, or a clip that would be deleted within the hour; 503 service_unavailable while the scanner or the storage cannot answer, so send it again later.

الترويسات

X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

جسم الطلب

event_idمطلوبThe id you gave the event when you sent it.
kindمطلوبclip (an MP4) or snapshot (a JPEG or PNG).
captured_atمطلوبWhen the footage starts, ISO 8601 with a zone.
fileمطلوبThe file itself.
مثال
{
    "event_id": "evt-2026-11-07-0001",
    "kind": "clip",
    "captured_at": "2026-11-07T08:15:20Z"
}

الردود

200 The same clip was already stored; nothing new is written.
مثال
{
    "success": true,
    "data": {
        "clip_id": "0198a3c2-7e1d-7a40-9c11-2f0c5d6b8a10",
        "kind": "clip",
        "status": "available",
        "bytes": 4850231,
        "retention_until": "2026-12-07T08:15:20Z"
    },
    "error": null,
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-11-07T08:20:00Z"
    }
}
201 The clip is stored.
مثال
{
    "success": true,
    "data": {
        "clip_id": "0198a3c2-7e1d-7a40-9c11-2f0c5d6b8a10",
        "kind": "clip",
        "status": "available",
        "bytes": 4850231,
        "retention_until": "2026-12-07T08:15:20Z"
    },
    "error": null,
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-11-07T08:16:00Z"
    }
}
401 unauthenticated: the source token is missing, expired or revoked.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "unauthenticated",
        "message": "Authentication is required."
    },
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-11-07T08:16:00Z"
    }
}
409 idempotency_conflict: this event already holds other bytes in that slot.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "idempotency_conflict",
        "message": "The idempotency key was already used with a different body."
    },
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-11-07T08:16:00Z"
    }
}
422 validation_failed: one detail per invalid field, or a refused file.
مثال
{
    "success": false,
    "data": null,
    "error": {
        "code": "validation_failed",
        "message": "The request contains invalid fields.",
        "details": [
            {
                "field": "file",
                "code": "invalid_format",
                "message": "This value has an invalid format."
            }
        ]
    },
    "meta": {
        "request_id": "7f3c9a1e-2b4d-4c8e-9f10-000000000000",
        "timestamp": "2026-11-07T08:16:00Z"
    }
}
429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /violations

يتطلب مفتاحًا List violations

Lists your company's traffic violations, oldest first, one page of at most 50. Every call is recorded in the violations read log with the number of rows and the key; if it cannot be recorded nothing is returned (503). A day's rows are capped per key and per company (429). The driver, the ticket file and who recorded a violation are never shown. Requires the key scope `fleet:violations:read`.

الترويسات

statusOnly violations in this state: new, objected, objection_accepted, objection_rejected, paid or cancelled.
vehicleOnly the violations of this vehicle (its uuid).
updated_sinceOnly violations changed at or after this moment (ISO 8601 with an offset).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 One page of violations, oldest first; next_cursor is null on the last page.
مثال
{
    "success": true,
    "data": [
        {
            "uuid": "3c9a1d7e-5b24-4e80-9f61-7d2a0c8b4e15",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "authority": "traffic",
            "type_code": "speeding",
            "number": "4100236571",
            "occurred_at": "2026-05-12T08:30:00Z",
            "place": "Riyadh, King Fahd Road",
            "amount_minor": 30000,
            "currency": "SAR",
            "due_on": "2026-06-12",
            "status": "new",
            "paid_on": null,
            "created_at": "2026-05-12T12:00:00Z",
            "updated_at": "2026-05-12T12:00:00Z",
            "row_version": 1
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /violations

يتطلب مفتاحًا Record a traffic violation

Records a violation on one of your company's vehicles, as the panel does: its number, who issued it, its type, when it happened (Saudi time, not in the future), the amount and the optional due day. The company's rules apply exactly as in the panel. A driver, a place, a ticket file and a receipt cannot be sent. Send an Idempotency-Key header so a retry does not record it twice. Requires the key scope `fleet:violations:write`. Requires the key scope `fleet:violations:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The violation that was recorded, with its version.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "status": "new",
        "row_version": 1
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /violations/{uuid}

يتطلب مفتاحًا Read a violation

Reads one of your company's traffic violations by its uuid; the read is recorded in the violations read log and counts one row of the day's budget. A record of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `fleet:violations:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The violation.
مثال
{
    "success": true,
    "data": {
        "uuid": "3c9a1d7e-5b24-4e80-9f61-7d2a0c8b4e15",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "authority": "traffic",
        "type_code": "speeding",
        "number": "4100236571",
        "occurred_at": "2026-05-12T08:30:00Z",
        "place": "Riyadh, King Fahd Road",
        "amount_minor": 30000,
        "currency": "SAR",
        "due_on": "2026-06-12",
        "status": "new",
        "paid_on": null,
        "created_at": "2026-05-12T12:00:00Z",
        "updated_at": "2026-05-12T12:00:00Z",
        "row_version": 1
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

PUT /violations/{uuid}

يتطلب مفتاحًا Correct a traffic violation

Corrects the number, issuer, type, time, amount or due day of a violation that has not been paid or cancelled, as the panel does. Send the `row_version` you read: a violation changed meanwhile answers 409. The driver stays as it is. Requires the key scope `fleet:violations:write`. Requires the key scope `fleet:violations:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The violation, corrected.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "status": "new",
        "row_version": 2
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /violations/{uuid}/pay

يتطلب مفتاحًا Mark a violation paid

Marks a violation still owed as paid, as the panel does: paid by the company it becomes one fines expense, paid by the driver it makes none. A different amount needs a `difference_note`. A receipt file cannot be sent here: when your company requires one for the amount the answer is 422 with reason `receipt_required` and the payment is made in the panel. A stale `row_version` or a violation not owed gives 409. Requires the key scope `fleet:violation_payments:write`, an owner who may settle violations and did not record this one, and an `Idempotency-Key` header. Requires the key scope `fleet:violation_payments:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The violation, now paid.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3c9a1d7e-5b24-4e80-9f61-7d2a0c8b4e15",
        "status": "paid",
        "paid_on": "2026-11-17",
        "row_version": 2
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-11-17T09:00:00Z"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /violations/{uuid}/reopen-payment

يتطلب مفتاحًا Reopen the payment of a violation

Reopens a violation that was marked paid by mistake, with a reason, as the panel does: the fines expense that payment made is voided, an expense that was only linked stays, and the violation is owed again. Send the `row_version` you read: a violation changed meanwhile answers 409. The panel's own rule decides who may reopen. Requires the key scope `fleet:violation_payments:write`. Requires the key scope `fleet:violation_payments:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The violation, owed again.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3c9a1d7e-5b24-4e80-9f61-7d2a0c8b4e15",
        "status": "new",
        "paid_on": null,
        "row_version": 3
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /violations/{uuid}/cancel

يتطلب مفتاحًا Cancel a traffic violation

Cancels a violation with a reason; the row stays, shown as cancelled. Send the `row_version` you read: a violation changed meanwhile answers 409. Requires the key scope `fleet:violations:write`. Requires the key scope `fleet:violations:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The violation, now cancelled.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "status": "cancelled",
        "row_version": 2
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /violations/{uuid}/object

يتطلب مفتاحًا Record an objection to a traffic violation

Records that the company objected to a violation, with the day it was lodged and why, as the panel does. Send the `row_version` you read. Requires the key scope `fleet:violations:write`. Requires the key scope `fleet:violations:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The violation, now objected to.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "status": "objected",
        "row_version": 2
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /violations/{uuid}/objection-outcome

يتطلب مفتاحًا Record the answer to an objection

Records the authority's answer to an objection: accepted (nothing is owed) or rejected (owed again), with the day of the answer and an optional note, as the panel does. Send the `row_version` you read. Requires the key scope `fleet:violations:write`. Requires the key scope `fleet:violations:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The violation with its new state.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "status": "objection_accepted",
        "row_version": 3
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /webhook-deliveries

يتطلب مفتاحًا List webhook deliveries

Lists the events sent, or waiting to be sent, to your company's webhook addresses, one page at a time, oldest first, with how each fared: its state, how many tries it took, the last HTTP status or failure code and when it was delivered. It never shows what the event carried. A delivery is kept for the retention period (30 days unless the platform sets another) and then disappears. Times are UTC. Requires the key scope `platform:webhooks:manage`.

الترويسات

endpointOnly deliveries to this webhook address (its uuid).
statusOnly deliveries in this state: queued, sending, delivered or abandoned.
event_typeOnly deliveries of this event type, e.g. trip.status_changed.
created_sinceOnly deliveries of events from this moment on (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of webhook deliveries.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "8b2e6f40-1c93-4d57-a0e8-6f3b9c1d2a75",
            "endpoint_uuid": "3f1c8a52-7d4e-4b9a-8c26-5e0d1a9b7c34",
            "event_type": "trip.status_changed",
            "status": "delivered",
            "attempt_count": 2,
            "created_at": "2026-06-01T07:40:00Z",
            "next_attempt_at": "2026-06-01T07:40:00Z",
            "delivered_at": "2026-06-01T07:41:12Z",
            "last_http_status": 200,
            "last_failure_code": null
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /webhook-deliveries/{uuid}

يتطلب مفتاحًا Read a webhook delivery

Reads one delivery by its own uuid with each try made at it: when it started, how long it took, and the HTTP status or the failure code. It never shows what the event carried or what your server answered. A delivery of another company, of an address the Tawasul team made, one past its retention period, or one that does not exist answers 404 in the same way. Times are UTC. Requires the key scope `platform:webhooks:manage`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The webhook delivery with its tries.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "8b2e6f40-1c93-4d57-a0e8-6f3b9c1d2a75",
        "endpoint_uuid": "3f1c8a52-7d4e-4b9a-8c26-5e0d1a9b7c34",
        "event_type": "trip.status_changed",
        "status": "delivered",
        "attempt_count": 2,
        "created_at": "2026-06-01T07:40:00Z",
        "next_attempt_at": "2026-06-01T07:40:00Z",
        "delivered_at": "2026-06-01T07:41:12Z",
        "last_http_status": 200,
        "last_failure_code": null,
        "attempt_log": [
            {
                "attempt_no": 1,
                "started_at": "2026-06-01T07:40:01Z",
                "duration_ms": 840,
                "http_status": 502,
                "failure_code": "http_502"
            },
            {
                "attempt_no": 2,
                "started_at": "2026-06-01T07:41:11Z",
                "duration_ms": 215,
                "http_status": 200,
                "failure_code": null
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /webhook-deliveries/{uuid}/replay

يتطلب مفتاحًا Replay a webhook delivery

Sends a delivered or given-up delivery again to the same webhook address as a new delivery, queued at once and signed with the address's current secret. The receiver sees a new delivery id in X-Twi-Delivery and the original's in X-Twi-Replay-Of, so it can tell the repeat from the first send. The body is the original event as it was kept. Only a delivered or abandoned delivery of an active address can be replayed (409 with reason not_finished or endpoint_not_active); a delivery older than 30 days cannot be replayed (replay_expired); a test delivery or a replay cannot (not_replayable); one delivery can be replayed 3 times (replay_limit) and one address takes 20 replays an hour (429). Replay the original, not a replay. The Idempotency-Key header is required. Requires the key scope `platform:webhooks:manage`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The new delivery, queued, with no tries yet.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "8b2e6f40-1c93-4d57-a0e8-6f3b9c1d2a75",
        "endpoint_uuid": "3f1c8a52-7d4e-4b9a-8c26-5e0d1a9b7c34",
        "event_type": "trip.status_changed",
        "status": "delivered",
        "attempt_count": 2,
        "created_at": "2026-06-01T07:40:00Z",
        "next_attempt_at": "2026-06-01T07:40:00Z",
        "delivered_at": "2026-06-01T07:41:12Z",
        "last_http_status": 200,
        "last_failure_code": null,
        "attempt_log": [
            {
                "attempt_no": 1,
                "started_at": "2026-06-01T07:40:01Z",
                "duration_ms": 840,
                "http_status": 502,
                "failure_code": "http_502"
            },
            {
                "attempt_no": 2,
                "started_at": "2026-06-01T07:41:11Z",
                "duration_ms": 215,
                "http_status": 200,
                "failure_code": null
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /webhook-endpoints

يتطلب مفتاحًا List webhook addresses

Lists the webhook addresses your company added in the portal, one page at a time, oldest first. Each shows its name, where it points (the address with its query string, and any long token-like part of its path, replaced by ***), the events it listens to, whether it is pending, active, paused or disabled, why it is paused, and when it last succeeded or failed. It never shows a signing secret. Addresses the Tawasul team made for your company are not listed. Times are UTC; meta.timezone names the platform time zone. Requires the key scope `platform:webhooks:manage`.

الترويسات

statusOnly addresses in this state: pending, active, paused or disabled.
updated_sinceOnly addresses changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of webhook addresses.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "3f1c8a52-7d4e-4b9a-8c26-5e0d1a9b7c34",
            "name": "Fleet feed",
            "url": "https://hooks.example.com/twi/events?***",
            "events": [
                "trip.status_changed",
                "alert.opened"
            ],
            "status": "paused",
            "paused_reason": "manual",
            "paused_at": "2026-06-01T07:42:10Z",
            "consecutive_failures": 0,
            "last_success_at": "2026-05-31T22:10:03Z",
            "last_failure_at": null,
            "approved_at": "2026-05-20T09:00:00Z",
            "updated_at": "2026-06-01T07:42:10Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /webhook-endpoints/{uuid}

يتطلب مفتاحًا Read a webhook address

Reads one of your company's webhook addresses by its own uuid. An address of another company, one the Tawasul team made, or one that does not exist answers 404 in the same way. Times are UTC. Requires the key scope `platform:webhooks:manage`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The webhook address.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3f1c8a52-7d4e-4b9a-8c26-5e0d1a9b7c34",
        "name": "Fleet feed",
        "url": "https://hooks.example.com/twi/events?***",
        "events": [
            "trip.status_changed",
            "alert.opened"
        ],
        "status": "paused",
        "paused_reason": "manual",
        "paused_at": "2026-06-01T07:42:10Z",
        "consecutive_failures": 0,
        "last_success_at": "2026-05-31T22:10:03Z",
        "last_failure_at": null,
        "approved_at": "2026-05-20T09:00:00Z",
        "updated_at": "2026-06-01T07:42:10Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /webhook-endpoints/{uuid}/pause

يتطلب مفتاحًا Pause a webhook address

Stops sending events to one of your company's active webhook addresses; the events that happen meanwhile wait in the queue. Only an active address can be paused: any other state answers 409 with reason not_active. The company's admins are told that a key did it. Resume it with the resume call. The Idempotency-Key header is required, so a repeated call is safe. Requires the key scope `platform:webhooks:manage`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The webhook address, now paused.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3f1c8a52-7d4e-4b9a-8c26-5e0d1a9b7c34",
        "name": "Fleet feed",
        "url": "https://hooks.example.com/twi/events?***",
        "events": [
            "trip.status_changed",
            "alert.opened"
        ],
        "status": "paused",
        "paused_reason": "manual",
        "paused_at": "2026-06-01T07:42:10Z",
        "consecutive_failures": 0,
        "last_success_at": "2026-05-31T22:10:03Z",
        "last_failure_at": null,
        "approved_at": "2026-05-20T09:00:00Z",
        "updated_at": "2026-06-01T07:42:10Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /webhook-endpoints/{uuid}/resume

يتطلب مفتاحًا Resume a webhook address

Starts sending to one of your company's paused addresses again and counts its failures from zero. Set abandon_queued to true to give up the events queued while it was paused instead of sending them now (they cannot be recovered afterwards except by sending each again). Only a paused address can be resumed: any other state answers 409 with reason not_paused. The company's admins are told that a key did it. The Idempotency-Key header is required. Requires the key scope `platform:webhooks:manage`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The webhook address, now active.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "3f1c8a52-7d4e-4b9a-8c26-5e0d1a9b7c34",
        "name": "Fleet feed",
        "url": "https://hooks.example.com/twi/events?***",
        "events": [
            "trip.status_changed",
            "alert.opened"
        ],
        "status": "paused",
        "paused_reason": "manual",
        "paused_at": "2026-06-01T07:42:10Z",
        "consecutive_failures": 0,
        "last_success_at": "2026-05-31T22:10:03Z",
        "last_failure_at": null,
        "approved_at": "2026-05-20T09:00:00Z",
        "updated_at": "2026-06-01T07:42:10Z"
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /webhook-endpoints/{uuid}/test

يتطلب مفتاحًا Send a test event to a webhook address

Sends one signed test event (type webhook.test, a fixed message) to one of your company's active addresses at once and answers with the delivery it made, with its single try. A test is never retried and does not count towards the address's failures. Only an active address can be tested: any other state answers 409 with reason not_active. At most 10 tests an hour per address, and 5 a minute; beyond that the answer is 429. The Idempotency-Key header is required. Requires the key scope `platform:webhooks:manage`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The test delivery with its try.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "8b2e6f40-1c93-4d57-a0e8-6f3b9c1d2a75",
        "endpoint_uuid": "3f1c8a52-7d4e-4b9a-8c26-5e0d1a9b7c34",
        "event_type": "trip.status_changed",
        "status": "delivered",
        "attempt_count": 2,
        "created_at": "2026-06-01T07:40:00Z",
        "next_attempt_at": "2026-06-01T07:40:00Z",
        "delivered_at": "2026-06-01T07:41:12Z",
        "last_http_status": 200,
        "last_failure_code": null,
        "attempt_log": [
            {
                "attempt_no": 1,
                "started_at": "2026-06-01T07:40:01Z",
                "duration_ms": 840,
                "http_status": 502,
                "failure_code": "http_502"
            },
            {
                "attempt_no": 2,
                "started_at": "2026-06-01T07:41:11Z",
                "duration_ms": 215,
                "http_status": 200,
                "failure_code": null
            }
        ]
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /maintenance/work-orders

يتطلب مفتاحًا List maintenance work orders

Lists your company's maintenance work orders, oldest first, one page at a time. Each carries the vehicle and plan by uuid, its type, state, odometer and a summary (free text as typed) and the parts and labour cost in minor units, which is empty when the cost cannot be held in the order's currency (empty means unknown, not free); notes, the workshop and cancellation reasons are never shown. A branch-limited key sees only the work orders of the vehicles that are currently in its branch. Requires the key scope `maintenance:read`.

الترويسات

statusOnly work orders in this state: open, in_progress, done or cancelled.
vehicleOnly the maintenance work orders of this vehicle (its uuid).
updated_sinceOnly maintenance work orders changed at or after this moment (ISO 8601 with an offset, e.g. 2026-05-01T00:00:00Z).
limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of maintenance work orders.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "6c3f8b24-1e79-4a50-b3d6-9a2e7f4c1d08",
            "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
            "plan_uuid": "2a7d9e41-5c63-4b18-9f20-8d1e4a6c3b99",
            "maintenance_type": "preventive",
            "category_code": "oil_change",
            "responsibility": "company",
            "summary": "Oil and filter change",
            "status": "done",
            "awaiting_approval": false,
            "expected_done_on": "2026-05-12",
            "failure_cause_code": null,
            "vehicle_stopped": null,
            "out_of_service_at": null,
            "returned_to_service_at": null,
            "workshop_uuid": "8e1c2d3f-6a47-4b90-9d15-2f3a4b5c6d77",
            "workshop_type": "internal",
            "odometer_km": 130250,
            "parts_cost_minor": 18500,
            "labour_cost_minor": 6000,
            "currency": "SAR",
            "started_at": "2026-05-12T08:00:00Z",
            "done_at": "2026-05-12T11:30:00Z",
            "cancelled_at": null,
            "created_at": "2026-05-10T09:00:00Z",
            "updated_at": "2026-05-12T11:30:00Z",
            "row_version": 3
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh",
        "page": {
            "limit": 50,
            "next_cursor": null
        }
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/work-orders

يتطلب مفتاحًا Open a maintenance work order

Opens a work order on one of your company's vehicles, as the panel does: what is wrong, its type and category and, for a breakdown, whether the vehicle stopped and since when. A body with a cost, labour or parts field is refused; the costs and the finishing are entered in the panel. Requires the key scope `fleet:maintenance:write`, its owner's right to manage maintenance, and an `Idempotency-Key` header. Requires the key scope `fleet:maintenance:write`.

الترويسات

limitPage size, 1 to 200.
cursormeta.page.next_cursor of the previous page; leave it out for the first page. A cursor that is refused (422) is no longer valid, for example because its record left your view: start again from the first page.
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

201 The work order that was opened.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6c3f8b24-1e79-4a50-b3d6-9a2e7f4c1d08",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "plan_uuid": "2a7d9e41-5c63-4b18-9f20-8d1e4a6c3b99",
        "maintenance_type": "preventive",
        "category_code": "oil_change",
        "responsibility": "company",
        "summary": "Oil and filter change",
        "status": "done",
        "awaiting_approval": false,
        "expected_done_on": "2026-05-12",
        "failure_cause_code": null,
        "vehicle_stopped": null,
        "out_of_service_at": null,
        "returned_to_service_at": null,
        "workshop_uuid": "8e1c2d3f-6a47-4b90-9d15-2f3a4b5c6d77",
        "workshop_type": "internal",
        "odometer_km": 130250,
        "parts_cost_minor": 18500,
        "labour_cost_minor": 6000,
        "currency": "SAR",
        "started_at": "2026-05-12T08:00:00Z",
        "done_at": "2026-05-12T11:30:00Z",
        "cancelled_at": null,
        "created_at": "2026-05-10T09:00:00Z",
        "updated_at": "2026-05-12T11:30:00Z",
        "row_version": 3
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

422 validation_failed: a filter, the limit or the cursor is not valid.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /maintenance/work-orders/{uuid}

يتطلب مفتاحًا Read a maintenance work order

Reads one of your company's maintenance work orders by its uuid. A record of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `maintenance:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The maintenance work order.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6c3f8b24-1e79-4a50-b3d6-9a2e7f4c1d08",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "plan_uuid": "2a7d9e41-5c63-4b18-9f20-8d1e4a6c3b99",
        "maintenance_type": "preventive",
        "category_code": "oil_change",
        "responsibility": "company",
        "summary": "Oil and filter change",
        "status": "done",
        "awaiting_approval": false,
        "expected_done_on": "2026-05-12",
        "failure_cause_code": null,
        "vehicle_stopped": null,
        "out_of_service_at": null,
        "returned_to_service_at": null,
        "workshop_uuid": "8e1c2d3f-6a47-4b90-9d15-2f3a4b5c6d77",
        "workshop_type": "internal",
        "odometer_km": 130250,
        "parts_cost_minor": 18500,
        "labour_cost_minor": 6000,
        "currency": "SAR",
        "started_at": "2026-05-12T08:00:00Z",
        "done_at": "2026-05-12T11:30:00Z",
        "cancelled_at": null,
        "created_at": "2026-05-10T09:00:00Z",
        "updated_at": "2026-05-12T11:30:00Z",
        "row_version": 3
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/work-orders/{uuid}/complete

يتطلب مفتاحًا Finish a maintenance work order

Finishes an open or in-progress work order and writes its labour cost, as the panel does, with the same rules: the odometer may not go backwards, a breakdown needs its category and cause, and a breakdown that stopped the vehicle needs the time it returned. When your company approves finished repairs, the order then waits for approval and the answer says `awaiting_approval`. The parts cost is never sent: it stays the sum of the part lines. It works only when your company turned on the setting «a key may finish a work order», otherwise it answers 403 with the reason `feature_off`. Send the `row_version` you read; a changed, frozen or finished order answers 409. Requires the key scope `fleet:work_orders:complete` and an `Idempotency-Key` header. Requires the key scope `fleet:work_orders:complete`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

جسم الطلب

row_versionمطلوبThe version of the work order you read.
labour_costمطلوبThe labour cost as a decimal string in the order's currency; it must be sent, 0 included.
done_onاختياريThe day it was finished, YYYY-MM-DD, not in the future; today when left out.
odometer_kmاختياريThe odometer in kilometres at the finish.
categoryاختياريThe code of the maintenance category.
causeاختياريThe code of the failure cause, for a breakdown.
returned_to_service_atاختياريWhen the vehicle returned to service, ISO 8601 with an offset, for a breakdown that stopped it.
مثال
{
    "row_version": 2,
    "labour_cost": "150.00",
    "done_on": "2026-06-01",
    "odometer_km": "125430.5",
    "category": "brake",
    "cause": "wear",
    "returned_to_service_at": "2026-06-01T15:00:00+03:00"
}

الردود

200 The work order, finished or awaiting approval.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6c3f8b24-1e79-4a50-b3d6-9a2e7f4c1d08",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "plan_uuid": "2a7d9e41-5c63-4b18-9f20-8d1e4a6c3b99",
        "maintenance_type": "preventive",
        "category_code": "oil_change",
        "responsibility": "company",
        "summary": "Oil and filter change",
        "status": "done",
        "awaiting_approval": false,
        "expected_done_on": "2026-05-12",
        "failure_cause_code": null,
        "vehicle_stopped": null,
        "out_of_service_at": null,
        "returned_to_service_at": null,
        "workshop_uuid": "8e1c2d3f-6a47-4b90-9d15-2f3a4b5c6d77",
        "workshop_type": "internal",
        "odometer_km": 130250,
        "parts_cost_minor": 18500,
        "labour_cost_minor": 6000,
        "currency": "SAR",
        "started_at": "2026-05-12T08:00:00Z",
        "done_at": "2026-05-12T11:30:00Z",
        "cancelled_at": null,
        "created_at": "2026-05-10T09:00:00Z",
        "updated_at": "2026-05-12T11:30:00Z",
        "row_version": 3
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

GET /maintenance/work-orders/{uuid}/parts

يتطلب مفتاحًا List the parts of a maintenance work order

Lists the part lines of one of your company's work orders, oldest first, one page at a time: each line is an issue to the order or a return from it, with the part and the signed quantity; never a cost, a reason or a person. A work order of another company or branch answers 404 exactly like one that does not exist. Requires the key scope `maintenance:read`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 A page of part lines.

Cache-Control

مثال
{
    "success": true,
    "data": [
        {
            "uuid": "5e7f9a21-3b4c-4d68-9e0a-1f2b3c4d5e66",
            "work_order_uuid": "6c3f8b24-1e79-4a50-b3d6-9a2e7f4c1d08",
            "part_uuid": "3c5d8e12-4f6a-4b79-8a21-7d9e0f1b2c34",
            "part_number": "OF-1234",
            "kind": "issue",
            "quantity": "2.000",
            "created_at": "2026-05-12T09:15:00Z"
        }
    ],
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/work-orders/{uuid}/start

يتطلب مفتاحًا Start a maintenance work order

Marks an open work order as started. Send the `row_version` you read: a work order changed meanwhile answers 409. Requires the key scope `fleet:maintenance:write` and an `Idempotency-Key` header. Requires the key scope `fleet:maintenance:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The work order, now in progress.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6c3f8b24-1e79-4a50-b3d6-9a2e7f4c1d08",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "plan_uuid": "2a7d9e41-5c63-4b18-9f20-8d1e4a6c3b99",
        "maintenance_type": "preventive",
        "category_code": "oil_change",
        "responsibility": "company",
        "summary": "Oil and filter change",
        "status": "done",
        "awaiting_approval": false,
        "expected_done_on": "2026-05-12",
        "failure_cause_code": null,
        "vehicle_stopped": null,
        "out_of_service_at": null,
        "returned_to_service_at": null,
        "workshop_uuid": "8e1c2d3f-6a47-4b90-9d15-2f3a4b5c6d77",
        "workshop_type": "internal",
        "odometer_km": 130250,
        "parts_cost_minor": 18500,
        "labour_cost_minor": 6000,
        "currency": "SAR",
        "started_at": "2026-05-12T08:00:00Z",
        "done_at": "2026-05-12T11:30:00Z",
        "cancelled_at": null,
        "created_at": "2026-05-10T09:00:00Z",
        "updated_at": "2026-05-12T11:30:00Z",
        "row_version": 3
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/work-orders/{uuid}/cancel

يتطلب مفتاحًا Cancel a maintenance work order

Cancels a work order that is not finished; the parts issued to it go back to their warehouses. A cancelled order is final. Send the `row_version` you read and the reason. Requires the key scope `fleet:maintenance:write` and an `Idempotency-Key` header. Requires the key scope `fleet:maintenance:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The work order, now cancelled.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6c3f8b24-1e79-4a50-b3d6-9a2e7f4c1d08",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "plan_uuid": "2a7d9e41-5c63-4b18-9f20-8d1e4a6c3b99",
        "maintenance_type": "preventive",
        "category_code": "oil_change",
        "responsibility": "company",
        "summary": "Oil and filter change",
        "status": "done",
        "awaiting_approval": false,
        "expected_done_on": "2026-05-12",
        "failure_cause_code": null,
        "vehicle_stopped": null,
        "out_of_service_at": null,
        "returned_to_service_at": null,
        "workshop_uuid": "8e1c2d3f-6a47-4b90-9d15-2f3a4b5c6d77",
        "workshop_type": "internal",
        "odometer_km": 130250,
        "parts_cost_minor": 18500,
        "labour_cost_minor": 6000,
        "currency": "SAR",
        "started_at": "2026-05-12T08:00:00Z",
        "done_at": "2026-05-12T11:30:00Z",
        "cancelled_at": null,
        "created_at": "2026-05-10T09:00:00Z",
        "updated_at": "2026-05-12T11:30:00Z",
        "row_version": 3
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-06-01T09:00:00Z",
        "timezone": "Asia/Riyadh"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/work-orders/{uuid}/approve

يتطلب مفتاحًا Approve a finished repair

Approves a work order the workshop reported as finished: it closes on the day reported, the odometer reading and the plan's next cycle are recorded and the defects it fixed are resolved, as in the panel. Send the `row_version` you read: a changed order answers 409. An order cannot be approved with the key of the person who submitted it. Requires the key scope `fleet:repair_approval:write` and an owner who may approve repairs. Requires the key scope `fleet:repair_approval:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The work order, now done.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6c3f8b24-1e79-4a50-b3d6-9a2e7f4c1d08",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "plan_uuid": "2a7d9e41-5c63-4b18-9f20-8d1e4a6c3b99",
        "maintenance_type": "preventive",
        "category_code": "oil_change",
        "responsibility": "company",
        "summary": "Oil and filter change",
        "status": "done",
        "awaiting_approval": false,
        "expected_done_on": "2026-05-12",
        "failure_cause_code": null,
        "vehicle_stopped": null,
        "out_of_service_at": null,
        "returned_to_service_at": null,
        "workshop_uuid": "8e1c2d3f-6a47-4b90-9d15-2f3a4b5c6d77",
        "workshop_type": "internal",
        "odometer_km": 130250,
        "parts_cost_minor": 18500,
        "labour_cost_minor": 6000,
        "currency": "SAR",
        "started_at": "2026-05-12T08:00:00Z",
        "done_at": "2026-05-12T11:30:00Z",
        "cancelled_at": null,
        "created_at": "2026-05-10T09:00:00Z",
        "updated_at": "2026-05-12T11:30:00Z",
        "row_version": 3
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-05-12T07:30:00+00:00"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

POST /maintenance/work-orders/{uuid}/rework

يتطلب مفتاحًا Send a finished repair back

Returns a work order that waits for approval to the workshop with the reason; it is in progress again and the vehicle is no longer back in service. Send the `row_version` you read: a changed order answers 409. Requires the key scope `fleet:repair_approval:write` and an owner who may approve repairs. Requires the key scope `fleet:repair_approval:write`.

الترويسات

uuid
X-Request-IdOptional correlation id, echoed in the header and in meta.request_id.

الردود

200 The work order, in progress again.

Cache-Control

مثال
{
    "success": true,
    "data": {
        "uuid": "6c3f8b24-1e79-4a50-b3d6-9a2e7f4c1d08",
        "vehicle_uuid": "0b6f6d0e-6a3c-4a53-9d0a-3b0e8f6c1a11",
        "plan_uuid": "2a7d9e41-5c63-4b18-9f20-8d1e4a6c3b99",
        "maintenance_type": "preventive",
        "category_code": "oil_change",
        "responsibility": "company",
        "summary": "Oil and filter change",
        "status": "done",
        "awaiting_approval": false,
        "expected_done_on": "2026-05-12",
        "failure_cause_code": null,
        "vehicle_stopped": null,
        "out_of_service_at": null,
        "returned_to_service_at": null,
        "workshop_uuid": "8e1c2d3f-6a47-4b90-9d15-2f3a4b5c6d77",
        "workshop_type": "internal",
        "odometer_km": 130250,
        "parts_cost_minor": 18500,
        "labour_cost_minor": 6000,
        "currency": "SAR",
        "started_at": "2026-05-12T08:00:00Z",
        "done_at": "2026-05-12T11:30:00Z",
        "cancelled_at": null,
        "created_at": "2026-05-10T09:00:00Z",
        "updated_at": "2026-05-12T11:30:00Z",
        "row_version": 3
    },
    "error": null,
    "meta": {
        "request_id": "req-1",
        "timestamp": "2026-05-12T07:30:00+00:00"
    }
}
403 forbidden: the key lacks the scope this call needs, or its owner may not see this resource; api_not_in_plan: your plan has no API access.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

401 unauthenticated: the key is missing, expired or revoked.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

404 not_found: no such record for this key (a record of another company or branch answers the same).

شكل الخطأ الموحّد، انظر دليل الأخطاء.

429 rate_limited

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.

503 service_unavailable

Retry-After Seconds to wait before retrying.

شكل الخطأ الموحّد، انظر دليل الأخطاء.