Fleet API

Fleet drivers, vehicles, documents, assignments and dispatch.

Interactive test consolePaste a dedicated development token below. It stays in this browser tab and is sent only to the API endpoint you test.
Frontend integration guide

Use the endpoint cards below as the source of truth for request methods, authentication and test payloads. Keep credentials in secure storage and send bearer tokens only over HTTPS.

Required availability order
  1. POST /api/v1/driver/location with current GPS. Location freshness is checked by readiness.
  2. PATCH /api/v1/driver/dispatch-preferences. Manual without a range: {"offerMode":"MANUAL","usePickupRadius":false}. Range-bound auto-accept: {"offerMode":"AUTO","usePickupRadius":true,"pickupRadiusKm":10}.
  3. GET /api/v1/driver/readiness; show and resolve every blocker.
  4. PATCH /api/v1/driver/status with {"status":"ONLINE"}.
  5. Connect Socket.IO for the entire app session, then render offers and trip changes from events.

Auto-accept rule: it is disabled by default and never unbounded. The driver sets the pickup range themselves. Enabling AUTO without an enabled range returns 409 AUTO_ACCEPT_REQUIRES_PICKUP_RANGE. To turn the range off, switch to MANUAL in the same update. The server, not the app timer, decides eligibility and acceptance.

Live activity: connect Socket.IO with auth.token = accessToken. In MANUAL mode, treat driver:trip_offer as an interrupting offer, fetch GET /driver/offers for display/recovery details, and count down to expiresAt; then call POST /driver/offers/:id/respond. In AUTO mode, render trip:state_updated as the confirmation that the range-qualified offer was assigned. Handle driver:trip_offer_expired, driver:trip_offer_retracted and message:received. After every reconnect, refetch active offers, active trips and messages.

Mutating requests should include a unique Idempotency-Key. Render API status and error codes explicitly, and refetch state after reconnecting.

REST response contract

Every response is JSON: { success, data, error }. When success is true, read data. When it is false, use error.code for app logic and error.message for safe UI text.

HTTPMeaningFrontend action
200Request succeeded.Render data.
201Resource created.Persist its returned ID/state.
202Accepted for asynchronous work.Show pending; it is not authentication.
400Invalid request or business rule.Show error.message and field details.
401Token missing, expired or invalid.Refresh session or sign in.
403Access denied.Do not retry.
404Unavailable or hidden resource.Return safely and refresh state.
409State conflict/duplicate/expired resource.Refetch; do not blindly retry.
422Semantically invalid input.Highlight the field.
429Rate limited.Back off, respecting Retry-After.
500Unexpected server failure.Offer a safe retry.

Stable codes: VALIDATION_ERROR, UNAUTHORIZED, FORBIDDEN, NOT_FOUND, TRIP_ACCESS_DENIED, RIDER_ACTION_RATE_LIMITED and OTP_RATE_LIMITED. Each endpoint guide adds any relevant business codes.

Money and JSON format

All NGN monetary fields ending in Minor are expressed in kobo, not naira. For example, 246500 means NGN 2,465; divide by 100 for display. JSON body editors are automatically pretty-printed when valid JSON is entered.

PATCH/api/v1/fleets/me/provider-code
Bearer token

Set the Fleet's unique 3-letter driver-ID provider code

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

Replace angle-bracket values with returned values. Use the raw access token only in the Authorization header.

Node.js

const response = await fetch(BASE_URL + '/api/v1/fleets/me/provider-code', {
  method: 'PATCH',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <access-token>',
    'Idempotency-Key': crypto.randomUUID()
  },
  body: JSON.stringify({"providerCode":"ABC"})
});
const result = await response.json();

Python

payload = json.loads(r'''{"providerCode":"ABC"}''')
response = requests.patch(BASE_URL + '/api/v1/fleets/me/provider-code',
    headers={'Idempotency-Key': str(uuid.uuid4())},
    json=payload)
result = response.json()

PHP

$payload = <<<'JSON'
{"providerCode":"ABC"}
JSON;
$ch = curl_init($baseUrl . '/api/v1/fleets/me/provider-code');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'PATCH',
  CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Idempotency-Key: <uuid>'],
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_RETURNTRANSFER => true,
]);

cURL

curl -X PATCH '<base-url>/api/v1/fleets/me/provider-code' \
  -H 'Authorization: Bearer <access-token>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <uuid>' \
  --data '{"providerCode":"ABC"}'
Request
Response
HTTP 200 · FIXED TEST RESPONSE
{
  "success": true,
  "data": {
    "id": "FLT_b1fe6573-3a25-4d13-b41e-55143176d849",
    "providerCode": "ABC"
  },
  "error": null
}
POST/api/v1/fleets/me/drivers
Bearer token

