Skip to main content
GET
/
driver-assignments
List Driver Assignments
curl --request GET \
  --url https://api.inspecto.com/api/third-party/v1/driver-assignments \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "id": "<string>",
      "vehicleId": "<string>",
      "vehicle": {},
      "driverId": "<string>",
      "driver": {},
      "assignedAt": "<string>",
      "returnedAt": "<string>",
      "isActive": true,
      "assignedInspection": {},
      "returnedInspection": {},
      "notes": "<string>"
    }
  ]
}

Endpoint

GET /api/third-party/v1/driver-assignments

Authentication

Requires vehicles:read scope.

Query Parameters

page
integer
default:"1"
Page number
limit
integer
default:"50"
Items per page (max: 100)
vehicleId
string
Filter by vehicle ID (UUID)
driverId
string
Filter by driver ID (UUID)
active
boolean
Filter by active status (true for current assignments, false for returned)

Response

data
array
Array of driver assignment objects

Example Request

curl -X GET "https://api.inspecto.com/api/third-party/v1/driver-assignments?active=true" \
  -H "Authorization: Bearer insp_your_api_key_here"

Example Response

{
  "data": [
    {
      "id": "assignment-001",
      "vehicleId": "550e8400-e29b-41d4-a716-446655440000",
      "vehicle": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "plateNumber": "ABC-1234",
        "brand": "Mercedes-Benz",
        "model": "Actros",
        "type": "TRACTOR_UNIT"
      },
      "driverId": "driver-123",
      "driver": {
        "id": "driver-123",
        "firstName": "John",
        "lastName": "Doe",
        "email": "john.doe@company.com",
        "phoneNumber": "+48123456789"
      },
      "assignedAt": "2024-12-09T06:00:00Z",
      "returnedAt": null,
      "isActive": true,
      "assignedInspection": {
        "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
        "performedAt": "2024-12-09T06:00:00Z",
        "status": "COMPLETED"
      },
      "returnedInspection": null,
      "notes": "Route: Warsaw - Berlin"
    }
  ],
  "meta": {
    "version": "v1",
    "pagination": {
      "currentPage": 1,
      "totalPages": 2,
      "totalCount": 15,
      "hasNextPage": true,
      "hasPreviousPage": false
    },
    "filters": {
      "active": "true"
    }
  }
}

Use Cases

Current Assignments

Use active=true to see which drivers currently have which vehicles

Assignment History

Use active=false to see past assignments for auditing

Driver Tracking

Filter by driverId to see all vehicles assigned to a specific driver

Vehicle History

Filter by vehicleId to see all drivers who have used a vehicle