Create and invite a driver; returns CRZ-{CODE}-0001

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

Replace angle-bracket values with returned values. Use the raw access token only in the Authorization header.

Node.js

const response = await fetch(BASE_URL + '/api/v1/fleets/me/drivers', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <access-token>',
    'Idempotency-Key': crypto.randomUUID()
  },
  body: JSON.stringify({"firstName":"John","lastName":"Doe","phone":"+2349054568692","email":"[email protected]"})
});
const result = await response.json();

Python

payload = json.loads(r'''{"firstName":"John","lastName":"Doe","phone":"+2349054568692","email":"[email protected]"}''')
response = requests.post(BASE_URL + '/api/v1/fleets/me/drivers',
    headers={'Idempotency-Key': str(uuid.uuid4())},
    json=payload)
result = response.json()

PHP

$payload = <<<'JSON'
{"firstName":"John","lastName":"Doe","phone":"+2349054568692","email":"[email protected]"}
JSON;
$ch = curl_init($baseUrl . '/api/v1/fleets/me/drivers');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Idempotency-Key: <uuid>'],
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_RETURNTRANSFER => true,
]);

cURL

curl -X POST '<base-url>/api/v1/fleets/me/drivers' \
  -H 'Authorization: Bearer <access-token>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <uuid>' \
  --data '{"firstName":"John","lastName":"Doe","phone":"+2349054568692","email":"[email protected]"}'
Request
Response
HTTP 201 · FIXED TEST RESPONSE
{
  "success": true,
  "data": {
    "id": "DRV_2e3149da-835d-4fdc-8d5e-02a5d6c7d55e",
    "assignedId": "CRZ-ABC-0001",
    "invitationSent": true,
    "firstName": "John",
    "lastName": "Doe",
    "phone": "+2349054568692"
  },
  "error": null
}
GET/api/v1/fleets/me/drivers
Bearer token

List fleet drivers and assigned IDs

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

Replace angle-bracket values with returned values. Use the raw access token only in the Authorization header.

Node.js

const response = await fetch(BASE_URL + '/api/v1/fleets/me/drivers', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <access-token>',
    'Idempotency-Key': crypto.randomUUID()
  },
  body: JSON.stringify({})
});
const result = await response.json();

Python

payload = json.loads(r'''{}''')
response = requests.get(BASE_URL + '/api/v1/fleets/me/drivers',
    headers={'Idempotency-Key': str(uuid.uuid4())},
    json=payload)
result = response.json()

PHP

$payload = <<<'JSON'
{}
JSON;
$ch = curl_init($baseUrl . '/api/v1/fleets/me/drivers');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Idempotency-Key: <uuid>'],
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_RETURNTRANSFER => true,
]);

cURL

curl -X GET '<base-url>/api/v1/fleets/me/drivers' \
  -H 'Authorization: Bearer <access-token>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <uuid>' \
  --data '{}'
Request
Response
HTTP 200 · FIXED TEST RESPONSE
{
  "success": true,
  "data": [
    {
      "id": "2e3149da-835d-4fdc-8d5e-02a5d6c7d55e",
      "assigned_id": "CRZ-ABC-0001",
      "first_name": "John",
      "last_name": "Doe",
      "status": "OFFLINE"
    }
  ],
  "error": null
}
POST/api/v1/fleets/me/drivers/:id/documents
Bearer token

Upload one driver compliance document (multipart)

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

This endpoint uses multipart/form-data. Send the selected image using the exact field name file; do not manually set the multipart Content-Type boundary.

Node.js

const form = new FormData();
form.append('onboardingToken', '<onboarding-token>');
form.append('file', fileInput.files[0]);
const response = await fetch('/api/v1/fleets/me/drivers/:id/documents', { method: 'POST', body: form });
const result = await response.json();

Python

with open('profile.jpg', 'rb') as photo:
    response = requests.post(BASE_URL + '/api/v1/fleets/me/drivers/:id/documents',
        data={'onboardingToken': '<onboarding-token>'},
        files={'file': ('profile.jpg', photo, 'image/jpeg')})
result = response.json()

PHP

$payload = [
  'onboardingToken' => '<onboarding-token>',
  'file' => new CURLFile('/path/to/profile.jpg', 'image/jpeg'),
];
$ch = curl_init($baseUrl . '/api/v1/fleets/me/drivers/:id/documents');
curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_POSTFIELDS => $payload, CURLOPT_RETURNTRANSFER => true]);

cURL

curl -X POST '<base-url>/api/v1/fleets/me/drivers/:id/documents' \
  -F 'onboardingToken=<onboarding-token>' \
  -F 'file=@/path/to/profile.jpg;type=image/jpeg'
Request
Response
HTTP 201 · FIXED TEST RESPONSE
{
  "success": true,
  "data": {
    "id": "driver-doc-1",
    "type": "DRIVER_LICENSE",
    "status": "PENDING_REVIEW"
  },
  "error": null
}
POST/api/v1/fleets/me/drivers/:id/documents/batch
Bearer token

Upload up to 10 driver documents in one request (multipart)

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

This endpoint uses multipart/form-data. Send the selected image using the exact field name file; do not manually set the multipart Content-Type boundary.

Node.js

const form = new FormData();
form.append('onboardingToken', '<onboarding-token>');
form.append('file', fileInput.files[0]);
const response = await fetch('/api/v1/fleets/me/drivers/:id/documents/batch', { method: 'POST', body: form });
const result = await response.json();

Python

with open('profile.jpg', 'rb') as photo:
    response = requests.post(BASE_URL + '/api/v1/fleets/me/drivers/:id/documents/batch',
        data={'onboardingToken': '<onboarding-token>'},
        files={'file': ('profile.jpg', photo, 'image/jpeg')})
result = response.json()

PHP

$payload = [
  'onboardingToken' => '<onboarding-token>',
  'file' => new CURLFile('/path/to/profile.jpg', 'image/jpeg'),
];
$ch = curl_init($baseUrl . '/api/v1/fleets/me/drivers/:id/documents/batch');
curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_POSTFIELDS => $payload, CURLOPT_RETURNTRANSFER => true]);

cURL

curl -X POST '<base-url>/api/v1/fleets/me/drivers/:id/documents/batch' \
  -F 'onboardingToken=<onboarding-token>' \
  -F 'file=@/path/to/profile.jpg;type=image/jpeg'
Request
Response
HTTP 201 · FIXED TEST RESPONSE
{
  "success": true,
  "data": [
    {
      "id": "driver-doc-1",
      "type": "DRIVER_LICENSE",
      "status": "PENDING_REVIEW"
    },
    {
      "id": "driver-doc-2",
      "type": "DRIVER_ID",
      "status": "PENDING_REVIEW"
    }
  ],
  "error": null
}
PATCH/api/v1/fleets/me/drivers/:driverId/documents/:documentId/review
Bearer token

Reserved compatibility route; platform compliance performs all evidence decisions

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

Replace angle-bracket values with returned values. Use the raw access token only in the Authorization header.

Node.js

const response = await fetch(BASE_URL + '/api/v1/fleets/me/drivers/:driverId/documents/:documentId/review', {
  method: 'PATCH',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <access-token>',
    'Idempotency-Key': crypto.randomUUID()
  },
  body: JSON.stringify({"decision":"APPROVED","note":"This request returns ADMIN_REVIEW_REQUIRED"})
});
const result = await response.json();

Python

payload = json.loads(r'''{"decision":"APPROVED","note":"This request returns ADMIN_REVIEW_REQUIRED"}''')
response = requests.patch(BASE_URL + '/api/v1/fleets/me/drivers/:driverId/documents/:documentId/review',
    headers={'Idempotency-Key': str(uuid.uuid4())},
    json=payload)
result = response.json()

PHP

$payload = <<<'JSON'
{"decision":"APPROVED","note":"This request returns ADMIN_REVIEW_REQUIRED"}
JSON;
$ch = curl_init($baseUrl . '/api/v1/fleets/me/drivers/:driverId/documents/:documentId/review');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'PATCH',
  CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Idempotency-Key: <uuid>'],
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_RETURNTRANSFER => true,
]);

cURL

curl -X PATCH '<base-url>/api/v1/fleets/me/drivers/:driverId/documents/:documentId/review' \
  -H 'Authorization: Bearer <access-token>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <uuid>' \
  --data '{"decision":"APPROVED","note":"This request returns ADMIN_REVIEW_REQUIRED"}'
Request
Response
HTTP 200 · FIXED TEST RESPONSE
{
  "success": true,
  "data": {
    "id": "driver-doc-1",
    "status": "APPROVED"
  },
  "error": null
}
POST/api/v1/fleets/me/vehicles
Bearer token

Register a vehicle for Admin approval

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

Replace angle-bracket values with returned values. Use the raw access token only in the Authorization header.

Node.js

const response = await fetch(BASE_URL + '/api/v1/fleets/me/vehicles', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <access-token>',
    'Idempotency-Key': crypto.randomUUID()
  },
  body: JSON.stringify({"vin":"1HGCM82633A004352","plateNumber":"RIV-123-AB","brand":"Toyota","model":"Corolla","year":2024,"color":"White"})
});
const result = await response.json();

Python

payload = json.loads(r'''{"vin":"1HGCM82633A004352","plateNumber":"RIV-123-AB","brand":"Toyota","model":"Corolla","year":2024,"color":"White"}''')
response = requests.post(BASE_URL + '/api/v1/fleets/me/vehicles',
    headers={'Idempotency-Key': str(uuid.uuid4())},
    json=payload)
result = response.json()

PHP

$payload = <<<'JSON'
{"vin":"1HGCM82633A004352","plateNumber":"RIV-123-AB","brand":"Toyota","model":"Corolla","year":2024,"color":"White"}
JSON;
$ch = curl_init($baseUrl . '/api/v1/fleets/me/vehicles');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Idempotency-Key: <uuid>'],
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_RETURNTRANSFER => true,
]);

cURL

curl -X POST '<base-url>/api/v1/fleets/me/vehicles' \
  -H 'Authorization: Bearer <access-token>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <uuid>' \
  --data '{"vin":"1HGCM82633A004352","plateNumber":"RIV-123-AB","brand":"Toyota","model":"Corolla","year":2024,"color":"White"}'
Request
Response
HTTP 201 · FIXED TEST RESPONSE
{
  "success": true,
  "data": {
    "id": "VEH_2127456d-32d1-439d-9d01-070e959babf9",
    "plate_number": "RIV-123-AB",
    "status": "PENDING_REVIEW"
  },
  "error": null
}
GET/api/v1/fleets/me/vehicles
Bearer token

List fleet vehicles

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

Replace angle-bracket values with returned values. Use the raw access token only in the Authorization header.

Node.js

const response = await fetch(BASE_URL + '/api/v1/fleets/me/vehicles', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <access-token>',
    'Idempotency-Key': crypto.randomUUID()
  },
  body: JSON.stringify({})
});
const result = await response.json();

Python

payload = json.loads(r'''{}''')
response = requests.get(BASE_URL + '/api/v1/fleets/me/vehicles',
    headers={'Idempotency-Key': str(uuid.uuid4())},
    json=payload)
result = response.json()

PHP

$payload = <<<'JSON'
{}
JSON;
$ch = curl_init($baseUrl . '/api/v1/fleets/me/vehicles');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Idempotency-Key: <uuid>'],
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_RETURNTRANSFER => true,
]);

cURL

curl -X GET '<base-url>/api/v1/fleets/me/vehicles' \
  -H 'Authorization: Bearer <access-token>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <uuid>' \
  --data '{}'
Request
Response
HTTP 200 · FIXED TEST RESPONSE
{
  "success": true,
  "data": [
    {
      "id": "VEH_2127456d-32d1-439d-9d01-070e959babf9",
      "plate_number": "RIV-123-AB",
      "brand": "Toyota",
      "model": "Corolla",
      "status": "AVAILABLE"
    }
  ],
  "error": null
}
POST/api/v1/fleets/me/vehicles/:id/documents
Bearer token

Upload one vehicle document for Admin approval (multipart)

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

This endpoint uses multipart/form-data. Send the selected image using the exact field name file; do not manually set the multipart Content-Type boundary.

Node.js

const form = new FormData();
form.append('onboardingToken', '<onboarding-token>');
form.append('file', fileInput.files[0]);
const response = await fetch('/api/v1/fleets/me/vehicles/:id/documents', { method: 'POST', body: form });
const result = await response.json();

Python

with open('profile.jpg', 'rb') as photo:
    response = requests.post(BASE_URL + '/api/v1/fleets/me/vehicles/:id/documents',
        data={'onboardingToken': '<onboarding-token>'},
        files={'file': ('profile.jpg', photo, 'image/jpeg')})
result = response.json()

PHP

$payload = [
  'onboardingToken' => '<onboarding-token>',
  'file' => new CURLFile('/path/to/profile.jpg', 'image/jpeg'),
];
$ch = curl_init($baseUrl . '/api/v1/fleets/me/vehicles/:id/documents');
curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_POSTFIELDS => $payload, CURLOPT_RETURNTRANSFER => true]);

cURL

curl -X POST '<base-url>/api/v1/fleets/me/vehicles/:id/documents' \
  -F 'onboardingToken=<onboarding-token>' \
  -F 'file=@/path/to/profile.jpg;type=image/jpeg'
Request
Response
HTTP 201 · FIXED TEST RESPONSE
{
  "success": true,
  "data": {
    "id": "vehicle-doc-1",
    "type": "VEHICLE_REGISTRATION",
    "status": "PENDING_REVIEW"
  },
  "error": null
}
POST/api/v1/fleets/me/vehicles/:id/documents/batch
Bearer token

Upload up to 10 vehicle documents in one request (multipart)

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

This endpoint uses multipart/form-data. Send the selected image using the exact field name file; do not manually set the multipart Content-Type boundary.

Node.js

const form = new FormData();
form.append('onboardingToken', '<onboarding-token>');
form.append('file', fileInput.files[0]);
const response = await fetch('/api/v1/fleets/me/vehicles/:id/documents/batch', { method: 'POST', body: form });
const result = await response.json();

Python

with open('profile.jpg', 'rb') as photo:
    response = requests.post(BASE_URL + '/api/v1/fleets/me/vehicles/:id/documents/batch',
        data={'onboardingToken': '<onboarding-token>'},
        files={'file': ('profile.jpg', photo, 'image/jpeg')})
result = response.json()

PHP

$payload = [
  'onboardingToken' => '<onboarding-token>',
  'file' => new CURLFile('/path/to/profile.jpg', 'image/jpeg'),
];
$ch = curl_init($baseUrl . '/api/v1/fleets/me/vehicles/:id/documents/batch');
curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_POSTFIELDS => $payload, CURLOPT_RETURNTRANSFER => true]);

cURL

curl -X POST '<base-url>/api/v1/fleets/me/vehicles/:id/documents/batch' \
  -F 'onboardingToken=<onboarding-token>' \
  -F 'file=@/path/to/profile.jpg;type=image/jpeg'
Request
Response
HTTP 201 · FIXED TEST RESPONSE
{
  "success": true,
  "data": [
    {
      "id": "vehicle-doc-1",
      "type": "VEHICLE_REGISTRATION",
      "status": "PENDING_REVIEW"
    },
    {
      "id": "vehicle-doc-2",
      "type": "VEHICLE_INSURANCE",
      "status": "PENDING_REVIEW"
    }
  ],
  "error": null
}
POST/api/v1/fleets/me/assignments
Bearer token

Assign an Admin-approved compliant vehicle to a driver

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

Replace angle-bracket values with returned values. Use the raw access token only in the Authorization header.

Node.js

const response = await fetch(BASE_URL + '/api/v1/fleets/me/assignments', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <access-token>',
    'Idempotency-Key': crypto.randomUUID()
  },
  body: JSON.stringify({"driverId":"DRV_<uuid>","vehicleId":"VEH_<uuid>"})
});
const result = await response.json();

Python

payload = json.loads(r'''{"driverId":"DRV_<uuid>","vehicleId":"VEH_<uuid>"}''')
response = requests.post(BASE_URL + '/api/v1/fleets/me/assignments',
    headers={'Idempotency-Key': str(uuid.uuid4())},
    json=payload)
result = response.json()

PHP

$payload = <<<'JSON'
{"driverId":"DRV_<uuid>","vehicleId":"VEH_<uuid>"}
JSON;
$ch = curl_init($baseUrl . '/api/v1/fleets/me/assignments');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Idempotency-Key: <uuid>'],
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_RETURNTRANSFER => true,
]);

cURL

curl -X POST '<base-url>/api/v1/fleets/me/assignments' \
  -H 'Authorization: Bearer <access-token>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <uuid>' \
  --data '{"driverId":"DRV_<uuid>","vehicleId":"VEH_<uuid>"}'
Request
Response
HTTP 201 · FIXED TEST RESPONSE
{
  "success": true,
  "data": {
    "id": "assignment-1",
    "driverId": "DRV_2e3149da-835d-4fdc-8d5e-02a5d6c7d55e",
    "vehicleId": "VEH_2127456d-32d1-439d-9d01-070e959babf9",
    "status": "ACTIVE"
  },
  "error": null
}
POST/api/v1/fleets/me/drivers/:id/notifications
Bearer token

Send a fleet notification to one linked driver

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

Replace angle-bracket values with returned values. Use the raw access token only in the Authorization header.

Node.js

const response = await fetch(BASE_URL + '/api/v1/fleets/me/drivers/:id/notifications', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <access-token>',
    'Idempotency-Key': crypto.randomUUID()
  },
  body: JSON.stringify({"type":"FLEET_MESSAGE","title":"Document reminder","body":"Please upload your renewed licence."})
});
const result = await response.json();

Python

payload = json.loads(r'''{"type":"FLEET_MESSAGE","title":"Document reminder","body":"Please upload your renewed licence."}''')
response = requests.post(BASE_URL + '/api/v1/fleets/me/drivers/:id/notifications',
    headers={'Idempotency-Key': str(uuid.uuid4())},
    json=payload)
result = response.json()

PHP

$payload = <<<'JSON'
{"type":"FLEET_MESSAGE","title":"Document reminder","body":"Please upload your renewed licence."}
JSON;
$ch = curl_init($baseUrl . '/api/v1/fleets/me/drivers/:id/notifications');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Idempotency-Key: <uuid>'],
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_RETURNTRANSFER => true,
]);

cURL

curl -X POST '<base-url>/api/v1/fleets/me/drivers/:id/notifications' \
  -H 'Authorization: Bearer <access-token>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <uuid>' \
  --data '{"type":"FLEET_MESSAGE","title":"Document reminder","body":"Please upload your renewed licence."}'
Request
Response
HTTP 201 · FIXED TEST RESPONSE
{
  "success": true,
  "data": {
    "id": "<created-id>",
    "status": "CREATED"
  },
  "error": null
}
POST/api/v1/fleets/me/notifications/drivers
Bearer token

Send a fleet notification to selected drivers

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

Replace angle-bracket values with returned values. Use the raw access token only in the Authorization header.

Node.js

const response = await fetch(BASE_URL + '/api/v1/fleets/me/notifications/drivers', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <access-token>',
    'Idempotency-Key': crypto.randomUUID()
  },
  body: JSON.stringify({"driverIds":["DRV_<uuid>"],"type":"FLEET_MESSAGE","title":"Operations update","body":"Please check in before 8am."})
});
const result = await response.json();

Python

payload = json.loads(r'''{"driverIds":["DRV_<uuid>"],"type":"FLEET_MESSAGE","title":"Operations update","body":"Please check in before 8am."}''')
response = requests.post(BASE_URL + '/api/v1/fleets/me/notifications/drivers',
    headers={'Idempotency-Key': str(uuid.uuid4())},
    json=payload)
result = response.json()

PHP

$payload = <<<'JSON'
{"driverIds":["DRV_<uuid>"],"type":"FLEET_MESSAGE","title":"Operations update","body":"Please check in before 8am."}
JSON;
$ch = curl_init($baseUrl . '/api/v1/fleets/me/notifications/drivers');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Idempotency-Key: <uuid>'],
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_RETURNTRANSFER => true,
]);

cURL

curl -X POST '<base-url>/api/v1/fleets/me/notifications/drivers' \
  -H 'Authorization: Bearer <access-token>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <uuid>' \
  --data '{"driverIds":["DRV_<uuid>"],"type":"FLEET_MESSAGE","title":"Operations update","body":"Please check in before 8am."}'
Request
Response
HTTP 201 · FIXED TEST RESPONSE
{
  "success": true,
  "data": {
    "id": "<created-id>",
    "status": "CREATED"
  },
  "error": null
}
PATCH/api/v1/fleets/me/features/:key
Bearer token

Configure pickup verification, auto-accept, offer countdown, readiness or cash-remittance policy

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

Replace angle-bracket values with returned values. Use the raw access token only in the Authorization header.

Node.js

const response = await fetch(BASE_URL + '/api/v1/fleets/me/features/:key', {
  method: 'PATCH',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <access-token>',
    'Idempotency-Key': crypto.randomUUID()
  },
  body: JSON.stringify({"enabled":true,"config":{"thresholdMinor":500000,"blockOnline":true}})
});
const result = await response.json();

Python

payload = json.loads(r'''{"enabled":true,"config":{"thresholdMinor":500000,"blockOnline":true}}''')
response = requests.patch(BASE_URL + '/api/v1/fleets/me/features/:key',
    headers={'Idempotency-Key': str(uuid.uuid4())},
    json=payload)
result = response.json()

PHP

$payload = <<<'JSON'
{"enabled":true,"config":{"thresholdMinor":500000,"blockOnline":true}}
JSON;
$ch = curl_init($baseUrl . '/api/v1/fleets/me/features/:key');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'PATCH',
  CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Idempotency-Key: <uuid>'],
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_RETURNTRANSFER => true,
]);

cURL

curl -X PATCH '<base-url>/api/v1/fleets/me/features/:key' \
  -H 'Authorization: Bearer <access-token>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <uuid>' \
  --data '{"enabled":true,"config":{"thresholdMinor":500000,"blockOnline":true}}'
Request
Response
HTTP 200 · FIXED TEST RESPONSE
{
  "success": true,
  "data": {
    "key": "driver_offer_timeout",
    "enabled": true,
    "config": {
      "seconds": 30
    }
  },
  "error": null
}
GET/api/v1/fleets/me/remittances
Bearer token

List driver remittances awaiting finance review

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

Replace angle-bracket values with returned values. Use the raw access token only in the Authorization header.

Node.js

const response = await fetch(BASE_URL + '/api/v1/fleets/me/remittances', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <access-token>',
    'Idempotency-Key': crypto.randomUUID()
  },
  body: JSON.stringify({})
});
const result = await response.json();

Python

payload = json.loads(r'''{}''')
response = requests.get(BASE_URL + '/api/v1/fleets/me/remittances',
    headers={'Idempotency-Key': str(uuid.uuid4())},
    json=payload)
result = response.json()

PHP

$payload = <<<'JSON'
{}
JSON;
$ch = curl_init($baseUrl . '/api/v1/fleets/me/remittances');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Idempotency-Key: <uuid>'],
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_RETURNTRANSFER => true,
]);

cURL

curl -X GET '<base-url>/api/v1/fleets/me/remittances' \
  -H 'Authorization: Bearer <access-token>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <uuid>' \
  --data '{}'
Request
Response
HTTP 200 · FIXED TEST RESPONSE
{
  "success": true,
  "data": [
    {
      "id": "6d87456d-32d1-439d-9d01-070e959babf9",
      "driver": {
        "id": "DRV_2e3149da-835d-4fdc-8d5e-02a5d6c7d55e",
        "assigned_id": "CRZ-ABC-0001"
      },
      "amountMinor": 50000,
      "status": "SUBMITTED"
    }
  ],
  "error": null
}
PATCH/api/v1/fleets/me/remittances/:id/review
Bearer token

Approve or reject a driver remittance

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

Replace angle-bracket values with returned values. Use the raw access token only in the Authorization header.

Node.js

const response = await fetch(BASE_URL + '/api/v1/fleets/me/remittances/:id/review', {
  method: 'PATCH',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <access-token>',
    'Idempotency-Key': crypto.randomUUID()
  },
  body: JSON.stringify({"decision":"APPROVED"})
});
const result = await response.json();

Python

payload = json.loads(r'''{"decision":"APPROVED"}''')
response = requests.patch(BASE_URL + '/api/v1/fleets/me/remittances/:id/review',
    headers={'Idempotency-Key': str(uuid.uuid4())},
    json=payload)
result = response.json()

PHP

$payload = <<<'JSON'
{"decision":"APPROVED"}
JSON;
$ch = curl_init($baseUrl . '/api/v1/fleets/me/remittances/:id/review');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'PATCH',
  CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Idempotency-Key: <uuid>'],
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_RETURNTRANSFER => true,
]);

cURL

curl -X PATCH '<base-url>/api/v1/fleets/me/remittances/:id/review' \
  -H 'Authorization: Bearer <access-token>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <uuid>' \
  --data '{"decision":"APPROVED"}'
Request
Response
HTTP 200 · FIXED TEST RESPONSE
{
  "success": true,
  "data": {
    "id": "6d87456d-32d1-439d-9d01-070e959babf9",
    "status": "APPROVED"
  },
  "error": null
}
GET/api/v1/fleets/me/monitoring/drivers
Bearer token

Monitor fleet drivers, locations and offline-trip alerts

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

Replace angle-bracket values with returned values. Use the raw access token only in the Authorization header.

Node.js

const response = await fetch(BASE_URL + '/api/v1/fleets/me/monitoring/drivers', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <access-token>',
    'Idempotency-Key': crypto.randomUUID()
  },
  body: JSON.stringify({})
});
const result = await response.json();

Python

payload = json.loads(r'''{}''')
response = requests.get(BASE_URL + '/api/v1/fleets/me/monitoring/drivers',
    headers={'Idempotency-Key': str(uuid.uuid4())},
    json=payload)
result = response.json()

PHP

$payload = <<<'JSON'
{}
JSON;
$ch = curl_init($baseUrl . '/api/v1/fleets/me/monitoring/drivers');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Idempotency-Key: <uuid>'],
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_RETURNTRANSFER => true,
]);

cURL

curl -X GET '<base-url>/api/v1/fleets/me/monitoring/drivers' \
  -H 'Authorization: Bearer <access-token>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <uuid>' \
  --data '{}'
Request
Response
HTTP 200 · FIXED TEST RESPONSE
{
  "success": true,
  "data": [
    {
      "id": "2e3149da-835d-4fdc-8d5e-02a5d6c7d55e",
      "first_name": "John",
      "last_name": "Doe",
      "status": "ONLINE",
      "last_seen_at": "2026-08-28T18:05:00.000Z",
      "activeTrip": null
    }
  ],
  "error": null
}
GET/api/v1/fleets/me/monitoring/drivers/:id
Bearer token

Monitor one driver and detect stale/offline activity

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

Replace angle-bracket values with returned values. Use the raw access token only in the Authorization header.

Node.js

const response = await fetch(BASE_URL + '/api/v1/fleets/me/monitoring/drivers/:id', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <access-token>',
    'Idempotency-Key': crypto.randomUUID()
  },
  body: JSON.stringify({})
});
const result = await response.json();

Python

payload = json.loads(r'''{}''')
response = requests.get(BASE_URL + '/api/v1/fleets/me/monitoring/drivers/:id',
    headers={'Idempotency-Key': str(uuid.uuid4())},
    json=payload)
result = response.json()

PHP

$payload = <<<'JSON'
{}
JSON;
$ch = curl_init($baseUrl . '/api/v1/fleets/me/monitoring/drivers/:id');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Idempotency-Key: <uuid>'],
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_RETURNTRANSFER => true,
]);

cURL

curl -X GET '<base-url>/api/v1/fleets/me/monitoring/drivers/:id' \
  -H 'Authorization: Bearer <access-token>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <uuid>' \
  --data '{}'
Request
Response
HTTP 200 · FIXED TEST RESPONSE
{
  "success": true,
  "data": {
    "id": "2e3149da-835d-4fdc-8d5e-02a5d6c7d55e",
    "status": "ONLINE",
    "last_seen_at": "2026-08-28T18:05:00.000Z",
    "trips": []
  },
  "error": null
}
GET/api/v1/fleets/me
Bearer token

Current fleet

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

Replace angle-bracket values with returned values. Use the raw access token only in the Authorization header.

Node.js

const response = await fetch(BASE_URL + '/api/v1/fleets/me', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <access-token>',
    'Idempotency-Key': crypto.randomUUID()
  },
  body: JSON.stringify({})
});
const result = await response.json();

Python

payload = json.loads(r'''{}''')
response = requests.get(BASE_URL + '/api/v1/fleets/me',
    headers={'Idempotency-Key': str(uuid.uuid4())},
    json=payload)
result = response.json()

PHP

$payload = <<<'JSON'
{}
JSON;
$ch = curl_init($baseUrl . '/api/v1/fleets/me');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Idempotency-Key: <uuid>'],
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_RETURNTRANSFER => true,
]);

cURL

curl -X GET '<base-url>/api/v1/fleets/me' \
  -H 'Authorization: Bearer <access-token>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <uuid>' \
  --data '{}'
Request
Response
HTTP 200 · FIXED TEST RESPONSE
{
  "success": true,
  "data": {
    "id": "FLT_b1fe6573-3a25-4d13-b41e-55143176d849",
    "name": "Cruz Fleet PH",
    "provider_code": "ABC",
    "status": "ACTIVE"
  },
  "error": null
}
POST/api/v1/trips/:id/dispatch
Bearer token

Assign an eligible driver

Endpoint guide What to send, parse and expect

Why it exists

Use this endpoint to perform the action described above.

Before you call

Use the method and authentication badge shown above. Replace every placeholder with a value returned by an earlier API call.

Request fields

The JSON editor contains a runnable example. Required field rules are returned as error.details.fieldErrors when validation fails.

What to parse

Check success first. On success, read data; on failure, render error.code and error.message.

Request structure and code samples Node.js · Python · PHP · cURL

Replace angle-bracket values with returned values. Use the raw access token only in the Authorization header.

Node.js

const response = await fetch(BASE_URL + '/api/v1/trips/:id/dispatch', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <access-token>',
    'Idempotency-Key': crypto.randomUUID()
  },
  body: JSON.stringify({})
});
const result = await response.json();

Python

payload = json.loads(r'''{}''')
response = requests.post(BASE_URL + '/api/v1/trips/:id/dispatch',
    headers={'Idempotency-Key': str(uuid.uuid4())},
    json=payload)
result = response.json()

PHP

$payload = <<<'JSON'
{}
JSON;
$ch = curl_init($baseUrl . '/api/v1/trips/:id/dispatch');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Idempotency-Key: <uuid>'],
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_RETURNTRANSFER => true,
]);

cURL

curl -X POST '<base-url>/api/v1/trips/:id/dispatch' \
  -H 'Authorization: Bearer <access-token>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <uuid>' \
  --data '{}'
Request
Response
HTTP 200 · FIXED TEST RESPONSE
{
  "success": true,
  "data": {
    "tripId": "TRIP_a40cd66e-e88f-4729-9f03-49d66aad7a12",
    "matchingState": "OFFERED",
    "attempt": {
      "id": "b2922938-1111-4222-8333-444455556666",
      "attemptNo": 1,
      "status": "OFFERED"
    }
  },
  "error": null
}
Errors and safetyResponses use JSON with a stable error code. Mutating requests receive an automatic idempotency key in the test console. Never paste production credentials here.