Optibus Operations API (2.8.1)

Download OpenAPI specification:

Welcome to the Optibus Operations API documentation!

Optibus Operations is a cloud-based software solution that enables public transport providers to optimize their operations, planning, and scheduling. Our API provides programmatic access to Optibus Operations' functionality, allowing you to integrate it with your own applications and systems.

Authentication

The Optibus Operations API requires authentication via a stable API_KEY sent in the HTTP request Authorization header in the form of Authorization: API_KEY. Additionally requests against our API expect the X-Optibus-Api-Client header to be set using your ACCOUNT_NAME.

If you are considering programmatic access the Optibus Operations platform, please contact your Optibus Customer Success Manager who can provide the API_KEY and ACCOUNT_NAME above, as well as your account-specific BASE_URL for the API endpoints documented below.

Example:

CURL -H "Authorization:API_KEY" -H 'X-Optibus-Api-Client: API_USER' https://BASE_URL/driver

Versioning

We may in the future make changes to the Optibus Operations API described on this page. This could be to fix bugs, enhance the richness of information made available in existing endpoints, or to introduce new API functionality via new endpoints.

The Optibus Operations team treats API changes in the following way:

  • we follow Semantic Versioning for the version number of the overall API as documented on this page. Individual endpoints may be provided with versions indicated as prefix such as /v{version}/{endpoint}. These endpoint specific numbers may lag behind the major version of the overall API, but will never exceed it.
  • we will NOT change existing API endpoints in a breaking way suddently. Breaking changes in this sense would be to
    • remove previously documented endpoints
    • remove previously documented properties in responses
    • change the type of documented properties in responses (e.g. number to string, or YYYY-MM-DD string to proper ISOtime string)
    • remove or change documented request parameters for endpoints
    • add new required request parameters to existing endpoints
  • we MAY without considering this a breaking change
    • add additional properties to response objects
    • add additional optional request parameters (e.g. new filtering options)
    • add new endpoints

In case we do introduce breaking changes to existing endpoints, this will happen in the following way:

  • we will add a new version of the affected endpoint, prepended with a version prefix with an increased version number. E.g. if we would make a breaking change to {baseURL}/v1/driver, we would introduce a new endpoint {baseURL}/v2/driver with adjusted behavior
  • may deprecate the old endpoint. We will wait at least 3 months after announcing such a change on this page before shutting down the deprecated endpoint
  • may consider the announcement of deprecation of an endpoint as a major change to the overall API version (as indicated in the title of this document) and increase the version number accordingly

HR System Integration Guides

This section gives step-by-step guides for common integration scenarios with external HR systems. For help with your particular integration scenario, please contact your Optibus Customer Success Manager.

Synchronizing Driver Information with an External HR System

External HR System ➡️ Optibus Operations

This use case details how to create and update driver information in Optibus when changes are made in your external HR system.

Process:

  1. Driver Creation in External HR System:

    When a new driver is created in your HR system, make a POST request to the /v2/drivers API endpoint.

    Example Request:

    POST /v2/drivers
    Authorization: <YOUR_API_TOKEN>
    Content-Type: application/json
    
    {
      "drivers": [
        {
          "id": "driver-id-001",
          "firstName": "John",
          "lastName": "Smith",
          "regionName": "North Region",
          "startDate": "2024-01-15",
          "emailAddress": "john.smith@example.com"
        }
      ]
    }
    

    Notes:

    • Each request is atomic - either all drivers are created successfully, or none are created.
    • Maximum 1000 drivers per request.
    • If startDate is provided, an initial employment period will be created automatically.
    • We recommend using the ID of the driver in the external HR system as the id field in the request, so that the driver has the same identifier in both of your systems.
  2. Driver Modification in External HR System:

    When an existing driver is edited in your HR system, make a PUT request to the /v2/drivers API endpoint.

    Example Request:

    PUT /v2/drivers
    Authorization: <YOUR_API_TOKEN>
    Content-Type: application/json
    
    {
      "drivers": [
        {
          "id": "driver-id-001",
          "firstName": "John",
          "lastName": "Smith-Jones",
          "emailAddress": "john.smithjones@example.com",
          "customAttributes": {
            "licenseNumber": "DL123456"
          }
        }
      ]
    }
    

    Notes:

    • This endpoint expects a full representation of the driver - omitting optional fields will clear them.
    • Maximum 1000 drivers per request.
    • PUT does not support startDate, regionName, depotName, or groupName fields.

Optibus Operations ➡️ External HR System

This use case describes how to regularly update an external HR system with driver information from Optibus using a recurring job (e.g., a cron job).

Process:

  1. Fetch Drivers from Optibus:

    Make a GET request to the /v2/drivers API endpoint. The response is paginated.

    Example Request:

    GET /v2/drivers?page=1&isEmployed=true
    Authorization: <YOUR_API_TOKEN>
    

    Example Response:

    {
      "drivers": [
        {
          "id": "driver-id-001",
          "firstName": "John",
          "lastName": "Smith",
          "emailAddress": "john.smith@example.com",
          "mainRegionPeriod": {
            "regionName": "North Region",
            "depotName": "Main Depot"
          },
          "customAttributes": {
            "licenseNumber": "DL123456"
          }
        }
      ],
      "pagination": {
        "currentPage": 1,
        "totalPages": 5
      }
    }
    
  2. Process Drivers:

    • For each driver in the drivers array, create or update the corresponding record in your HR system using the driver's id as the identifier.
    • If pagination.currentPage < pagination.totalPages, increment the page parameter and repeat until all pages are processed.

Synchronizing Driver Absences with an External HR System

External HR System ➡️ Optibus Operations

This use case details how to reflect changes made to driver absences in an external HR system within Optibus.

Process:

  1. Absence Creation in External HR System:

    • When a new absence is created in your HR system:
      • Assign a unique identifier to this absence. We recommend using UUIDs (Universally Unique Identifiers).
      • Make a POST request to the /v1/absences API endpoint.
      • The request body must be an array containing one or more absence objects. For a single creation, this will be an array with one element. Each absence object should include the unique absenceId, code (absence type), driverId, startDate, startTime, endDate, and endTime. Refer to the API documentation for the full list of required and optional parameters per absence object.
      • Note: times are represented as minutes from midnight (e.g., 540 = 09:00, 1020 = 17:00), in the local timezone of your operation.

    Example POST Request Body for Creating an Absence:

    [
      {
        "absenceId": "your-new-unique-uuid-string",
        "driverId": "driver-id-789",
        "code": "PERSONAL",
        "startDate": "2024-02-01",
        "startTime": 600, // 10:00
        "endDate": "2024-02-01",
        "endTime": 720, // 12:00
        "notes": "Personal appointment"
      }
    ]
    

    API Call:

    POST /v1/absences
    Authorization: <YOUR_API_TOKEN>
    Content-Type: application/json
    
    // Request body from above (array containing the absence object)
    
  2. Absence Modification in External HR System:

    • When an existing absence is edited in your HR system (e.g., change in dates, absence type):
      • Make a POST request to the /v1/absences endpoint in the Optibus API. This endpoint handles updates (upserts) for absences.
      • Crucially, ensure you use the same absenceId as the original absence.
      • The request body must be an array containing the absence object(s) to be updated.
      • Update the relevant fields within the absence object, such as code, startDate, startTime, endDate, and endTime, as needed.
      • Note: times are represented as minutes from midnight (e.g., 540 = 09:00, 1020 = 17:00), in the local timezone of your operation.

    Example POST Request Body for Updating an Absence: (Note the absenceId is the same as an existing absence in Optibus)

    [
      {
        "absenceId": "your-existing-unique-uuid-string",
        "driverId": "driver-id-789",
        "code": "SICK",
        "startDate": "2024-02-01",
        "startTime": 600, // 10:00
        "endDate": "2024-02-02",
        "endTime": 720, // 12:00
        "notes": "Updated: Doctor's appointment, extended"
      }
    ]
    

    API Call:

    POST /v1/absences
    Authorization: <YOUR_API_TOKEN>
    Content-Type: application/json
    
    // Request body from above (array containing the updated absence object)
    
    • Note on Changing Assigned Driver: The Optibus API does not currently support changing the driverId for an existing absence directly through an update. If a driver assignment needs to be changed for an absence:

      1. The original absence must be deleted from Optibus. See "Absence Deletion" below.
      2. A new absence record must be created with a new unique absenceId and the correct driverId using the creation process described above (sent in an array).
    • Balance Validation: When the entitlementBanksEffectiveDate feature flag is enabled, the API validates that absences do not cause negative balance violations for entitlement banks that do not allow negative balances. If violations are detected, the API returns HTTP 422 with details about which drivers have violations and which banks are affected.

      • You can skip balance validation by adding the query parameter skipBalanceValidation=true to your request (e.g., POST /v1/absences?skipBalanceValidation=true).
      • The HTTP 422 error can only occur when ALL of the following conditions are met:
        1. The entitlementBanksEffectiveDate feature flag is enabled
        2. Entitlement banks are configured and do NOT allow negative balances
        3. The driver has entitlements
        4. The absence is connected to the bank (by absence type)
        5. The driver would violate the balance constraints (would cause negative balance)
        6. The skipBalanceValidation query parameter is NOT set to "true" (validation is enabled by default)

      Example HTTP 422 Error Response:

      {
        "error": {
          "type": "negativeBalanceViolation",
          "message": "One or more absences would cause negative balance violations",
          "details": {
            "drivers": [
              {
                "driverId": "driver-id-123",
                "violatedBanks": ["Vacation", "Sick"]
              },
              {
                "driverId": "driver-id-456",
                "violatedBanks": ["Vacation"]
              }
            ],
            "summary": {
              "affectedDrivers": 2
            }
          }
        }
      }
      
  3. Absence Deletion in External HR System:

    • When an absence is deleted from your HR system:
      • The Optibus API does not currently support the direct deletion of absences via an API endpoint.
      • Please contact Optibus if you require this functionality in the API.

Optibus Operations ➡️ External HR System

This use case describes how to regularly update an external HR system with driver absence data from Optibus. This is typically achieved by setting up a recurring job (e.g., a cron job).

Process:

  1. Schedule a Recurring Job:

    • Configure a cron job or a similar scheduled task to run at a desired frequency (e.g., every X hours, or once per day).
  2. Fetch Driver Absences from Optibus:

    • The job should make a GET request to the /v2/drivers/absences API endpoint.
    • The API response is paginated and includes an array of absence objects.
    • Note: times are represented as minutes from midnight (e.g., 540 = 09:00, 1020 = 17:00), in the local timezone of your operation.

    Example GET Request: (The specific endpoint and any necessary query parameters, like date ranges, should be used as per the Optibus API specification. Example below uses /v2/drivers/absences with date filtering.)

    GET /v2/drivers/absences?fromDate=2024-01-01&toDate=2024-01-31&page=1
    Authorization: <YOUR_API_TOKEN>
    

    Query Parameters:

    • driverIds: Comma-separated list of driver IDs to filter for (optional)
    • absenceCode: Comma-separated list of absence type codes to filter for (optional)
    • fromDate: Returns only absences that end on or after this date (YYYY-MM-DD) (optional)
    • toDate: Returns only absences that start on or before this date (YYYY-MM-DD) (optional)
    • page: 1-indexed page number (defaults to 1)

    Example JSON Response:

    {
      "absences": [
        {
          "absenceId": "uuid-string-for-absence-1",
          "absenceCode": "SICK",
          "driverId": "driver-id-123",
          "startDate": "2024-01-10",
          "endDate": "2024-01-11",
          "startTime": 540,
          "endTime": 1020,
          "note": "Flu symptoms"
        },
        {
          "absenceId": "uuid-string-for-absence-2",
          "absenceCode": "VACATION",
          "driverId": "driver-id-456",
          "startDate": "2024-01-15",
          "endDate": "2024-01-20"
        },
        {
          "absenceId": "uuid-string-for-absence-3",
          "absenceCode": "PERSONAL",
          "driverId": "driver-id-456",
          "startDate": "2024-01-25",
          "endDate": "2024-01-25",
          "startTime": 600,
          "endTime": 840,
          "note": "Appointment"
        }
      ],
      "pagination": {
        "currentPage": 1,
        "totalPages": 3,
        "nextPage": 2
      }
    }
    
  3. Process Absences:

    • Check the pagination property in the response to determine if there are more pages to fetch.
    • For each page, iterate through the absences array.
    • For each absence object:
      • Existing Absence: If the absenceId already exists in your external HR system, update the corresponding record with the latest information.
      • New Absence: If the absenceId does not exist in your external HR system, create a new absence record using the data provided.
      • Note: startTime and endTime are optional and represent minutes from midnight. Convert these to time strings if needed (e.g., 540 minutes = 09:00).
    • Continue fetching subsequent pages by incrementing the page parameter until all pages have been processed.

Fleet Management System Integration Guides

This section gives step-by-step guides for common integration scenarios with external fleet management systems. For help with your particular integration scenario, please contact your Optibus Customer Success Manager.

Synchronizing Vehicle Information with an External Fleet Management System

External Fleet Management System ➡️ Optibus Operations

This use case details how to create and update vehicle information in Optibus when changes are made in your external fleet management system.

Process:

  1. Vehicle Creation in External Fleet Management System:

    When a new vehicle is created in your fleet management system, make a POST request to the /v1/vehicles API endpoint.

    Example Request:

    POST /v1/vehicles
    Authorization: <YOUR_API_TOKEN>
    Content-Type: application/json
    
    {
      "vehicles": [
        {
          "id": "vehicle-001",
          "licensePlate": "ABC-123",
          "regionName": "North Region",
          "depotName": "Main Depot",
          "type": "Double Decker",
          "model": "Routemaster"
        }
      ]
    }
    

    Notes:

    • Each request is atomic - either all vehicles are created successfully, or none are created.
    • Maximum 1000 vehicles per request.
    • We recommend using the ID of the vehicle in the external fleet management system as the id field in the request, so that the vehicle has the same identifier in both of your systems.
  2. Vehicle Modification in External Fleet Management System:

    When an existing vehicle is edited in your fleet management system, make a PUT request to the /v1/vehicles API endpoint.

    Example Request:

    PUT /v1/vehicles
    Authorization: <YOUR_API_TOKEN>
    Content-Type: application/json
    
    {
      "vehicles": [
        {
          "id": "vehicle-001",
          "licensePlate": "ABC-456",
          "parkingLocation": "Bay 15",
          "type": "Double Decker",
          "model": "Routemaster",
          "decommissioned": false
        }
      ]
    }
    

    Notes:

    • This endpoint expects a full representation of the vehicle - omitting optional fields will clear them.
    • Maximum 1000 vehicles per request.
    • PUT does not support regionName or depotName fields.

Optibus Operations ➡️ External Fleet Management System

This use case describes how to regularly update an external fleet management system with vehicle information from Optibus using a recurring job (e.g., a cron job).

Process:

  1. Fetch Vehicles from Optibus:

    Make a GET request to the /v1/vehicles API endpoint. The response is paginated.

    Example Request:

    GET /v1/vehicles?page=1&isDecommissioned=false
    Authorization: <YOUR_API_TOKEN>
    

    Example Response:

    {
      "vehicles": [
        {
          "id": "vehicle-001",
          "licensePlate": "ABC-123",
          "parkingLocation": "Bay 15",
          "mainRegionPeriod": {
            "regionName": "North Region",
            "depotName": "Main Depot"
          },
          "type": "Double Decker",
          "model": "Routemaster",
          "decommissioned": false,
          "customAttributes": {
            "capacity": 42
          }
        }
      ],
      "pagination": {
        "currentPage": 1,
        "totalPages": 5
      }
    }
    
  2. Process Vehicles:

    • For each vehicle in the vehicles array, create or update the corresponding record in your fleet management system using the vehicle's id as the identifier.
    • If pagination.currentPage < pagination.totalPages, increment the page parameter and repeat until all pages are processed.

Synchronizing Vehicle Downtimes with an External Fleet Management System

External Fleet Management System ➡️ Optibus Operations

This use case details how to create and update vehicle downtime information in Optibus when changes are made in your external fleet management system.

Process:

  1. Downtime Creation or Update in External Fleet Management System:

    When a vehicle downtime is created or updated in your fleet management system, make a PUT request to the /v1/vehicles/downtimes API endpoint.

    Example Request:

    PUT /v1/vehicles/downtimes
    Authorization: <YOUR_API_TOKEN>
    Content-Type: application/json
    
    {
      "downtimes": [
        {
          "downtimeId": "downtime-001",
          "vehicleId": "vehicle-001",
          "startDate": "2024-02-01",
          "endDate": "2024-02-03",
          "note": "Scheduled maintenance"
        }
      ]
    }
    

    Notes:

    • If downtimeId is provided and exists, the downtime will be updated; otherwise, a new downtime is created.
    • If downtimeId is omitted, a new downtime with an auto-generated ID will be created.
    • Each request is atomic - either all downtimes are created/updated successfully, or none are.
    • Maximum 1000 downtimes per request.
    • Note: times are represented as minutes from midnight (e.g., 540 = 09:00, 1020 = 17:00), in the local timezone of your operation.
    • If startTime and endTime are omitted, the downtime covers entire day(s).
    • If endDate is omitted, the downtime is ongoing indefinitely.

Optibus Operations ➡️ External Fleet Management System

This use case describes how to regularly update an external fleet management system with vehicle downtime data from Optibus using a recurring job (e.g., a cron job).

Process:

  1. Fetch Vehicle Downtimes from Optibus:

    Make a GET request to the /v1/vehicles/downtimes API endpoint. The response is paginated.

    Example Request:

    GET /v1/vehicles/downtimes?fromDate=2024-01-01&toDate=2024-01-31&page=1
    Authorization: <YOUR_API_TOKEN>
    

    Example Response:

    {
      "downtimes": [
        {
          "downtimeId": "downtime-001",
          "vehicleId": "vehicle-001",
          "startDate": "2024-01-10",
          "endDate": "2024-01-12",
          "startTime": 540,
          "endTime": 1020,
          "note": "Scheduled maintenance"
        },
        {
          "downtimeId": "downtime-002",
          "vehicleId": "vehicle-002",
          "startDate": "2024-01-15",
          "note": "Out of service indefinitely"
        }
      ],
      "pagination": {
        "currentPage": 1,
        "totalPages": 2
      }
    }
    
  2. Process Downtimes:

    • For each downtime in the downtimes array, create or update the corresponding record in your fleet management system using the downtimeId as the identifier.
    • Note: times are represented as minutes from midnight (e.g., 540 = 09:00, 1020 = 17:00), in the local timezone of your operation.
    • If pagination.currentPage < pagination.totalPages, increment the page parameter and repeat until all pages are processed.

Operational Plan Query Guides

This section gives step-by-step guides for common query scenarios with Optibus Operations for retrieving operational plan data. For help with your particular query scenario, please contact your Optibus Customer Success Manager.

This section utilizes the /v2/operational-plan endpoint for all operational plan data requests.

Retrieve Duties by Driver and Date

This use case details how to fetch a list of duties assigned to specific drivers within a given date range and extract associated block and vehicle information. This is useful for synchronizing driver schedules, auditing assignments, or building custom reports.

Process:

  1. Prepare Your Request:

    • Determine the date range (fromDate and toDate parameters) for which you want to retrieve duties.
    • Optionally identify the driverUuids of the drivers whose duties you want to retrieve. These should be provided as a comma-separated string. If omitted, information for all drivers is returned.
    • Optionally, you can specify depotUuids to filter the operational plan by specific depots. This parameter expects one or more depot UUIDs as a comma-separated string. Note: The UUIDs for depots can be obtained from the /v1/regions endpoint, where they correspond to the regionUuid property.
    • Optionally, you can set includeUnassigned=true (in conjunction with driverUuids) to also include unassigned tasks for context around those drivers.
  2. Make a GET Request to the Operational Plan Endpoint:

    • Use the /v2/operational-plan API endpoint.
    • Include the fromDate, toDate, and any desired optional parameters (driverUuids, depotUuids, etc.) as query parameters.

Example GET Request:

GET /v2/operational-plan?fromDate=2024-06-01&toDate=2024-06-07&driverUuids=driver-uuid-123&depotUuids=depot-uuid-abc
Authorization: <YOUR_API_TOKEN>

Example JSON Response Snippet (Relevant sections):

The response is an array of depot plans. The following example highlights the properties crucial for linking drivers to duties, blocks, and vehicles, showing how to derive the necessary IDs for your table.

[
  {
    "depotUuid": "depot-uuid-abc",
    "depotName": "Main Depot",
    "assignments": [
      {
        "date": "2024-06-01",
        "driverAssignments": [
          {
            "driver": "driver-uuid-123",
            "assignments": ["task-uuid-A"]
          }
        ],
        "vehicleAssignments": [
          {
            "vehicle": "vehicle-id-XYZ",
            "assignments": ["block-id-1"]
          }
        ],
        "properties": []
      }
    ],
    "blocks": [
      {
        "id": "block-id-1",
        "displayId": "block-display-id-B1",
        "type": "block",
        "disabled": false,
        "summary": { "type": "Standard Bus" },
        "events": [
          {
            "dutyId": "task-uuid-A",
            "eventId": "event-uuid-X"
          }
        ]
      }
    ],
    "tasks": [
      {
        "id": "task-uuid-A",
        "type": "duty",
        "displayId": "Duty 501",
        "summary": {
          "type": "duty",
          "startTime": 480,
          "endTime": 1020
        },
        "events": [
          {
            "uuid": "event-uuid-X",
            "eventType": "deadhead",
            "subType": "depot_pull_out",
            "startTime": "08:00:00",
            "endTime": "08:30:00",
            "blockId": "block-id-1"
          }
        ]
      },
      {
        "id": "task-uuid-SPARE",
        "type": "spare",
        "displayId": "Morning Spare",
        "dutyType": "spare",
        "spareType": "SPARE1",
        "summary": {
          "type": "spare",
          "startTime": 360,
          "endTime": 720
        },
        "events": []
      }
    ],
    "drivers": [
      {
        "id": "driver-ext-123",
        "uuid": "driver-uuid-123",
        "firstName": "John",
        "lastName": "Doe",
        "archived": false
      }
    ],
    "vehicles": [
      {
        "id": "vehicle-id-XYZ",
        "licensePlate": "AB123CD",
        "make": "Mercedes",
        "model": "Citaro"
      }
    ]
  }
]

How to extract duties for a specific driver and build the desired table:

To create a table with columns driverUuid, driverName, dutyId, blockId, vehicleId, follow these steps:

Note on Spare Types: When the spare types feature flag is enabled, spare tasks will include additional properties (spareType, dutyType: "spare") and the displayId will show the configured spare type name instead of the original display ID.

  1. Iterate through the Depot Plans and Daily Assignments:

    • The API response is an array of depot plans. Iterate through each depot object.
    • Access the assignments array. For each assignment object (representing a specific date), iterate through its driverAssignments array.
  2. Populate Driver and Duty Information:

    • driverUuid: Directly available from driverAssignment.driver.
    • driverName: Look up the driverUuid in the root drivers array (e.g., drivers.find(d => d.uuid === driverAssignment.driver)) to retrieve firstName and lastName.
    • dutyId: The driverAssignment.assignments array contains one or more task IDs assigned to that driver. Each of these is a dutyId.
  3. Identify Block(s) and Vehicle(s) for the Duty:

    • For a given dutyId (task ID), find the corresponding object in the root tasks array.
    • Iterate through the events array of that task. An event within the duty will contain a blockId.
    • From Block ID to Vehicle ID:
      • Go back to the assignments object for the current date.
      • Access its vehicleAssignments array.
      • Find the vehicleAssignment object where its assignments array includes your blockId.
      • The vehicle property of that vehicleAssignment object is the vehicleId you need for the table row.

Generate a List of Duties with Service Trips

This use case demonstrates how to retrieve duties and a detailed list of all service trips within each duty. This provides a granular view of an operational day.

Process:

  1. Prepare Your Request:

    • Specify the desired date range using fromDate and toDate parameters.
    • Optionally, set includeStops=true if you need detailed stop information for each trip. Be aware that enabling this can significantly increase response time and payload size.
  2. Make a GET Request to the Operational Plan Endpoint:

    • Use the /v2/operational-plan API endpoint, including the date range query parameters.

Example GET Request:

GET /v2/operational-plan?fromDate=2024-06-15&toDate=2024-06-15&includeStops=true
Authorization: <YOUR_API_TOKEN>

Example JSON Response Snippet (Relevant sections):

The tasks array contains the duty objects. The overall duty start/end times can be found in the summary object (as minutes from midnight). Each duty contains an events array detailing the activities within it.

[
  {
    "assignments": [
      {
        "date": "2024-06-15",
        "driverAssignments": [
          {
            "driver": "driver-uuid-456",
            "assignments": ["task-uuid-B"]
          }
        ]
      }
    ],
    "tasks": [
      {
        "id": "task-uuid-B",
        "type": "duty",
        "displayId": "Duty 700",
        "summary": {
          "type": "duty",
          "startTime": 420,
          "endTime": 960
        },
        "events": [
          {
            "uuid": "event-uuid-E",
            "eventType": "deadhead",
            "subType": "depot_pull_out",
            "startTime": "07:00:00",
            "endTime": "07:30:00"
          },
          {
            "uuid": "event-uuid-F",
            "eventType": "service_trip",
            "startTime": "07:30:00",
            "endTime": "08:15:00",
            "tripId": "service-trip-201",
            "optibusRouteId": "route-R2",
            "direction": 1,
            "stops": [
              { "id": "stop-1", "name": "Main St.", "time": "07:30:00" },
              { "id": "stop-2", "name": "Oak Ave.", "time": "07:45:00" }
            ]
          },
          {
            "uuid": "event-uuid-G",
            "eventType": "service_trip",
            "startTime": "08:30:00",
            "endTime": "09:15:00",
            "tripId": "service-trip-202",
            "optibusRouteId": "route-R2",
            "direction": 2
          }
        ]
      }
    ]
  }
]

How to extract duties with service trips:

  1. Identify Duties:

    • Iterate through the top-level tasks array in the API response.
    • A task object with "type": "duty" represents a duty.
    • The date for the duty is found by cross-referencing task.id with the assignments array to find the corresponding date.
  2. Extract Service Trips within each Duty:

    • For each identified duty (task object), access its events array.
    • Service Trips: An event where eventType is "service_trip" represents a service trip. You can extract startTime, endTime, tripId, optibusRouteId, direction, and any other relevant details available directly on the event object.
    • Deadhead Events: Events with eventType: "deadhead" represent non-service movements. You can filter these out or process them separately as needed.

Retrieve Cancelled Duties for a Specific Day

This use case explains how to identify duties (tasks) that have been explicitly cancelled for a given day. This is essential for managing daily operations and reporting on changes.

Process:

  1. Prepare Your Request:

    • Specify the fromDate and toDate parameters to cover the specific day you are interested in. For a single day, fromDate and toDate will be the same.
  2. Make a GET Request to the Operational Plan Endpoint:

    • Use the /v2/operational-plan API endpoint with the desired date range.

Example GET Request:

GET /v2/operational-plan?fromDate=2024-06-10&toDate=2024-06-10
Authorization: <YOUR_API_TOKEN>

Example JSON Response Snippet (Relevant sections):

The assignments array contains a properties sub-array. An entry with disabled: true directly indicates a cancelled task.

[
  {
    "assignments": [
      {
        "date": "2024-06-10",
        "driverAssignments": [],
        "vehicleAssignments": [],
        "properties": [
          {
            "taskId": "task-uuid-cancelled-A",
            "disabled": true,
            "cancellationReason": {
              "reason": "Vehicle Breakdown",
              "reasonCode": "VEHICLE_BREAKDOWN"
            },
            "assignmentType": "driverAssignment"
          },
          {
            "taskId": "task-uuid-active-B",
            "disabled": false,
            "assignmentType": "driverAssignment"
          }
        ]
      }
    ],
    "tasks": [
      {
        "id": "task-uuid-cancelled-A",
        "type": "duty",
        "displayId": "Duty 900 C",
        "summary": { "type": "duty", "startTime": 540, "endTime": 1080 },
        "events": []
      },
      {
        "id": "task-uuid-active-B",
        "type": "duty",
        "displayId": "Duty 700 A",
        "summary": { "type": "duty", "startTime": 420, "endTime": 900 },
        "events": []
      }
    ]
  }
]

How to get a list of duties for a certain day which were cancelled:

  1. Fetch Operational Plan: Make a GET request to the /v2/operational-plan endpoint for your desired fromDate and toDate.
  2. Access Assignment Properties: Once you receive the response, iterate through the assignments array. For each daily assignment object, navigate to its properties array.
  3. Filter for Disabled Tasks: Iterate through each object within the properties array. Check the value of the disabled property: If property.disabled is true, the taskId associated with this property represents a cancelled duty.
  4. Retrieve Cancelled Duty (Task) Details:
    • For each taskId identified as disabled: true, you can find the corresponding full duty object in the top-level tasks array (e.g., tasks.find(t => t.id === property.taskId)).
    • Optionally, you can also extract the cancellationReason object from the properties entry for more context.

Custom Driver App Notification Action Guide

1. Overview

This guide provides technical instructions for integrating with the Optibus Driver App's "custom notification actions" feature.

Custom actions allow you to configure interactive buttons that appear on specific notifications sent to drivers. When a driver taps a button, it opens a web page that you host. This enables a variety of integrations, such as:

  • Displaying a location on a map.
  • Linking to an external resource or document.
  • Building a form to acknowledge a notification, which can be recorded in a separate IT system.

How It Works

  1. A driver receives a notification in the Optibus Driver App containing one or more custom action buttons.
  2. The driver taps a button.
  3. The app opens the pre-configured URL in a web browser.
  4. The Optibus app automatically appends two query parameters to your URL: optibusPayload and optibusSignature.

2. Configuration

This feature is configured via the Limit notifications visibility preference in Optibus Operations. To enable and set up the custom action buttons, please contact your Optibus Customer Success Manager for assistance. They will help you configure the button text, target URL, and other parameters to suit your specific use case.

3. Implementation Guide

When a driver activates a custom action, your web page will receive a URL containing two critical query parameters. Any query parameters you originally included in the URL will also be preserved.

Parameter Description
optibusPayload A URL-encoded, JSON-stringified object containing contextual data about the notification and action.
optibusSignature A Base64-encoded digital signature of the optibusPayload string. Use this to verify the request's authenticity.

3.1. Parsing the optibusPayload Parameter

The optibusPayload contains all the contextual information for your web page. To use it, you must first URL-decode the string and then parse it as a JSON object.

JavaScript Example:

// The URL of the page opened by the Driver App.
const url = new URL(window.location.href);

// 1. Get the raw payload string from the URL's search parameters.
const rawPayload = url.searchParams.get("optibusPayload");

// 2. Parse the URL-encoded JSON string.
const payload = JSON.parse(rawPayload);

console.log(payload);

Payload Schema

The parsed payload object will conform to the following schema:

{
  "customAction": {
    "key": "<string>"
  },
  "notification": {
    "id": "<uuid>",
    "driverId": "<string>",
    "type": "<string>",
    "params": {
      // Schema is dependent on the notification 'type'
    }
  },
  "payloadGeneratedAt": "2024-10-11T13:46:56.610Z"
}

Field Descriptions:

  • notification.id: The unique UUID of the notification that triggered the action.
  • notification.driverId: The ID of the driver who received the notification.
  • notification.type: The type of notification (e.g., assignTask). The schema of the params object depends on this value.
  • notification.params: An object containing data specific to the notification type. Contact your Customer Success Manager for the exact schema for a given notification type.
  • customAction.key: A custom string identifier you specify during the URL configuration.
  • payloadGeneratedAt: An ISO 8601 timestamp indicating when the driver tapped the button.

The optibusSignature parameter allows you to verify that the request was genuinely initiated by the Optibus system and has not been tampered with. Verification is optional but highly recommended for any security-sensitive application.

The signature is created by signing the raw optibusPayload string (before JSON parsing) using the RSA-SHA256 algorithm. You can verify it using a public key provided by Optibus.

Public Key: You can obtain the required public key from the Optibus public key API endpoint.

Signature Verification Example (Node.js)

This example demonstrates how to verify the signature and check the payload's timestamp to prevent replay attacks.

const crypto = require("node:crypto");

// Use the public key fetched from the aforementioned Optibus API endpoint.
const publicKey = "";

// Extract the parameters from the URL.
// In a real application, you would get this from the incoming request.
const url = new URL("https://your-service.com/action?...");
const rawPayload = url.searchParams.get("optibusPayload");
const signature = url.searchParams.get("optibusSignature");

// 1. Verify the signature's authenticity.
const verifier = crypto.createVerify("RSA-SHA256");
verifier.update(rawPayload);
verifier.end();

const isVerified = verifier.verify(publicKey, signature, "base64");
if (!isVerified) {
  throw new Error("Invalid signature. The request is not authentic.");
}

// 2. (Optional but Recommended) Check if the payload is recent to prevent replay attacks.
const maxPayloadAge = 5 * 60 * 1000; // 5 minutes in milliseconds
const parsedPayload = JSON.parse(rawPayload);
const payloadTimestamp = new Date(parsedPayload.payloadGeneratedAt).getTime();

if (Date.now() - payloadTimestamp > maxPayloadAge) {
  throw new Error("Payload is too old. Possible replay attack.");
}

// If verification passes, you can proceed with your logic here.
console.log("Signature and timestamp are valid.");

4. Example URL

The following is an example of a complete URL your service might receive after a custom action is triggered.

https://www.optibus.com/?optibusPayload=%7B%22notification%22%3A%7B%22id%22%3A%22b82df1ce-6420-47a6-be06-52b97c9965c5%22%2C%22driverId%22%3A%2233774450%22%2C%22type%22%3A%22assignTask%22%2C%22params%22%3A%7B%22calendarDate%22%3A%222024-10-11%22%2C%22taskName%22%3A%5B%7B%22name%22%3A%224%22%2C%22type%22%3A%22duty%22%2C%22endTime%22%3A1476%2C%22startTime%22%3A920%7D%5D%7D%7D%2C%22customAction%22%3A%7B%22key%22%3A%22OPEN%22%7D%2C%22payloadGeneratedAt%22%3A%222024-10-11T14%3A57%3A49.872Z%22%7D&optibusSignature=arML2T%2B4zu345r1xT78wYbjMZf8VUAmWXylOQUNkGf7isj7KppV75JQURiYufQxwlKmp9qVbk8SMIO3iKHs2FcU0XylBhzpa9QhK4ewyE6SfEhEuZKF7IzkwuL%2B6hJS13Hkqli5IzJKIt0pewVZaBBEREzuqtgm7KQZCCvwoT4nvFnt9kPcSDhJ0jui4IKXfsmBIpdo6XrVgxz72Rgc5ugHlJB9ZmtZ95r%2FBN5ZbBqS%2FThxyaogkLbfcpuFAGuewN2VWFoMVDUU38k0UT3S%2Bb1ZG9bqaeaXRe9tyNJv9JurRCistIAuD%2F4ThgseoLuopb8scJqst8Dp%2FM1XlP0rMYA%3D%3D

Preferences

GetHolidays

Returns the configured holidays (as in bank holidays). This is distinct from individual driver absences. If startDate and endDate are provided, the response will include only holidays within that date range. If neither is provided, all configured holidays are returned.

Important Notes:

  • Both startDate and endDate must be provided together.
  • Dates are expected in the format YYYY-MM-DD.
Authorizations:
api_key

Responses

Response samples

Content type
application/json
[
  • {
    }
]

GetAbsenceTypes

Returns the configured absence types.

Authorizations:
api_key

Responses

Response samples

Content type
application/json
{
  • "absenceTypes": [
    ]
}

Regions

GetRegions

Returns the configured organizational Regions including the corresponding Units for each Region.

Authorizations:
api_key

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Drivers

API endpoints for managing drivers.

ListDrivers

List existing drivers in the system, with optional filtering capability.

Notes:

  • The result is paginated. Check the pagination property in the response to see the total number of pages and the current page number.
Authorizations:
api_key
query Parameters
driverIds
Array of strings
  • Comma-separated list of driver IDs to filter for
onDate
string <date> (StringifyDate)
  • Date string formatted as YYYY-MM-dd for which we want data returned. If not provided, today's date will be used. The date specified here affects the data returned for certain properties such as mainRegionPeriod, loanedRegionPeriods, and customAttributes, and also the behaviour of the isEmployed and regionNames query parameters.
regionNames
Array of strings
  • Comma-separated list of region names to filter on. Drivers belonging to any of the regions (either main or loaned) on the date specified by onDate (or today's date if not provided) will be returned.
isEmployed
boolean
  • Filter for employed (true) or unemployed (false) drivers on the date specified in onDate. If not specified, all drivers will be returned.
page
integer <int32> (PageNumber)
  • 1-indexed integer indicating which page of results to pull

Responses

Response samples

Content type
application/json
{
  • "pagination": {
    },
  • "drivers": [
    ]
}

CreateDrivers

Add new drivers to the system.

Notes:

  • This API endpoint does not support modifying existing drivers. If you need to update an existing driver, use the PUT /v2/drivers API endpoint instead.
  • Each request is atomic - either all drivers listed in the request are created successfully, or none are created.
  • No more than 1000 drivers can be created in a single request - please break your request into multiple smaller chunks if you need to create more than 1000 drivers.
  • startDate is an optional field, but if provided, an initial employment period will be automatically created with this start date.
  • The specification of expected values for the customAttributes field and whether they are mandatory or not is determined by the attribute definitions in the "Driver attributes" preference in your Ops instance.
    • Attributes with type STRING expect a string to be set for customAttributes[attributeId].
    • Attributes with type NUMBER expect a number to be set for customAttributes[attributeId].
    • Attributes with type BOOLEAN expect a boolean to be set for customAttributes[attributeId].
    • Attributes with type DATE expect a date string formatted as YYYY-MM-dd to be set for customAttributes[attributeId].
    • Attributes with type SINGLE_SELECT expect the value of one of the available select options to be set for customAttributes[attributeId].
    • Attributes with type MULTI_SELECT expect an array of strings (each one being the value of one of the available select options) to be set for customAttributes[attributeId].
    • Attributes with type DURATION expect a duration string formatted as HH:mm (where HH is an integer between 0 and 999, and mm is an integer between 0 and 59) to be set for customAttributes[attributeId].
Authorizations:
api_key
Request Body schema: application/json
required
required
Array of objects (NewDriver)

List of drivers to create.

Array
customAttributes
object

Custom attributes for the driver. Note that some custom attributes may be mandatory, according to the 'Driver attributes' preference in your Ops instance. Should be a mapping of the 'attributeId' (configured in your Ops instance) to the initial value for that custom attribute. The value will be validated according to the attribute definition configured in your Ops instance.

union
string

Driver union code as configured in preferences. May be mandatory depending on the configuration of the 'Driver unions' preference in your Ops instance.

grade
string

Driver grade code as configured in preferences. May be mandatory depending on the configuration of the 'Driver grades' preference in your Ops instance.

type
string

Driver type code as configured in preferences. May be mandatory depending on the configuration of the 'Driver types' preference in your Ops instance.

emailAddress
string

The driver’s email address. Cannot exceed 256 characters and must be a valid email address.

description
string

Optional free-text description or notes about the driver. Cannot exceed 65,535 characters.

homeNumber
string

The driver’s home phone number. Cannot exceed 100 characters.

mobileNumber
string

The driver’s mobile phone number. Cannot exceed 100 characters.

avatar
string

A URL pointing to the driver's avatar image.

groupName
string

The name of the group the driver is assigned to.

depotName
string

The name of the depot the driver is assigned to.

regionName
required
string

The name of the region the driver is assigned to. Should match the name returned by the GET /v1/regions API endpoint.

startDate
string <date> (StringifyDate)

Stringified ISO8601 date in the form of YYYY-MM-dd, for example 2017-07-21

lastName
required
string

The driver’s last name. Cannot exceed 256 characters.

middleName
string

The driver’s middle name. Cannot exceed 256 characters.

firstName
required
string

The driver’s first name. Cannot exceed 256 characters.

id
required
string non-empty

The driver ID. Cannot exceed 36 characters.

Responses

Request samples

Content type
application/json
{
  • "drivers": [
    ]
}

Response samples

Content type
application/json
{
  • "createdDriverIds": [
    ]
}

UpdateDrivers

Update existing drivers in the system.

Notes:

  • This API endpoint expects a full representation of the driver. Omitting an optional field will clear the field.
  • This API endpoint does not support creating new drivers. If you need to create a new driver, use the POST /v2/drivers API endpoint instead.
  • Each request is atomic - either all drivers listed in the request are updated successfully, or none are updated.
  • No more than 1000 drivers can be updated in a single request - please break your request into multiple smaller chunks if you need to update more than 1000 drivers.
  • The specification of expected values for the customAttributes field and whether they are mandatory or not is determined by the attribute definitions in the "Driver attributes" preference in your Ops instance.
    • Attributes with type STRING expect a string to be set for customAttributes[attributeId].
    • Attributes with type NUMBER expect a number to be set for customAttributes[attributeId].
    • Attributes with type BOOLEAN expect a boolean to be set for customAttributes[attributeId].
    • Attributes with type DATE expect a date string formatted as YYYY-MM-dd to be set for customAttributes[attributeId].
    • Attributes with type SINGLE_SELECT expect the value of one of the available select options to be set for customAttributes[attributeId].
    • Attributes with type MULTI_SELECT expect an array of strings (each one being the value of one of the available select options) to be set for customAttributes[attributeId].
    • Attributes with type DURATION expect a duration string formatted as HH:mm (where HH is an integer between 0 and 999, and mm is an integer between 0 and 59) to be set for customAttributes[attributeId].
  • If the value of any custom attribute is updated compared to the existing value, a new entry will be added to the history of that attribute starting from the current date.
    • If there is already an entry for a given attribute starting from today's date, it will be overwritten, and a warning will be returned in the warnings property of the response.
Authorizations:
api_key
Request Body schema: application/json
required
required
Array of objects (EditedDriver)

List of drivers to update.

Array
id
required
string non-empty

The driver ID. Cannot exceed 36 characters.

description
string

Optional free-text description or notes about the driver. Cannot exceed 65,535 characters.

type
string

Driver type code as configured in preferences. May be mandatory depending on the configuration of the 'Driver types' preference in your Ops instance.

firstName
required
string

The driver’s first name. Cannot exceed 256 characters.

lastName
required
string

The driver’s last name. Cannot exceed 256 characters.

middleName
string

The driver’s middle name. Cannot exceed 256 characters.

avatar
string

A URL pointing to the driver's avatar image.

mobileNumber
string

The driver’s mobile phone number. Cannot exceed 100 characters.

homeNumber
string

The driver’s home phone number. Cannot exceed 100 characters.

emailAddress
string

The driver’s email address. Cannot exceed 256 characters and must be a valid email address.

grade
string

Driver grade code as configured in preferences. May be mandatory depending on the configuration of the 'Driver grades' preference in your Ops instance.

union
string

Driver union code as configured in preferences. May be mandatory depending on the configuration of the 'Driver unions' preference in your Ops instance.

customAttributes
object

Custom attributes for the driver. Note that some custom attributes may be mandatory, according to the 'Driver attributes' preference in your Ops instance. Should be a mapping of the 'attributeId' (configured in your Ops instance) to the initial value for that custom attribute. The value will be validated according to the attribute definition configured in your Ops instance.

Responses

Request samples

Content type
application/json
{
  • "drivers": [
    ]
}

Response samples

Content type
application/json
{
  • "warnings": [
    ],
  • "updatedDriverIds": [
    ]
}

FetchDriverRegionPeriods

Returns information about which regions and depots drivers are assigned to during different time periods. The response is a map between the driver ID and an array of that driver's region periods.

Notes:

  • Due to legacy reasons, this endpoint contains properties referring to 'depots' instead of 'regions'. Anywhere you see 'depot' referenced, it really refers to 'region'. For example depotId is actually regionUuid. This inconsistency will be improved in a future API version.
  • Here is a breakdown of the field meanings:
    • periodId: A unique identifier for the period.
    • type: The type of period (is it the driver's main region/depot, or were they just loaned there temporarily?)
    • driverUUID: The ID of the driver.
    • depotId: The ID of the region the driver is assigned to during the period.
    • opUnitId: The ID of the depot (operational unit) within the region the driver is assigned to during the period.
    • groupId: The ID of the driver group that the driver is assigned to during the period.
    • startDate: The start date of the period.
    • endDate: The end date of the period. If unspecified, the period is ongoing indefinitely.
    • startTime: The start time of the period. If unspecified, the period starts at the beginning of the day.
    • endTime: The end time of the period. If unspecified, the period ends at the end of the day.
Authorizations:
api_key
query Parameters
driver
Array of strings (UUID)
  • Returns the region periods for the given driver IDs

Responses

Response samples

Content type
application/json
{
  • "property1": [
    ],
  • "property2": [
    ]
}

Driver Absences

API endpoints for managing absences for drivers - i.e. periods where they are unavailable for work.

ListDriverAbsences

List existing driver absences in the system, with optional filtering capability.

Notes:

  • The result is paginated. Check the pagination property in the response to see the total number of pages and the current page number.
  • Information about the modelling of date/time periods for each entry:
    • startDate is mandatory
    • endDate is optional - if omitted, the absence will be ongoing indefinitely
    • startTime and endTime are optional - if omitted, the absence will be for the entire day(s) specified by startDate and endDate
Authorizations:
api_key
query Parameters
driverIds
Array of strings
  • Comma-separated list of driver IDs to filter for
absenceCode
Array of strings
  • Comma-separated list of absence type codes to filter for
fromDate
string <date> (StringifyDate)
  • Date string formatted as YYYY-MM-dd. Only absences that end on or after this date are returned.
toDate
string <date> (StringifyDate)
  • Date string formatted as YYYY-MM-dd. Only absences that start on or before this date are returned.
page
integer <int32> (PageNumber)
  • 1-indexed integer indicating which page of results to pull

Responses

Response samples

Content type
application/json
{
  • "pagination": {
    },
  • "absences": [
    ]
}

CreateOrUpdateDriverAbsences

Creates or updates absences for drivers. As input, provide a list of absence entries to create or update.

Notes:

  • Behaviour of the absenceId field:
    • If an absenceId is specified that already exists, the existing absence will be updated.
    • If an absenceId is specified that does not already exist, a new absence will be created with the specified ID.
    • We recommend you set the absenceId to a corresponding fixed identifier from your external system that you are synchronizing with.
  • Information about the modelling of date/time periods for each entry:
    • startDate is mandatory
    • endDate is optional - if omitted, the downtime will be ongoing indefinitely
    • startTime and endTime are optional - if omitted, the downtime will be for the entire day(s) specified by startDate and endDate
  • Each request is atomic - either all downtimes listed in the request are created/updated successfully, or none are created/updated.
  • If your Ops instance has the entitlementBanksEffectiveDate feature active (you can ask your Optibus contact about this), then the API will perform additional validations:
    • The API will validate that the absences do not cause negative balance violations for entitlement banks that do not allow negative balances.
    • If violations are detected, the API will return HTTP 422 with details about which drivers have violations and which banks are affected.
    • The HTTP 422 error can only occur when ALL of the following conditions are met:
      • The entitlementBanksEffectiveDate feature flag is enabled
      • Entitlement banks are configured and do NOT allow negative balances
      • The driver has entitlements
      • The absence is connected to the bank (by absence type)
      • The driver would violate the balance constraints (would cause negative balance)
      • The skipBalanceValidation query parameter is NOT set to true (validation is enabled by default when the parameter is not provided)
Authorizations:
api_key
query Parameters
skipBalanceValidation
boolean
  • Optional query parameter. When set to true, skips balance validation. Defaults to false (validation enabled). Only relevant when the entitlementBanksEffectiveDate feature is enabled for your Ops instance.
Request Body schema: application/json
required
Array
endTimeNextDay
boolean
Deprecated
startTimeNextDay
boolean
Deprecated
endTime
integer <int32> (MinutesFromMidnightTime)

Wall clock time, represented as minutes since midnight. For example, 0 is midnight (start of the day), 120 is 02:00 (2 hours after midnight), 180 is 02:30 (2.5 hours after midnight), 1560 is 02:00 the next day (26 hours after midnight), etc.

endDate
string <date> (StringifyDate)

Stringified ISO8601 date in the form of YYYY-MM-dd, for example 2017-07-21

startTime
integer <int32> (MinutesFromMidnightTime)

Wall clock time, represented as minutes since midnight. For example, 0 is midnight (start of the day), 120 is 02:00 (2 hours after midnight), 180 is 02:30 (2.5 hours after midnight), 1560 is 02:00 the next day (26 hours after midnight), etc.

startDate
required
string <date> (StringifyDate)

Stringified ISO8601 date in the form of YYYY-MM-dd, for example 2017-07-21

absenceRequestId
string (UUID)

Stringified ID for a resource. Cannot exceed 36 characters.

updatedOn
string <date-time> (StringifyDateTime)

Stringified date-time. date-time notation as defined by RFC 3339, section 5.6, for example,2017-07-21T17:32:28Z

createdOn
string <date-time> (StringifyDateTime)

Stringified date-time. date-time notation as defined by RFC 3339, section 5.6, for example,2017-07-21T17:32:28Z

metadata
object

Additional data about the absence

note
string

The note provided by the user. Cannot exceed 255 characters.

absenceCode
required
string

The absence code provided by the user

absenceId
required
string (UUID)

Stringified ID for a resource. Cannot exceed 36 characters.

driver
required
string (UUID)

Stringified ID for a resource. Cannot exceed 36 characters.

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{ }

ListTimeOffBalances

Returns time off (entitlement) balances for drivers grouped by driver and bank. Numeric fields can be null when data is unavailable.

Authorizations:
api_key
query Parameters
driverIds
required
Array of strings (UUID)
  • Filter by driver IDs (required)
bankNames
Array of strings
  • Filter by bank names; if omitted default banks may be returned (optional)
onDate
string <date> (StringifyDate)
  • Calculate balances as of this date (YYYY-MM-DD); defaults to today (optional)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Driver Employment Periods

API endpoints for managing employment periods for drivers - i.e. periods where they are employed, hired, terminated, etc.

ListDriverEmploymentPeriods

List existing driver employment periods in the system, with optional filtering capability.

Notes:

  • The result is paginated. Check the pagination property in the response to see the total number of pages and the current page number.
  • Information about the modelling of date periods for each entry:
    • startDate is mandatory
    • endDate is optional - if omitted, the employment period will be ongoing indefinitely
Authorizations:
api_key
query Parameters
driverIds
Array of strings
  • Comma-separated list of driver IDs to filter for
fromDate
string <date> (StringifyDate)
  • Date string formatted as YYYY-MM-dd. Only employment periods that end on or after this date are returned.
toDate
string <date> (StringifyDate)
  • Date string formatted as YYYY-MM-dd. Only employment periods that start on or before this date are returned.
page
integer <int32> (PageNumber)
  • 1-indexed integer indicating which page of results to pull

Responses

Response samples

Content type
application/json
{
  • "pagination": {
    },
  • "employmentPeriods": [
    ]
}

CreateDriverEmploymentPeriod

Creates a single driver employment period.

Notes:

  • Behaviour of the periodId field:
    • If a periodId is specified that already exists, you will receive an error (this endpoint does not support updating existing employment periods - use the PUT /v1/drivers/employment-periods/{periodId} endpoint instead)
    • If a periodId is specified that does not already exist, a new employment period will be created with the specified ID.
    • If a periodId is not specified, a new employment period will be created with an automatically generated ID.
    • We recommend you set the periodId to a corresponding fixed identifier from your external system that you are synchronizing with, if such an identifier exists.
  • Employment periods for a single driver may not overlap each other.
Authorizations:
api_key
Request Body schema: application/json
required
endDate
string <date> (StringifyDate)

Stringified ISO8601 date in the form of YYYY-MM-dd, for example 2017-07-21

startDate
required
string <date> (StringifyDate)

Stringified ISO8601 date in the form of YYYY-MM-dd, for example 2017-07-21

driverId
required
string

ID of the driver this employment period belongs to.

periodId
string

The ID of the employment period to create or update. If omitted, a new period will be created. Cannot exceed 36 characters.

Responses

Request samples

Content type
application/json
{
  • "periodId": "period-123",
  • "driverId": "driver-123",
  • "startDate": "2026-01-01",
  • "endDate": "2027-05-17"
}

Response samples

Content type
application/json
{
  • "periodId": "period-123",
  • "driverId": "driver-123",
  • "startDate": "2026-01-01",
  • "endDate": "2027-05-17"
}

UpdateDriverEmploymentPeriod

Updates a single driver employment period by ID.

Notes:

  • You can only update the startDate and endDate fields of an employment period, not the driverId.
  • If you set shouldAutoUnassignFromEndDate to true, the system will auto-unassign duties from the day after the endDate if this is the last employment period chronologically for the driver.
    • If auto-unassignment fails for any of the regions which the driver has work in, a warning will be returned in the response to allow for manual intervention.
Authorizations:
api_key
path Parameters
periodId
required
string
  • The employment period ID to update
Request Body schema: application/json
required
shouldAutoUnassignFromEndDate
required
boolean

When true, auto-unassign duties from the day after endDate if this is the last employment period.

endDate
string <date> (StringifyDate)

Stringified ISO8601 date in the form of YYYY-MM-dd, for example 2017-07-21

startDate
required
string <date> (StringifyDate)

Stringified ISO8601 date in the form of YYYY-MM-dd, for example 2017-07-21

driverId
required
string

ID of the driver this employment period belongs to.

Responses

Request samples

Content type
application/json
{
  • "driverId": "driver-123",
  • "startDate": "2026-01-01",
  • "endDate": "2027-05-17",
  • "shouldAutoUnassignFromEndDate": true
}

Response samples

Content type
application/json
Example
{
  • "warnings": [ ]
}

Driver Custom Attributes

API endpoints for managing custom attributes for drivers - i.e. additional properties that can be set for drivers - including querying and updating their historical values.

ListDriverCustomAttributeEntries

List custom attribute entries for drivers, with filters. Although the GET /v2/drivers API endpoint also returns custom attribute values for each driver, it is more limited, as it only returns attribute values for the specified date. This API endpoint allows you to query the full history of attribute values for drivers, and see the date range in which those values applied.

Notes:

  • The result is paginated. Check the pagination property in the response to see the total number of pages and the current page number.
    • The exact number of entries per page may vary, as the results are paginated by driver rather than count of entries.
  • The entry history for the type, union and grade fields are also queryable through this endpoint. These entries appear under attribute ID driverType, driverUnion and driverGrade.
  • The specification for values and whether they are mandatory or not is determined by the attribute definitions in the "Driver attributes" preference in your Ops instance.
    • Attributes with type STRING will have value set to a string
    • Attributes with type NUMBER will have value set to a number
    • Attributes with type BOOLEAN will have value set to a boolean
    • Attributes with type DATE will have value set to a date string formatted as YYYY-MM-dd
    • Attributes with type SINGLE_SELECT will have value set to the value of one of the available select options
    • Attributes with type MULTI_SELECT will have value set to an array of strings (each one being the value of one of the available select options)
    • Attributes with type DURATION will have value set to a duration string formatted as HH:mm (where HH is an integer between 0 and 999, and mm is an integer between 0 and 59)
    • Attributes configured with "isMandatory": false may possibly have periods where the value is not set - in that case, the value will be omitted from the response
  • Information about the modelling of date periods for each entry:
    • startDate is mandatory
    • endDate is optional - if omitted, the entry value will be ongoing indefinitely into the future
Authorizations:
api_key
query Parameters
driverIds
Array of strings (DriverId)
  • Comma-separated list of driver IDs to filter for
attributeIds
Array of strings
  • Comma-separated list of attribute IDs to filter for (according to the attribute definitions in the "Driver attributes" preference in your Ops instance)
fromDate
string <date> (StringifyDate)
  • Date string formatted as YYYY-MM-dd. Only entries that end on or after this date are returned.
toDate
string <date> (StringifyDate)
  • Date string formatted as YYYY-MM-dd. Only entries that start on or before this date are returned.
page
integer <int32> (PageNumber)
  • 1-indexed integer indicating which page of results to pull

Responses

Response samples

Content type
application/json
{
  • "entries": [
    ],
  • "pagination": {
    }
}

CreateOrUpdateDriverCustomAttributeEntries

Creates or updates custom attribute entries for drivers. Although the POST /v2/drivers and PUT /v2/drivers API endpoints also allow you to create and update custom attribute values, they are more limited in that they only allow you to create and update custom attribute values as of the current date. This API endpoint allows you to manage the full history of custom attribute values for drivers.

Notes:

  • The specification of expected values and whether they are mandatory or not is determined by the attribute definitions in the "Driver attributes" preference in your Ops instance.
    • Attributes with type STRING expect a string to be set for value.
    • Attributes with type NUMBER expect a number to be set for value.
    • Attributes with type BOOLEAN expect a boolean to be set for value.
    • Attributes with type DATE expect a date string formatted as YYYY-MM-dd to be set for value.
    • Attributes with type SINGLE_SELECT expect the value of one of the available select options to be set for value.
    • Attributes with type MULTI_SELECT expect an array of strings (each one being the value of one of the available select options) to be set for value.
    • Attributes with type DURATION expect a duration string formatted as HH:mm (where HH is an integer between 0 and 999, and mm is an integer between 0 and 59) to be set for value.
    • Attributes configured with "isMandatory": false allow the value to be 'unset' - simply omit the value field for that entry to unset it.
  • Behaviour of the entryId field:
    • If an entryId is specified and an entry with that ID already exists, the existing entry will be updated.
    • If an entryId is specified and an entry with that ID does not already exist, a new entry will be created with the specified ID.
    • If an entryId is not specified, a new entry will be created with an automatically generated ID.
  • You must maintain the consistency of the attribute timeline:
    • No entries for a given attribute on a given driver should overlap each other
    • There should be no gap between the date periods of entries for a given attribute on a given driver (i.e. if one entry ends on 2024-01-01, the next entry should start on 2024-01-02)
    • Each attribute on a given driver should have exactly one entry with no end date
  • For non-mandatory attributes, if you wish to represent a period with 'no value set', create an entry with no value field for that date period.
  • Each request is atomic - either all entries listed in the request are created/updated successfully, or none are created/updated.
  • No more than 1000 entries can be created/updated in a single request - please break your request into multiple smaller chunks if you need to create/update more than 1000 entries.
Authorizations:
api_key
Request Body schema: application/json
required
required
Array of objects (PutDriversCustomAttributesEntry)
Array
endDate
string <date> (StringifyDate)

Stringified ISO8601 date in the form of YYYY-MM-dd, for example 2017-07-21

startDate
required
string <date> (StringifyDate)

Stringified ISO8601 date in the form of YYYY-MM-dd, for example 2017-07-21

required
(Array of numbers or strings) or string or boolean or number (AttributeValue)
Any of
Array
Any of
number <double>
attributeId
required
string

Attribute ID to update

driverId
required
string

Driver ID this attribute entry applies to

entryId
string

Optional identifier for an existing attribute entry. If provided, must be unique within the request. Cannot exceed 36 characters.

Responses

Request samples

Content type
application/json
{
  • "entries": [
    ]
}

Response samples

Content type
application/json
{
  • "createdEntryIds": [
    ],
  • "modifiedEntryIds": [
    ]
}

Driver Groups

API endpoints for managing driver groups.

ListDriverGroups

List driver groups that exist in the system.

Authorizations:
api_key
query Parameters
regionUuids
Array of strings (UUID)
  • Comma-separated list of region IDs to filter for
depotsIds
Array of strings (UUID)
Deprecated
  • [deprecated - use regionUuids instead] Comma-separated list of region IDs to filter for

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Vehicles

API endpoints for managing vehicles.

ListVehicles

List existing vehicles in the system, with optional filtering capability.

Notes:

  • The result is paginated. Check the pagination property in the response to see the total number of pages and the current page number.
Authorizations:
api_key
query Parameters
vehicleIds
string
  • Comma-separated list of vehicle IDs to filter for
onDate
string
  • Date string formatted as YYYY-MM-dd for which we want data returned. If not provided, today's date will be used. The date specified here affects the data returned for certain properties such as mainRegionPeriod, loanedRegionPeriods, decommissioned, and customAttributes, and also the behaviour of the isDecommissioned and regionNames query parameters.
regionNames
string
  • Comma-separated list of region names to filter on. Vehicles belonging to any of the regions (either main or loaned) on the date specified by onDate (or today's date if not provided) will be returned.
isDecommissioned
boolean
  • Whether to filter for decommissioned vehicles on the date specified by onDate (or today's date if not provided). Set to true to filter for decommissioned vehicles, and false to filter for active vehicles. Leave unspecified to return all vehicles.
page
integer <int32> (PageNumber)
  • 1-indexed integer indicating which page of results to pull

Responses

Response samples

Content type
application/json
{
  • "pagination": {
    },
  • "vehicles": [
    ]
}

CreateVehicles

Add new vehicles to the system.

Notes:

  • This API endpoint does not support modifying existing vehicles. If you need to update an existing vehicle, use the PUT /v1/vehicles API endpoint instead.
  • Each request is atomic - either all vehicles listed in the request are created successfully, or none are created.
  • No more than 1000 vehicles can be created in a single request - please break your request into multiple smaller chunks if you need to create more than 1000 vehicles.
  • The specification of expected values for the customAttributes field and whether they are mandatory or not is determined by the attribute definitions in the "Vehicle attributes" preference in your Ops instance.
    • Attributes with type STRING expect a string to be set for customAttributes[attributeId].
    • Attributes with type NUMBER expect a number to be set for customAttributes[attributeId].
    • Attributes with type BOOLEAN expect a boolean to be set for customAttributes[attributeId].
    • Attributes with type DATE expect a date string formatted as YYYY-MM-dd to be set for customAttributes[attributeId].
    • Attributes with type SINGLE_SELECT expect the value of one of the available select options to be set for customAttributes[attributeId].
    • Attributes with type MULTI_SELECT expect an array of strings (each one being the value of one of the available select options) to be set for customAttributes[attributeId].
    • Attributes with type DURATION expect a duration string formatted as HH:mm (where HH is an integer between 0 and 999, and mm is an integer between 0 and 59) to be set for customAttributes[attributeId].
Authorizations:
api_key
Request Body schema: application/json
required
required
Array of objects (NewVehicle)
Array
customAttributes
object

Custom attributes for the vehicle. Note that some custom attributes may be mandatory, according to the 'Vehicle attributes' preference in your Ops instance. Should be a mapping of the 'attributeId' (configured in your Ops instance) to the initial value for that custom attribute. The value will be validated according to the attribute definition configured in your Ops instance.

decommissionedOnDate
string <date> (StringifyDate)

Stringified ISO8601 date in the form of YYYY-MM-dd, for example 2017-07-21

decommissioned
boolean

Whether the vehicle is decommissioned.

model
string

The model of the vehicle, cannot exceed 36 characters.

type
string

The type of the vehicle. Depending on the 'Vehicle types' preference in your Ops instance, this may be mandatory. If specified, must be one of the vehicle types configured in your Ops instance.

description
string

A description of the vehicle, cannot exceed 65535 characters.

depotName
string

The name of the depot the vehicle is assigned to. If specified, should correspond to the 'unit' name returned by GET /v1/regions, and be a depot/unit belonging to the region.

regionName
required
string

The name of the region the vehicle is assigned to. Should correspond to the region name returned by GET /v1/regions.

parkingLocation
string

The parking location of the vehicle, cannot exceed 255 characters.

licensePlate
string

The license plate of the vehicle, cannot exceed 36 characters.

id
required
string

Unique identifier for the vehicle, cannot exceed 36 characters. Ideally corresponds to the ID for the vehicle in the external system that you are synchronizing with.

Responses

Request samples

Content type
application/json
{
  • "vehicles": [
    ]
}

Response samples

Content type
application/json
{
  • "createdVehicleIds": [
    ]
}

UpdateVehicles

Update existing vehicles in the system.

Notes:

  • This API endpoint expects a full representation of the vehicle. Omitting an optional field will clear the field.
  • This API endpoint does not support creating new vehicles. If you need to create a new vehicle, use the POST /v1/vehicles API endpoint instead.
  • Each request is atomic - either all vehicles listed in the request are updated successfully, or none are updated.
  • No more than 1000 vehicles can be updated in a single request - please break your request into multiple smaller chunks if you need to update more than 1000 vehicles.
  • The specification of expected values for the customAttributes field and whether they are mandatory or not is determined by the attribute definitions in the "Vehicle attributes" preference in your Ops instance.
    • Attributes with type STRING expect a string to be set for customAttributes[attributeId].
    • Attributes with type NUMBER expect a number to be set for customAttributes[attributeId].
    • Attributes with type BOOLEAN expect a boolean to be set for customAttributes[attributeId].
    • Attributes with type DATE expect a date string formatted as YYYY-MM-dd to be set for customAttributes[attributeId].
    • Attributes with type SINGLE_SELECT expect the value of one of the available select options to be set for customAttributes[attributeId].
    • Attributes with type MULTI_SELECT expect an array of strings (each one being the value of one of the available select options) to be set for customAttributes[attributeId].
    • Attributes with type DURATION expect a duration string formatted as HH:mm (where HH is an integer between 0 and 999, and mm is an integer between 0 and 59) to be set for customAttributes[attributeId].
  • If the value of any custom attribute is updated compared to the existing value, a new entry will be added to the history of that attribute starting from the current date.
Authorizations:
api_key
Request Body schema: application/json
required
required
Array of objects (EditedVehicle)
Array
customAttributes
object

Custom attributes for the vehicle. Note that some custom attributes may be mandatory, according to the 'Vehicle attributes' preference in your Ops instance. Should be a mapping of the 'attributeId' (configured in your Ops instance) to the initial value for that custom attribute. The value will be validated according to the attribute definition configured in your Ops instance.

decommissionedOnDate
string <date> (StringifyDate)

Stringified ISO8601 date in the form of YYYY-MM-dd, for example 2017-07-21

decommissioned
boolean

Whether the vehicle is decommissioned.

model
string

The model of the vehicle, cannot exceed 36 characters.

type
string

The type of the vehicle. Depending on the 'Vehicle types' preference in your Ops instance, this may be mandatory. If specified, must be one of the vehicle types configured in your Ops instance.

description
string

A description of the vehicle, cannot exceed 65535 characters.

parkingLocation
string

The parking location of the vehicle, cannot exceed 255 characters.

licensePlate
string

The license plate of the vehicle, cannot exceed 36 characters.

id
required
string

Unique identifier for the vehicle - should match a vehicle already created in Ops (either via the API, import process, or the Ops user interface)

Responses

Request samples

Content type
application/json
{
  • "vehicles": [
    ]
}

Response samples

Content type
application/json
{
  • "updatedVehicleIds": [
    ]
}

GetVehiclesDepotPeriods

Returns the information about the vehicles depot periods by vehicle ID.

Authorizations:
api_key
query Parameters
vehicleId
Array of strings
  • Returns the depot periods for the given vehicle IDs

Responses

Response samples

Content type
application/json
{
  • "property1": [
    ],
  • "property2": [
    ]
}

Vehicle Downtimes

API endpoints for managing downtimes for vehicles - i.e. periods where they are unavailable for service.

ListVehicleDowntimes

List existing vehicle downtimes in the system, with optional filtering capability.

Notes:

  • The result is paginated. Check the pagination property in the response to see the total number of pages and the current page number.
  • Information about the modelling of date/time periods for each entry:
    • startDate is mandatory
    • endDate is optional - if omitted, the downtime will be ongoing indefinitely
    • startTime and endTime are optional - if omitted, the downtime will be for the entire day(s) specified by startDate and endDate
Authorizations:
api_key
query Parameters
vehicleIds
string
  • Comma-separated list of vehicle IDs to filter for
fromDate
string
  • Date string formatted as YYYY-MM-dd. Only downtimes that end on or after this date are returned.
toDate
string
  • Date string formatted as YYYY-MM-dd. Only downtimes that start on or before this date are returned.
page
integer <int32> (PageNumber)
  • 1-indexed integer indicating which page of results to pull

Responses

Response samples

Content type
application/json
{
  • "downtimes": [
    ],
  • "pagination": {
    }
}

CreateOrUpdateVehicleDowntimes

Creates or updates downtimes for vehicles. As input, provide a list of downtime entries to create or update.

Notes:

  • Behaviour of the downtimeId field:
    • If a downtimeId is specified and a downtime with that ID already exists, the existing downtime will be updated.
    • If a downtimeId is specified and a downtime with that ID does not already exist, a new downtime will be created with the specified ID.
    • If a downtimeId is not specified, a new downtime will be created with an automatically generated ID.
  • Information about the modelling of date/time periods for each entry:
    • startDate is mandatory
    • endDate is optional - if omitted, the downtime will be ongoing indefinitely
    • startTime and endTime are optional - if omitted, the downtime will be for the entire day(s) specified by startDate and endDate
  • Each request is atomic - either all downtimes listed in the request are created/updated successfully, or none are created/updated.
  • No more than 1000 downtimes can be created/updated in a single request - please break your request into multiple smaller chunks if you need to create/update more than 1000 downtimes.
Authorizations:
api_key
Request Body schema: application/json
required
required
Array of objects (PutVehicleDowntimeEntry)
Array
note
string

A note describing the downtime. Cannot exceed 65535 characters.

endTime
integer <int32> (MinutesFromMidnightTime)

Wall clock time, represented as minutes since midnight. For example, 0 is midnight (start of the day), 120 is 02:00 (2 hours after midnight), 180 is 02:30 (2.5 hours after midnight), 1560 is 02:00 the next day (26 hours after midnight), etc.

startTime
integer <int32> (MinutesFromMidnightTime)

Wall clock time, represented as minutes since midnight. For example, 0 is midnight (start of the day), 120 is 02:00 (2 hours after midnight), 180 is 02:30 (2.5 hours after midnight), 1560 is 02:00 the next day (26 hours after midnight), etc.

endDate
string <date> (StringifyDate)

Stringified ISO8601 date in the form of YYYY-MM-dd, for example 2017-07-21

startDate
required
string <date> (StringifyDate)

Stringified ISO8601 date in the form of YYYY-MM-dd, for example 2017-07-21

vehicleId
required
string

ID of the vehicle this downtime applies to. Note: you may not modify the vehicle ID for an existing downtime, and will receive an error if you try to do so.

downtimeId
string

ID of the vehicle downtime to create or update. Must be unique within the request. Cannot exceed 36 characters.

Responses

Request samples

Content type
application/json
{
  • "downtimes": [
    ]
}

Response samples

Content type
application/json
{
  • "createDowntimeIds": [
    ],
  • "modifiedDowntimeIds": [
    ]
}

Vehicle Custom Attributes

API endpoints for managing custom attributes for vehicles - i.e. additional properties that can be set for vehicles - including querying and updating their historical values.

ListVehiclesCustomAttributeEntries

List custom attribute entries for vehicles, with filters. Although the GET /v1/vehicles API endpoint also returns custom attribute values for each vehicle, it is more limited, as it only returns attribute values for the specified date. This API endpoint allows you to query the full history of attribute values for vehicles, and see the date range in which those values applied.

Notes:

  • The result is paginated. Check the pagination property in the response to see the total number of pages and the current page number.
    • The exact number of entries per page may vary, as the results are paginated by vehicle rather than count of entries.
  • The entry history for the type field is also queryable through this endpoint. These entries appear under attribute ID vehicleType.
  • The specification for values and whether they are mandatory or not is determined by the attribute definitions in the "Vehicle attributes" preference in your Ops instance.
    • Attributes with type STRING will have value set to a string
    • Attributes with type NUMBER will have value set to a number
    • Attributes with type BOOLEAN will have value set to a boolean
    • Attributes with type DATE will have value set to a date string formatted as YYYY-MM-dd
    • Attributes with type SINGLE_SELECT will have value set to the value of one of the available select options
    • Attributes with type MULTI_SELECT will have value set to an array of strings (each one being the value of one of the available select options)
    • Attributes with type DURATION will have value set to a duration string formatted as HH:mm (where HH is an integer between 0 and 999, and mm is an integer between 0 and 59)
    • Attributes configured with "isMandatory": false may possibly have periods where the value is not set - in that case, the value will be omitted from the response
  • Information about the modelling of date periods for each entry:
    • startDate is mandatory
    • endDate is optional - if omitted, the entry value will be ongoing indefinitely into the future
Authorizations:
api_key
query Parameters
vehicleIds
string
  • Comma-separated list of vehicle IDs to filter for
attributeIds
string
  • Comma-separated list of attribute IDs to filter for (according to the attribute definitions in the "Vehicle attributes" preference in your Ops instance)
fromDate
string <date> (StringifyDate)
  • Date string formatted as YYYY-MM-dd. Only entries that end on or after this date are returned.
toDate
string <date> (StringifyDate)
  • Date string formatted as YYYY-MM-dd. Only entries that start on or before this date are returned.
page
integer <int32> (PageNumber)
  • 1-indexed integer indicating which page of results to pull

Responses

Response samples

Content type
application/json
{
  • "entries": [
    ],
  • "pagination": {
    }
}

CreateOrUpdateVehiclesCustomAttributeEntries

Creates or updates custom attribute entries for vehicles. Although the POST /v1/vehicles and PUT /v1/vehicles API endpoints also allow you to create and update custom attribute values, they are more limited in that they only allow you to create and update custom attribute values as of the current date. This API endpoint allows you to manage the full history of custom attribute values for vehicles.

Notes:

  • The specification of expected values and whether they are mandatory or not is determined by the attribute definitions in the "Vehicle attributes" preference in your Ops instance.
    • Attributes with type STRING expect a string to be set for value.
    • Attributes with type NUMBER expect a number to be set for value.
    • Attributes with type BOOLEAN expect a boolean to be set for value.
    • Attributes with type DATE expect a date string formatted as YYYY-MM-dd to be set for value.
    • Attributes with type SINGLE_SELECT expect the value of one of the available select options to be set for value.
    • Attributes with type MULTI_SELECT expect an array of strings (each one being the value of one of the available select options) to be set for value.
    • Attributes with type DURATION expect a duration string formatted as HH:mm (where HH is an integer between 0 and 999, and mm is an integer between 0 and 59) to be set for value.
    • Attributes configured with "isMandatory": false allow the value to be 'unset' - simply omit the value field for that entry to unset it.
  • Behaviour of the entryId field:
    • If an entryId is specified and an entry with that ID already exists, the existing entry will be updated.
    • If an entryId is specified and an entry with that ID does not already exist, a new entry will be created with the specified ID.
    • If an entryId is not specified, a new entry will be created with an automatically generated ID.
  • You must maintain the consistency of the attribute timeline:
    • No entries for a given attribute on a given vehicle should overlap each other
    • There should be no gap between the date periods of entries for a given attribute on a given vehicle (i.e. if one entry ends on 2024-01-01, the next entry should start on 2024-01-02)
    • Each attribute on a given vehicle should have exactly one entry with no end date
  • For non-mandatory attributes, if you wish to represent a period with 'no value set', create an entry with no value field for that date period.
  • Each request is atomic - either all entries listed in the request are created/updated successfully, or none are created/updated.
  • No more than 1000 entries can be created/updated in a single request - please break your request into multiple smaller chunks if you need to create/update more than 1000 entries.
Authorizations:
api_key
Request Body schema: application/json
required
required
Array of objects (PutVehiclesCustomAttributesEntry)
Array
endDate
string <date> (StringifyDate)

Stringified ISO8601 date in the form of YYYY-MM-dd, for example 2017-07-21

startDate
required
string <date> (StringifyDate)

Stringified ISO8601 date in the form of YYYY-MM-dd, for example 2017-07-21

required
(Array of numbers or strings) or string or boolean or number (AttributeValue)
Any of
Array
Any of
number <double>
attributeId
required
string

Attribute ID to update

vehicleId
required
string

Vehicle ID this attribute entry applies to

entryId
string

Optional identifier for an existing attribute entry. If provided, must be unique within the request. Cannot exceed 36 characters.

Responses

Request samples

Content type
application/json
{
  • "entries": [
    ]
}

Response samples

Content type
application/json
{
  • "createdEntryIds": [
    ],
  • "modifiedEntryIds": [
    ]
}

Roster

A roster describes the daily operator runs grouped into packages of (repeating) weekly work assignments.

GetRoster

Returns the roster information by roster ID.

Authorizations:
api_key
query Parameters
rosterId
required
string (UUID)
  • The roster ID to retrieve.
operationalDay
string <date> (StringifyDate)
  • Get the roster information for a specific date

Responses

Response samples

Content type
application/json
{
  • "stops": [
    ],
  • "assignmentsInfo": [
    ],
  • "lineInfo": [
    ],
  • "events": [
    ],
  • "blocks": [
    ],
  • "tasks": [
    ],
  • "rosterDataInfo": {
    }
}

Operational Plan

GetDepotOperationalPlan

WARNING: This is deprecated - you should use /v2/operational-plan described below. This API will not be supported beyond 2024-06-30. Returns the daily operational plans for a specified date range and a specific depot.

Spare Types Support: When the spare types feature flag is enabled, spare tasks will include additional properties:

  • spareType: The spare type code (e.g., "SPARE1", "SPARE2")
  • displayId: Will show the configured spare type name instead of the original display ID
  • dutyType: Will be set to "spare" for spare tasks
  • startTime and endTime: Will be included in the task summary for spare tasks based on the relevant spare type preference configuration
Authorizations:
api_key
path Parameters
depotId
required
string
  • Returns the daily operational plans for this depot ID
query Parameters
from
required
string <date> (StringifyDate)
  • Returns the operational plans from this date (both from and to are required)
to
required
string <date> (StringifyDate)
  • Returns the daily operational plans to this date (both from and to are required)
driversIds
string
  • Returns the daily operational plans for the filtered driver IDs (when this filter is used, the response won't include unassigned tasks)
vehicleIds
string
  • Returns the daily operational plans for the filtered vehicle IDs (when this filter is used, the response won't include unassigned blocks)
includeStops
string
  • When true, the response will include a full stop list on each trip (requests may take a long time or even time out)
assignedOnly
string
  • When true, the response will only contain tasks that have drivers assigned to them
includeUnassigned
string
  • In conjunction with supplying driver ids, When true return unassigned tasks as well as assigned tasks according to the driver filter.
fetchPlannedAssignmentsProperties
boolean
  • When true, the response will include the properties of the plannedAssignments
taskDisplayIds
string
Example: taskDisplayIds=T100,T200,T300
  • When specified, filters tasks, blocks, task assignments, and block assignments to only include those associated with the provided task display IDs. Can be a comma separated list (eg taskDisplayIds=T1,T2)

Responses

Response samples

Content type
application/json
{
  • "vehicles": [
    ],
  • "drivers": [
    ],
  • "assignments": [
    ],
  • "blocks": [
    ],
  • "tasks": [
    ]
}

GetOperationalPlan

WARNING: This is deprecated - you should use /v2/operational-plan described below. This API will not be supported beyond 2024-06-30. Returns the daily operational plans for a specified date range for every depot.

Spare Types Support: When the spare types feature flag is enabled, spare tasks will include additional properties:

  • spareType: The spare type code (e.g., "SPARE1", "SPARE2")
  • displayId: Will show the configured spare type name instead of the original display ID
  • dutyType: Will be set to "spare" for spare tasks
  • startTime and endTime: Will be included in the task summary for spare tasks based on the relevant spare type preference configuration
Authorizations:
api_key
query Parameters
from
required
string <date> (StringifyDate)
  • Returns the operational plans from this date (both from and to are required)
to
required
string <date> (StringifyDate)
  • Returns the daily operational plans to this date (both from and to are required)
taskDisplayIds
string
Example: taskDisplayIds=T100,T200,T300
  • When specified, filters tasks, blocks, task assignments, and block assignments to only include those associated with the provided task display IDs. Can be a comma separated list (eg taskDisplayIds=T1,T2)

Responses

Response samples

Content type
application/json
{
  • "depots": {
    }
}

GetOperationalPlanV2

Returns the daily operational plans for a specified date range. This endpoint provides comprehensive operational data including tasks, assignments, blocks, drivers, and vehicles.

Spare Types Support: When the spare types feature flag is enabled, spare tasks will include additional properties:

  • spareType: The spare type code (e.g., "SPARE1", "SPARE2")
  • displayId: Will show the configured spare type name instead of the original display ID
  • dutyType: Will be set to "spare" for spare tasks
  • startTime and endTime: Will be included in the task summary for spare tasks based on the relevant spare type preference configuration
Authorizations:
api_key
query Parameters
fromDate
required
string <date> (StringifyDate)
  • Returns the operational plans from this date (both fromDate and toDate are required). Date format is YYYY-MM-DD
toDate
required
string <date> (StringifyDate)
  • Returns the daily operational plans to this date (both fromDate and toDate are required). Date format is YYYY-MM-DD
depotUuids
string
Example: depotUuids=72999313-c6d3-44a3-9e64-a8cbce779ed7,e09cc074-b949-4d39-97b5-d2fa5eb1cdc5
  • When specified, the response will contain only these depots. When including more than one depot the request param can be a comma separated list (eg depotUuids=A,B) or you can use several request params (eg depotUuids=A?depotUuids=B)"
driverUuids
string
  • When specified, the response wil include only assignments for these drivers. When including more than one driver the request param can be a comma separated list (eg driverUuids=A,B) or you can use several request params (eg driverUuids=A?driverUuids=B)
includeStops
string
  • When true, the response will include a full stop list on each trip. Otherwise only origin and destination are included in request. (Usage may cause requests to take a long time)
includeUnassigned
string
  • In conjunction with supplying driver ids, When true return unassigned tasks as well as assigned tasks according to the driver filter.
fetchPlannedAssignmentsProperties
boolean
  • When true, the response will include the properties of the plannedAssignments
taskDisplayIds
string
Example: taskDisplayIds=T100,T200,T300
  • When specified, filters tasks, blocks, task assignments, and block assignments to only include those associated with the provided task display IDs. Can be a comma separated list (eg taskDisplayIds=T1,T2)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

GetCalendarPlannedAssignments

Returns the calendar planned assignments and tasks, with filters.

Spare Types Support: When the spare types feature flag is enabled, spare tasks will include additional properties:

  • spareType: The spare type code (e.g., "SPARE1", "SPARE2")
  • displayId: Will show the configured spare type name instead of the original display ID
  • dutyType: Will be set to "spare" for spare tasks
  • startTime and endTime: Will be included in the task summary for spare tasks based on the relevant spare type preference configuration
Authorizations:
api_key
query Parameters
depotId
required
string
  • Returns the calendar planned assignments for this depot ID
startDate
required
string <date> (StringifyDate)
  • Returns the calendar planned assignments from this date (both startDate and endDate are required)
endDate
required
string <date> (StringifyDate)
  • Returns the calendar planned assignments to this date (both startDate and endDate are required)
assignedOnly
boolean
  • optional. When true, the response will only contain planned assignments that have drivers assigned to them
driverIds
Array of strings (UUID)
  • optional. Returns the calendar planned assignments for the filtered driver IDs (when this filter is used, the response won't include unassigned tasks)
fetchStops
boolean
  • optional. When true, the response will also contain the tasks stops

Responses

Response samples

Content type
application/json
{
  • "tasks": [
    ],
  • "calendarDailyPlannedInformation": [
    ]
}

GetCalendarDriverDayLabels

Returns the calendar planned assignments and tasks, with filters.

Authorizations:
api_key
query Parameters
fromDate
required
string <date> (StringifyDate)
  • Returns the driver day labels from this date (both fromDate and toDate are required)
toDate
required
string <date> (StringifyDate)
  • Returns the the driver day labels to this date (both fromDate and toDate are required)
driverIds
Array of strings (UUID)
  • optional. Returns the driver day labels for the filtered driver IDs

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Tasks

GetCalendarInfo

Returns the Daily and Weekly tasks for a specified date range, with filters. Responds with 302 redirect when payload is too big. OriginalDriverId refers to the driver that was assigned to the task in the plan page

Spare Types Support: When the spare types feature flag is enabled, spare tasks will include additional properties:

  • spareType: The spare type code (e.g., "SPARE1", "SPARE2")
  • displayId: Will show the configured spare type name instead of the original display ID
  • dutyType: Will be set to "spare" for spare tasks
  • startTime and endTime: Will be included in the task summary for spare tasks based on the relevant spare type preference configuration
Authorizations:
api_key
path Parameters
depotId
required
string (UUID)
  • The depot to get the tasks from
query Parameters
from
required
string <date> (StringifyDate)
  • The start of the date range to return the tasks from
to
required
string <date> (StringifyDate)
  • The end of the date range to return the tasks from
plan
Array of strings (UUID)
  • Returns tasks from the given plans
group
Array of strings
  • Returns tasks from deployed plans for the given groups
type
Array of strings (TaskType)
Items Enum: "duty" "day_off" "standby" "spare" "custom"
  • Returns tasks from the given types
assignedOnly
boolean
  • Returns tasks that are either assigned or unassigned (depending on the input)
includeStops
boolean
  • Returns the stops of tasks (false by default)
driversIds
Array of strings (UUID)
  • Returns the assignments of filtered driver

Responses

Response samples

Content type
application/json
{
  • "calendarVehicleAssignments": [
    ],
  • "blocks": [
    ],
  • "tasks": [
    ],
  • "DailyTasks": [
    ],
  • "deployedPlans": [
    ],
  • "depotId": "string"
}

Stops

GetStops

Returns the stops for all depots of a user domain.

Authorizations:
api_key

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Signing Deviations

API endpoints for fetching signing deviations for drivers - i.e. the difference between the actual and expected sign-on and sign-off times for a driver.

CalculateSigningDeviations

Calculate the signing deviations for the drivers in the given date range and region. 'Signing deviations' refer to the difference between the actual and expected sign-on and sign-off times for a driver. The expected times are calculated based on the driver's assigned work.

Deviation might be classified either early or late, calculated according to a defined threshold.

Authorizations:
api_key
query Parameters
from
required
string <date> (StringifyDate)

The start of the date range to get the signing deviations from

to
required
string <date> (StringifyDate)

The end of the date range to get the signing deviations from

regionUuid
required
string (DepotId)

The region to get the signing deviations from

driverIds
Array of strings (DriverId)

The driver IDs for which to get the signing deviations. if empty all drivers will be returned

Responses

Response samples

Content type
application/json
{
  • "property1": {
    },
  • "property2": {
    }
}

Work Entities

GetWorkEntities

Retrieves workEntities values for depots within a specified date range and for specified driver IDs or by depotId. There is a limit of 204k work-entities calculation per request to avoid timeouts. This limit enables, for example, a calculation of 100 drivers for 30 days with 100 daily work-entities defined. In case the limit is exceeded, a 413 error code will be returned, together with the allowed amount of drivers for the existing configuration.

Authorizations:
api_key
query Parameters
depotId
string (DepotId)
  • Optional. The ID of a specific depot for which workEntities are to be retrieved.
driverIds
Array of strings (DriverUuid)
  • Optional. An array of driver IDs for whom workEntities are to be retrieved.
startDate
string <date> (StringifyDate)
  • The start date of the workEntities period.
endDate
string <date> (StringifyDate)
  • The end date of the workEntities period.
exportAllEntities
boolean
  • Optional. If true, all workEntities will be exported, regardless of the configuration.
shouldUseCache
boolean
  • Optional. Will attempt to retreive the data from the cache if true. If false, will always calculate the data.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

GetAPICalculationLimit

Fetches the maximum number of drivers allowed per API request of payroll or work-entities for the given dates for a particular client. To prevent timeouts, there is a cap of 204000 work-entity calculations per request. This cap allows, for instance, the calculation of 100 drivers over a 30-day period with 100 daily work-entities specified.

Authorizations:
api_key
query Parameters
startDate
string <date> (StringifyDate)
  • The start date of the workEntities period.
endDate
string <date> (StringifyDate)
  • The end date of the workEntities period.

Responses

Response samples

Content type
application/json
{
  • "limit": 0.1
}

Payroll

GetPayroll

Retrieves payroll values for depots within a specified date range and for specified driver IDs or by depotId. There is a limit of 204k work-entities calculation per request to avoid timeouts. This limit enables, for example, a calculation of 100 drivers for 30 days with 100 daily work-entities defined. In case the limit is exceeded, a 413 error code will be returned, together with the allowed amount of drivers for the existing configuration.

This endpoint is only available if the Use Payroll V2 feature flag is enabled and work-entity as well as payroll rules have been properly setup.

Authorizations:
api_key
query Parameters
depotId
string
  • Optional. The ID of a specific depot for which payroll is to be retrieved.
driverIds
Array of strings
  • Optional. An array of driver IDs for whom payroll is to be retrieved.
startDate
string <date> (StringifyDate)
  • The start date of the payroll period
endDate
string <date> (StringifyDate)
  • The end date of the payroll period
paycodes
Array of strings (CodeId)
  • Optional. An array of paycodes to filter the payroll values by. If not provided, all paycodes are returned.
shouldUseCache
boolean
  • Optional. Will attempt to retreive the data from the cache if true. If false, will always calculate the data.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Private Hires

PostPrivateHireOrder

Creation of a private hire order with one or more trips

This endpoint operates on eventual consistency. This means the private hire order is validated and enqueued for processing which is confirmed by a http 202 status response. The actual processing happens asynchronously and typically takes a few seconds. To verify the order was successfully added, use the GetPrivateHireOrder endpoint below specifying the the orderId you used in this request.

Private hire orders and trips should be unique by orderId, taskId and date respectively in the system.

Once the order is created, resources to fulfill the trips, such as drivers and vehicles, can be only assigned through the Optibus OPS platform.

An order can be created directly with a status 'confirmed' or the status of an order can be updated using the endpoint PATCH /private_hires/order/{orderId}. By default on creation, if there's no status being set, the order is being consider virtually as pending.

Multi-day trips:

Multi-day trips must be divided into individual trips per operational day. Trips can commence as early as 00:00 and extend up to a maximum of 36:00 local time, meaning trips can conclude as late as 12:00 noon the following day. Use cases that require trips to start and finish in different time zones are currently not supported.

Authorizations:
api_key
Request Body schema: application/json
required
orderStatus
string
Value: "confirmed"
orderId
required
string (OrderIdString) [ 1 .. 255 ] characters

External identifier of a private hire order that should be unique within the system

required
Array of objects (PrivateHireTask)

Representation of trips within a private hire order

Array
noVehicleNeeded
boolean

In case there's no need to allocate a vehicle.

note
string

Additional information about the trip that might be relevant for dispatchers. Information in the note can be used as a simplistic way of specifying vehicle requirements until it's being implemented. Expects plaintext without additional formatting such as html or markdown.

labelCodes
Array of strings

A collection of label codes, where each label specifies a particular characteristic of the private hire trip. For example, a label might indicate that the trip crosses a national border. It must exist in OPS Preferences

required
Array of objects (PrivateHireAPIEvent)

Array of sub-trips containing time and geographical information about their start and end.

Array
distance
number <double>

Estimated distance in meters for the sub-trip that the vehicle will have to travel.

note
string

Additional information relating to the sub-trip that could be relevant for the dispatchers.

labelCodes
Array of strings

A collection of label codes where each label specifies a particular characteristic of the private hire event.

required
object (PrivateHireLocation)
required
object (PrivateHireLocation)
required
ISO8601Time (string) or HourMinuteDuration (string) (TimeHHmmOrISO8601)
required
ISO8601Time (string) or HourMinuteDuration (string) (TimeHHmmOrISO8601)
required
OnScheduleEventsTypes.Deadhead (string) or OnScheduleEventsTypes.Custom (string) or OnScheduleEventsTypes.Break (string) or OtherEventTypes.PullIn (string) or OtherEventTypes.PullOut (string) or OtherEventTypes.PrivateHire (string) (PrivateHireEventTypes)
date
required
string

Operational date when the trip is meant to start, in format "YYYY-MM-dd".

depotName
required
string

Name of the depot the trip should be/is allocated to.

taskId
required
string (TaskDisplayIdString) [ 1 .. 1000 ] characters

External identifier of a private hire trip that should be unique within the system and that will be used internally in Optibus as the display ID.

Responses

Request samples

Content type
application/json
{
  • "orderStatus": "confirmed",
  • "orderId": "string",
  • "privateHires": [
    ]
}

Response samples

Content type
application/json
Example
null

GetPrivateHireOrder

Get information about a private hire order and its trips

As details of a private hire order and its trips can be modified in the OPS platform, external parties can use this endpoint to get the current state and details of a specific order, its trips, as well as the vehicle and driver resources associated.

Getting updates

Currently there's no support of a pushing mechanism in order to notify API consumers when something changes in resources that belong to a private hire order. As an alternative, until the push mechanism is implemented, this endpoint can be used following a polling strategy in order to identify changes that happen in a private hire order and the trips that belong to it.

Authorizations:
api_key
path Parameters
orderId
required
string

External identifier of a private hire order that should be unique within the system

Responses

Response samples

Content type
application/json
Example
{
  • "privateHires": [
    ],
  • "cancelledAt": "2019-08-24",
  • "confirmedAt": "2019-08-24",
  • "orderId": "string"
}

PatchPrivateHireOrder

Update a private hire order status

  • confirmed: status to determine that the order has been paid by the hiring entity. In the OPS Optibus platform, when a trip has any driver or vehicle associated to a confirmed order, a warning message will be displayed to inform the dispatchers about this fact.
  • cancelled: status to cancel the order, freeing up resources associated to trips belonging to the order, such as drivers and vehicles.
Authorizations:
api_key
path Parameters
orderId
required
string

External identifier of a private hire order that should be unique within the system

Request Body schema: application/json
required
orderStatus
required
string (SupportedOrderStatus)
Enum: "confirmed" "cancelled" "deleted"

Private hire order status.

  • confirmed: the order is meant to have been paid by the hiring entity. In the OPS Optibus platform, when a trip has any driver or vehicle associated, a warning message will be displayed to the inform the dispatchers about this fact.
  • cancelled: all trips of a private hire order have been cancelled and the resources associated to it, such as drivers and vehicles, have been freed up.
  • deleted: the order has been deleted as well as the trips belonging to that order. The resources associated to it, such as drivers and vehicles, have been freed up.

Responses

Request samples

Content type
application/json
{
  • "orderStatus": "confirmed"
}

Response samples

Content type
application/json
{
  • "errors": [
    ]
}

PatchPrivateHireOrderTrips

Update or cancel private hire tasks of an order

One or more private hire tasks can be updated/cancelled in the same request. Only send the private hire tasks that are meant to be updated or cancel, if tasks don't need to be modified, refrain to include them in the request. Updates for a subset of private hire tasks won't be supported, the request should be successful for all the intended private hire trips included in the request.

Splitting tasks in Optibus OPS platform

The private hire attribute taskId and date define the uniqueness of a task and is what's being used to find the private hire task to be updated or cancelled. In case the private hire is being updated, in certain cases they will be deleted and recreated, changing the event IDs. So in case these IDs are being consumed in any way, it's something to take into consideration.

Updates with unassign

When updating the 'date' or times of the events, the driver and vehicle will be automatically unassign, because the API doesn't account for potential overlaps or regulation compliance violations, unlike the OPS web client, for drivers and vehicles.

Dispatchers can split/cut these trips (a.k.a. driver duties), creating 2 trips or more. This action causes as a side effect, the renaming of the original value for the attribute taskId. As an example, if an original private hire trip had the attribute taskId as the value task-display-id, after a dispatcher splits the trip in the OPS Optibus platform, it will create 2 trips whose taskIds values will be task-display-id (1/2) and task-display-id (2/2).

Supported update use cases for private hire trips:

  • Cancellation
  • Events addition or removal
  • Modification of startTime or/and endTime in an event (sub-trip)
  • Update of the date

Note: At this moment, all the supported modifications will free up all the vehicles and drivers associated to the private hire trip, if there were any, given that it will cause a risk to violate regulation compliance rules, which are currently computed in the Optibus OPS web application.

If there's a modification that's not supported, the response status code returned will be a 400 malformed request, with an informative error that will point out that the change is not supported.

Authorizations:
api_key
path Parameters
orderId
required
string

External identifier of a private hire order that should be unique within the system

Request Body schema: application/json
required
required
Array of PrivateHireTask (object) or PatchPrivateHireCancellation (object)
Array
Any of
noVehicleNeeded
boolean

In case there's no need to allocate a vehicle.

note
string

Additional information about the trip that might be relevant for dispatchers. Information in the note can be used as a simplistic way of specifying vehicle requirements until it's being implemented. Expects plaintext without additional formatting such as html or markdown.

labelCodes
Array of strings

A collection of label codes, where each label specifies a particular characteristic of the private hire trip. For example, a label might indicate that the trip crosses a national border. It must exist in OPS Preferences

required
Array of objects (PrivateHireAPIEvent)

Array of sub-trips containing time and geographical information about their start and end.

Array
distance
number <double>

Estimated distance in meters for the sub-trip that the vehicle will have to travel.

note
string

Additional information relating to the sub-trip that could be relevant for the dispatchers.

labelCodes
Array of strings

A collection of label codes where each label specifies a particular characteristic of the private hire event.

required
object (PrivateHireLocation)
required
object (PrivateHireLocation)
required
ISO8601Time (string) or HourMinuteDuration (string) (TimeHHmmOrISO8601)
required
ISO8601Time (string) or HourMinuteDuration (string) (TimeHHmmOrISO8601)
required
OnScheduleEventsTypes.Deadhead (string) or OnScheduleEventsTypes.Custom (string) or OnScheduleEventsTypes.Break (string) or OtherEventTypes.PullIn (string) or OtherEventTypes.PullOut (string) or OtherEventTypes.PrivateHire (string) (PrivateHireEventTypes)
date
required
string

Operational date when the trip is meant to start, in format "YYYY-MM-dd".

depotName
required
string

Name of the depot the trip should be/is allocated to.

taskId
required
string (TaskDisplayIdString) [ 1 .. 1000 ] characters

External identifier of a private hire trip that should be unique within the system and that will be used internally in Optibus as the display ID.

Responses

Request samples

Content type
application/json
{
  • "privateHires": [
    ]
}

Response samples

Content type
application/json
Example
null

Driver App Notifications

GetPublicKey

Returns the public key that can be used to verify the payloads attached to URLs opened via a custom action attached to a notification received in the Optibus Driver App.

No authentication is required to access this endpoint.

Responses

Response samples

Content type
application/json
{
  • "publicKeyType": "string",
  • "publicKey": "string"
}

Real Time Stream

RealTimeStreamPost

Real-time operation stream from Optibus OPS system

The Optibus OPS real-time stream delivers changes in entities triggered by user in the OPS platform to subscribers via webhook requests.

ODS format based

Actions supported will be sent in requests to the subscribers, containing all the entities that were changed, such as runs, run_assignments, run_events, blocks and block_assignments with a format that has been inspired by ODS, following the same terminology for the name of attributes and entities, despite there's additional information to enrich the data streamed.

Note: Internal IDs can be found in attributes with _internal_id suffix, such as run_internal_id and block_internal_id and these can be used to uniquely identify entities if the OPS API is consumed, but for the integration these IDs shouldn't be used. It's recommended to use run_id and block_id to uniquely identify entities.

Subscriber URL and configuration

To set up a subscription, the subscriber must provide:

  • Callback URL – The endpoint where requests will be delivered.
  • Subscription Window – The relative range of operational days for which they want to receive events (e.g., previous and next days).
  • Action Types – The list of action_type operations they want to receive on this endpoint.
  • Operational Day Start Time – The time at which the customer’s or agency’s operational day begins.

Auth

The subscriber will receive a secret token that will be used to validate the request comes from Optibus as a trusted source. Before sending the webhook, we generate an HMAC signature using the same secret key for the request body, then include the result in a header X-HMAC-SIGNATURE. The subscriber will need to validates the request by generating the signature following the same process on their side and then comparing it to the X-HMAC-SIGNATURE header. If there's a match, the request should be accepted; otherwise, it should be rejected as it might come from an unauthorized source.

To generate a signature is a simple as:

 import crypto from "crypto";
 return crypto
.createHmac("sha256", subscriber.secret)
.update(JSON.stringify(realTimeOperation), "utf8")
.digest("base64");

Sequential processing of events

It's important that real-time operations that belong to an aggregate_id, value that's always included in every request payload, are sequentially processed by the consumers in order to guarantee correctness, given that operations could depend on each and if not processed chronologically in the order they were triggered, it could lead to data inconsistencies.

aggregate_id represents a funnel for all actions in a specific operational region and parallelism across different aggregate_id should be considered by the subscribers.

Retry mechanism

Successful Processing

If the subscriber returns any 2xx status code, the request is considered successfully processed. No further action will be taken.

Retry Mechanism

If the subscriber fails to process the request (e.g., due to server issues or downtime), the system will retry the request using an exponential backoff strategy for up to 2 minutes. Retries will be triggered when the subscriber responds with one of the following status codes:

  • 5xx (server errors)
  • 408 (Request Timeout)
  • 409 (Conflict)
  • 422 (Unprocessable Entity)
  • 425 (Too Early)
  • 429 (Too Many Requests)
Non-Retryable Responses
  • 4xx Errors (except those listed above): No retries will be attempted, as these indicate client-side issues that must be fixed by the subscriber.
  • 3xx Redirects: No retries will be attempted. Subscribers must provide a valid, direct URL that does not require redirection.
Sequential Processing by aggregate_id

Real-time operations for a given aggregate_id are processed sequentially. If a request for that aggregate_id fails and is being retried, no new operations will be streamed for that same aggregate_id until: The request succeeds, or The retry window (2 minutes) expires.

Request body payload examples for operational actions supported

Unassign Duty Operation
{
  "id": "90cb367f-3680-48c2-93a2-b162cb11ce9a",
  "customer": "superbus",
  "created_at": "2024-10-09T16:19:01.300Z",
  "aggregate_id": "operational-calendar-0d277b74-ab79-493f-8f1d-ec307420868d",
  "region_id": "0d277b74-ab79-493f-8f1d-ec307420868d",
  "operational_actions": [
    {
      "action_type": "unassign_duty",
      "operational_date": "2024-10-09",
      "entities_changes": [
        {
          "blocks": [],
          "block_assignments": [],
          "runs": [],
          "run_assignments": [
            {
              "run_internal_id": "b045c6f4-f827-4e82-833a-1c5e713ad0b2",
              "date": "2024-10-09",
              "driver_id": null,
              "run_id": "VU1002",
              "service_id": "etf0C81iX7",
              "entity_operation": "update"
            }
          ],
          "run_events": []
        }
      ]
    }
  ]
}
Assign Duty Operation
{
  "id": "90cb367f-3680-48c2-93a2-b162cb11ce9a",
  "customer": "superbus",
  "created_at": "2024-10-09T16:19:01.300Z",
  "aggregate_id": "operational-calendar-0d277b74-ab79-493f-8f1d-ec307420868d",
  "region_id": "0d277b74-ab79-493f-8f1d-ec307420868d",
  "operational_actions": [
    {
      "action_type": "assign_duty",
      "operational_date": "2024-10-09",
      "entities_changes": [
        {
          "blocks": [],
          "block_assignments": [],
          "runs": [],
          "run_assignments": [
            {
              "run_internal_id": "b045c6f4-f827-4e82-833a-1c5e713ad0b2",
              "date": "2024-10-09",
              "driver_id": "driver-123",
              "run_id": "VU1002",
              "service_id": "etf0C81iX7",
              "entity_operation": "update"
            }
          ],
          "run_events": []
        }
      ]
    }
  ]
}
Unassign Block Operation
{
  "id": "90cb367f-3680-48c2-93a2-b162cb11ce9a",
  "customer": "superbus",
  "created_at": "2024-10-09T16:19:01.300Z",
  "aggregate_id": "operational-calendar-0d277b74-ab79-493f-8f1d-ec307420868d",
  "region_id": "0d277b74-ab79-493f-8f1d-ec307420868d",
  "operational_actions": [
    {
      "action_type": "unassign_block",
      "operational_date": "2025-09-24",
      "entities_changes": [
        {
          "blocks": [],
          "block_assignments": [
            {
              "block_id": "Block EU3006",
              "block_internal_id": "bd8c55d2-7359-47b0-9a90-228872130eec",
              "date": "2025-09-24",
              "vehicle_id": null,
              "entity_operation": "update",
              "service_id": "QtyCFMaby"
            }
          ],
          "runs": [],
          "run_assignments": [],
          "run_events": []
        }
      ]
    }
  ]
}
Assign Block Operation
{
  "id": "90cb367f-3680-48c2-93a2-b162cb11ce9a",
  "customer": "superbus",
  "created_at": "2024-10-09T16:19:01.300Z",
  "aggregate_id": "operational-calendar-0d277b74-ab79-493f-8f1d-ec307420868d",
  "region_id": "0d277b74-ab79-493f-8f1d-ec307420868d",
  "operational_actions": [
    {
      "action_type": "assign_block",
      "operational_date": "2025-09-24",
      "entities_changes": [
        {
          "blocks": [],
          "block_assignments": [
            {
              "block_id": "Block EU3006",
              "block_internal_id": "bd8c55d2-7359-47b0-9a90-228872130eec",
              "date": "2025-09-24",
              "vehicle_id": "Vehicle 230",
              "entity_operation": "update",
              "service_id": "QtyCFMaby"
            }
          ],
          "runs": [],
          "run_assignments": [],
          "run_events": []
        }
      ]
    }
  ]
}
Swap Duties Operation
{
  "id": "90cb367f-3680-48c2-93a2-b162cb11ce9a",
  "customer": "superbus",
  "created_at": "2024-10-09T16:19:01.300Z",
  "aggregate_id": "operational-calendar-0d277b74-ab79-493f-8f1d-ec307420868d",
  "region_id": "0d277b74-ab79-493f-8f1d-ec307420868d",
  "operational_actions": [
    {
      "action_type": "assign_block",
      "operational_date": "2025-09-24",
      "entities_changes": [
        {
          "blocks": [],
          "block_assignments": [],
          "runs": [],
          "run_assignments": [
            {
              "run_internal_id": "48afea60-81ce-428c-bc93-622961f2e9b5",
              "date": "2024-10-09",
              "driver_id": "Driver 124",
              "run_id": "Duty VU1000",
              "service_id": "etf0C81iX7",
              "entity_operation": "update"
            }
          ],
          "run_events": []
        },
        {
          "blocks": [],
          "block_assignments": [],
          "runs": [],
          "run_assignments": [
            {
              "run_internal_id": "b045c6f4-f827-4e82-833a-1c5e713ad0b2",
              "date": "2024-10-09",
              "driver_id": "Driver 421",
              "run_id": "Duty VU2000",
              "service_id": "etf0C81iX7",
              "entity_operation": "update"
            }
          ],
          "run_events": []
        }
      ]
    }
  ]
}
Cut/split Duty Operation
{
  "id": "90cb367f-3680-48c2-93a2-b162cb11ce9a",
  "customer": "superbus",
  "created_at": "2024-10-09T16:19:01.300Z",
  "aggregate_id": "operational-calendar-0d277b74-ab79-493f-8f1d-ec307420868d",
  "region_id": "0d277b74-ab79-493f-8f1d-ec307420868d",
  "operational_actions": [
    {
       "action_type": "cut_duty",
       "operational_date": "2025-09-24",
       "entities_changes": [
         {
           "blocks": [],
           "block_assignments": [],
           "runs": [
             {
               "run_internal_id": "acaebae9-9804-4a2d-bd66-62f7cbb925a8",
               "run_id": "EU1008 (1/2)",
               "original_run_internal_id": "9da47cf8-f45b-40a0-a150-18f09503b2c1",
               "entity_operation": "create",
               "original_run_id": "EU1008",
               "reference_from": "split"
             },
             {
               "run_internal_id": "2b26543c-9094-4ebe-b3f0-e8789cd5a4a1",
               "run_id": "EU1008 (2/2)",
               "original_run_internal_id": "9da47cf8-f45b-40a0-a150-18f09503b2c1",
               "entity_operation": "create",
               "original_run_id": "EU1008",
               "reference_from": "split"
             }
           ],
           "run_assignments": [
             {
               "service_id": "ObP5ZTmaUy",
               "run_id": "EU1008",
               "run_internal_id": "86ab09ef-d145-4982-94ed-8f4a0b613ce9",
               "date": "2025-09-24",
               "driver_id": null,
               "entity_operation": "delete"
             },
             {
               "service_id": "ObP5ZTmaUy",
               "run_id": "EU1008 (1/2)",
               "run_internal_id": "acaebae9-9804-4a2d-bd66-62f7cbb925a8",
               "date": "2025-09-24",
               "driver_id": "006494",
               "entity_operation": "create"
             },
             {
               "service_id": "ObP5ZTmaUy",
               "run_id": "EU1008 (2/2)",
               "run_internal_id": "2b26543c-9094-4ebe-b3f0-e8789cd5a4a1",
               "date": "2025-09-24",
               "driver_id": "006494",
               "entity_operation": "create"
             }
           ],
           "run_events": [
             {
               "run_event_internal_id": "1f3263ea-65b2-4954-a8ce-8eb3ef1a0b60",
               "event_type": "deadhead",
               "start_time": "05:01",
               "start_location": "1",
               "end_location": "140143",
               "end_time": "05:10",
               "event_sequence": 1,
               "run_internal_id": "acaebae9-9804-4a2d-bd66-62f7cbb925a8",
               "run_id": "EU1008 (1/2)",
               "service_id": "ObP5ZTmaUy",
               "entity_operation": "update",
               "block_id": "EU1007",
               "block_internal_id": "4472986c-0f4f-478d-a1e3-8c7f6d904d19"
             },
             {
               "run_event_internal_id": "30da3618-e771-4ee8-9821-ba14268c4400",
               "trip_id": "TRIP_ID_12345",
               "event_type": "service_trip",
               "start_time": "05:10",
               "start_location": "140143",
               "end_location": "141569",
               "end_time": "05:30",
               "event_sequence": 2,
               "run_internal_id": "acaebae9-9804-4a2d-bd66-62f7cbb925a8",
               "run_id": "EU1008 (1/2)",
               "service_id": "ObP5ZTmaUy",
               "entity_operation": "update",
               "block_id": "EU1007",
               "block_internal_id": "4472986c-0f4f-478d-a1e3-8c7f6d904d19"
             },
             {
               "run_event_internal_id": "b119d22f-1f53-4e4b-80c6-e3ab77ac1d90",
               "trip_id": "TRIP_ID_5423",
               "event_type": "service_trip",
               "start_time": "05:45",
               "start_location": "140167",
               "end_location": "140143",
               "end_time": "06:00",
               "event_sequence": 3,
               "run_internal_id": "acaebae9-9804-4a2d-bd66-62f7cbb925a8",
               "run_id": "EU1008 (2/2)",
               "service_id": "ObP5ZTmaUy",
               "entity_operation": "update",
               "block_id": "EU1007",
               "block_internal_id": "4472986c-0f4f-478d-a1e3-8c7f6d904d19"
             },
             {
               "run_event_internal_id": "215625a0-2e75-46d7-b496-fede700a01e7",
               "trip_id": "TRIP_ID_9821",
               "event_type": "service_trip",
               "start_time": "06:00",
               "start_location": "140143",
               "end_location": "141569",
               "end_time": "06:20",
               "event_sequence": 4,
               "run_internal_id": "acaebae9-9804-4a2d-bd66-62f7cbb925a8",
               "run_id": "EU1008 (2/2)",
               "service_id": "ObP5ZTmaUy",
               "entity_operation": "update",
               "block_id": "EU1007",
               "block_internal_id": "4472986c-0f4f-478d-a1e3-8c7f6d904d19"
             }
           ]
         }
       ]
    }
  ]
}
Cut/split Block Operation
{
  "id": "90cb367f-3680-48c2-93a2-b162cb11ce9a",
  "customer": "superbus",
  "created_at": "2024-10-09T16:19:01.300Z",
  "aggregate_id": "operational-calendar-0d277b74-ab79-493f-8f1d-ec307420868d",
  "region_id": "0d277b74-ab79-493f-8f1d-ec307420868d",
  "operational_actions": [
    {
      "action_type": "cut_block",
      "operational_date": "2025-09-24",
      "entities_changes": [
        {
          "blocks": [
            {
              "block_internal_id": "b66bfa61-714b-4e4f-af5d-49f6ced103c3",
              "block_id": "Block EU1084 (1/2)",
              "original_block_internal_id": "02890089-ae62-44a4-9eb8-17697deac901",
              "original_block_id": "Block EU1084",
              "service_id": "ObP5ZTmaUy",
              "entity_operation": "create",
              "reference_from": "split"
            },
            {
              "block_internal_id": "15a985f4-0382-494a-9e7e-c310196563f4",
              "block_id": "Block EU1084 (2/2)",
              "original_block_internal_id": "02890089-ae62-44a4-9eb8-17697deac901",
              "original_block_id": "Block EU1084",
              "service_id": "ObP5ZTmaUy",
              "entity_operation": "create",
              "reference_from": "split"
            }
          ],
          "block_assignments": [
            {
              "block_id": "Block EU1084",
              "block_internal_id": "4dc6e8f1-47a7-4008-90cd-80a6f5141d02",
              "date": "2025-09-24",
              "vehicle_id": "2336",
              "entity_operation": "delete",
              "service_id": "ObP5ZTmaUy"
            },
            {
              "block_id": "Block EU1084 (1/2)",
              "block_internal_id": "b66bfa61-714b-4e4f-af5d-49f6ced103c3",
              "date": "2025-09-24",
              "vehicle_id": "2336",
              "entity_operation": "create",
              "service_id": "ObP5ZTmaUy"
            },
            {
              "block_id": "Block EU1084 (2/2)",
              "block_internal_id": "15a985f4-0382-494a-9e7e-c310196563f4",
              "date": "2025-09-24",
              "vehicle_id": "2336",
              "entity_operation": "create",
              "service_id": "ObP5ZTmaUy"
            }
          ],
          "runs": [],
          "run_assignments": [],
          "run_events": [
            {
              "run_event_internal_id": "03cdba95-196e-498e-ad1c-67f012779d95",
              "event_type": "deadhead",
              "start_time": "10:36",
              "start_location": "1",
              "end_location": "020959",
              "end_time": "10:45",
              "event_sequence": 0,
              "entity_operation": "update",
              "run_internal_id": "50e527d1-a2af-4502-a1da-f983e377518a",
              "run_id": "EU1002",
              "block_id": "Block EU1084 (1/2)",
              "block_internal_id": "b66bfa61-714b-4e4f-af5d-49f6ced103c3",
              "service_id": "ObP5ZTmaUy"
            },
            {
              "run_event_internal_id": "e53380be-e28e-4732-8fd4-725228ac2fc4",
              "trip_id": "TRIP_ID_1234",
              "event_type": "service_trip",
              "start_time": "10:45",
              "start_location": "020959",
              "end_location": "140638",
              "end_time": "11:25",
              "event_sequence": 1,
              "entity_operation": "update",
              "run_internal_id": "50e527d1-a2af-4502-a1da-f983e377518a",
              "run_id": "EU1002",
              "block_id": "Block EU1084 (1/2)",
              "block_internal_id": "b66bfa61-714b-4e4f-af5d-49f6ced103c3",
              "service_id": "ObP5ZTmaUy"
            },
            {
              "run_event_internal_id": "1fe96a0d-f009-467c-be45-1757ae70f131",
              "trip_id": "TRIP_ID_5326",
              "event_type": "service_trip",
              "start_time": "11:30",
              "start_location": "140637",
              "end_location": "020959",
              "end_time": "12:10",
              "event_sequence": 2,
              "entity_operation": "update",
              "run_internal_id": "50e527d1-a2af-4502-a1da-f983e377518a",
              "run_id": "EU1002",
              "block_id": "Block EU1084 (1/3)",
              "block_internal_id": "b66bfa61-714b-4e4f-af5d-49f6ced103c3",
              "service_id": "ObP5ZTmaUy"
            }
          ]
        }
      ]
    }
  ]
}
Request Body schema: application/json
required
required
Array of objects (OperationalAction)

List of operational actions triggered by a user in OPS platform. A single action triggered by a user has the potential of creating multiple operational actions. A user action could cause multiple operational action types for an operational day, such as [example] or actions for multiple operational days, such as adding a driver absence that could unassign the driver along multiple days.

Array
required
Array of objects (EntityChanges)

The payload containing the detailed operational creating, deleting or updating entities such as blocks, block_assignments, runs, run_assignments and run_events.

Array
required
Array of objects (RunEventODS)
required
Array of objects (RunAssignmentODS)
required
Array of objects (RunODS)
required
Array of objects (BlockAssignmentODS)
required
Array of objects (BlockODS)
operational_date
required
string

The date of the operation in "YYYY-MM-DD" format

action_type
required
string (RealTimeOperationType)
Enum: "cut_duty" "cut_block" "assign_duty" "unassign_duty" "swap_duty_assignment" "assign_block" "unassign_block"
customer
required
string

The customer or agency the operation applies to

aggregate_id
required
string

Aggregate identifier, typically to group related operations Sequentiality in processing real-time events for an aggregateId should be guaranteed by the provider. Parallelism in the processing of events could be performed across events belonging to different aggregateId.

region_id
required
string

Identifier of the region the operation pertains to

created_at
required
string

Timestamp of the operation

id
required
string

UUID for the real-time operation

Responses

Request samples

Content type
application/json
{
  • "id": "90cb367f-3680-48c2-93a2-b162cb11ce9a",
  • "customer": "superbus",
  • "created_at": "2024-10-09T16:19:01.300Z",
  • "aggregate_id": "operational-calendar-0d277b74-ab79-493f-8f1d-ec307420868d",
  • "region_id": "0d277b74-ab79-493f-8f1d-ec307420868d",
  • "operational_actions": [
    ]
}

Drivers (Deprecated)

These API endpoints are deprecated and could be removed in a future version. Please use the corresponding new API endpoints instead, which should offer improved usability and extra functionality.

GetAbsencesByDriverIdV1Deprecated Deprecated

WARNING: This API endpoint is deprecated - you should use GET /v2/drivers/absences instead.

Returns absences of drivers.

  • this does include absences configured for specific Driver Groups
  • this does not include Public Holidays as configured in preferences
Authorizations:
api_key
query Parameters
driver
Array of strings (UUID)
  • Returns the absences of drivers by driver ID
from
string <date> (StringifyDate)
  • Returns the absences for a specified date range (both from and to are required)
to
string <date> (StringifyDate)
  • Returns the absences for a specified date range (both from and to are required)

Responses

Response samples

Content type
application/json
{
  • "property1": [
    ],
  • "property2": [
    ]
}

ListDriversV0Deprecated Deprecated

WARNING: This API endpoint is deprecated - you should use GET /v2/drivers instead.

Returns the driver information, with filters.

Authorizations:
api_key
query Parameters
driversIds
Array of strings (UUID)
  • Returns the driver information for the given driver IDs
date
string <date> (StringifyDate)
  • Returns the attributes information for the given date

Responses

Response samples

Content type
application/json
[
  • {
    }
]

CreateOrUpdateDriversV1Deprecated Deprecated

WARNING: This API endpoint is deprecated - you should use POST /v2/drivers and PUT /v2/drivers instead.

Adds or updates a specific driver.

Authorizations:
api_key
Request Body schema: application/json
required
Array
opUnitId
string
Deprecated

The unit a driver is assigned to. Editing a driver's unit will create a new depot period with the new information.

DEPRECATED: Use depotName instead. This property name is misleading - it actually refers to depot name, not ID.

Expected: Depot name (e.g., "MyBusCompany Central")

depotName
string

The depot (unit) a driver is assigned to. Editing a driver's depot will create a new depot period with the new information.

Expected: Depot name (e.g., "MyBusCompany Central")

group
string
Deprecated

The group a driver is assigned to. A driver can be part of only one group. Editing a driver's group will create a new depot period with the new information.

DEPRECATED: Use groupName instead for clearer API design.

Expected: Group name (e.g., "Morning Shift")

groupName
string

The group a driver is assigned to. A driver can be part of only one group. Editing a driver's group will create a new depot period with the new information.

Expected: Group name (e.g., "Morning Shift")

depot
string
Deprecated

The main region a driver is assigned to. Editing a driver's region will create a new depot period with the new information.

DEPRECATED: Use regionName instead. This property name is historic and incorrect - it actually refers to the region.

Expected: Region name (e.g., "MyBusCompany West")

regionName
string

The region a driver is assigned to. Editing a driver's region will create a new depot period with the new information.

Expected: Region name (e.g., "MyBusCompany West")

startDate
string
id
required
string

The driver ID provided by the user. It can be up to 36 characters with no gaps.

firstName
required
string

The driver’s first name

lastName
required
string

The driver’s last name

middleName
string

The driver’s middle name

avatar
string

The driver’s avatar. This is the url of an image of the driver. It needs to be accessible on the public internet.

mobileNumber
string

The driver’s mobile phone number

homeNumber
string

The driver’s home phone number

emailAddress
string

The driver’s email address

driverType
string
driverUnion
string
driverGrade
string
attributes
object

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{ }

ListSigningDeviationsV0Deprecated Deprecated

WARNING: This API endpoint is deprecated - you should use GET /v1/drivers/signing-deviations instead.

Calculate the signing deviations for the drivers in the given date range and region. If driverIds is empty, all drivers will be returned Signing deviations are calculated as the difference between the expected and actual signing times, for each sign on or sign off event. Deviation might be either early or late, calculated according to a defined threshold.

Authorizations:
api_key
query Parameters
from
required
string <date> (StringifyDate)

The start of the date range to get the signing deviations from

to
required
string <date> (StringifyDate)

The end of the date range to get the signing deviations from

regionUuid
required
string (DepotId)

The region to get the signing deviations from

driverIds
Array of strings (DriverId)

The driver IDs for which to get the signing deviations. if empty all drivers will be returned

Responses

Response samples

Content type
application/json
{
  • "property1": {
    },
  • "property2": {
    }
}

GetAttributesByDriverIdV2Deprecated Deprecated

WARNING: This API endpoint is deprecated - you should use GET /v2/drivers/custom-attributes instead.

Returns the driver attributes.

Authorizations:
api_key
query Parameters
driverIds
Array of strings (DriverId)
  • Returns the driver attributes by driver ID
from
string
  • Returns the attributes for a specified date range (both from and to are required)
to
string
  • Returns the attributes for a specified date range (both from and to are required)

Responses

Response samples

Content type
application/json
{
  • "version": 0.1,
  • "driverAttributes": {
    }
}

Vehicles (Deprecated)

These API endpoints are deprecated and could be removed in a future version. Please use the corresponding new API endpoints instead, which should offer improved usability and extra functionality.

ListVehiclesV0Deprecated Deprecated

WARNING: This API endpoint is deprecated - you should use GET /v1/vehicles instead.

Returns the information for vehicles, with filters.

Authorizations:
api_key
query Parameters
vehicleIds
Array of strings (UUID)
  • Returns the information for the given vehicles by vehicle ID
depotIds
Array of strings (UUID)
  • Returns the information for vehicles that are that are loaned or assigned to the given depot IDs, on the given date or today if date is not provided
date
string <date> (StringifyDate)
  • Returns the attributes information for the given date

Responses

Response samples

Content type
application/json
[
  • {
    }
]

ListVehicleAttributesV1Deprecated Deprecated

WARNING: This API endpoint is deprecated - you should use GET /v1/vehicles/custom-attributes instead.

Returns the vehicle attributes.

Authorizations:
api_key
query Parameters
vehicleIds
Array of strings (VehicleId)
  • Returns the vehicle attributes by vehicle ID
from
string
  • Returns the attributes for a specified date range (both from and to are required)
to
string
  • Returns the attributes for a specified date range (both from and to are required)

Responses

Response samples

Content type
application/json
{
  • "attributes": {
    },
  • "attributeMap": {
    }
}

Changelog

Below, we use the following icons to indicate the type of changes:

  • 🐞 Bugfix: correcting API behavior to what was previously indicated. No breaking change
  • 🌟 Addition: New properties, request filtering capabilities, or endpoints. No breaking change
  • 💥 Breaking change. This would typically result in us adding a new version of an endpoint prepended with an increased version prefix such as /v2/endpointName to /v3/endpointName. See section Versioning.

v2.8.2 - 2026-02-02 🌟🐞

  • 🌟 Improved detail for many driver- and vehicle-related endpoints in the API documentation.
  • 🐞 POST /v2/drivers: fix bug where response status code when trying to create a driver with an ID that already exists was 422 instead of 409
  • 🐞 POST /v1/vehicles: fix bug where response status code when trying to create a vehicle with an ID that already exists was 422 instead of 409
  • 🐞 Improved consistency of pagination behaviour across multiple recently added endpoints. Requests for a page number that is out of range now return a 404 error response. Additionally, the totalPages value now behaves consistently across all these endpoints when there are zero results (some endpoints returned 0 total pages and some returned 1 - now all will return 1 in this scenario).
    • GET /v2/drivers
    • GET /v2/drivers/absences
    • GET /v2/drivers/custom-attributes
    • GET /v2/drivers/employment-periods
    • GET /v1/vehicles
    • GET /v1/vehicles/custom-attributes
    • GET /v1/vehicles/downtimes

v2.8.1 - 2026-02-02 🌟

  • 🐞 GET /v1/vehicles/downtimes: fix bug where some values incorrectly returned null instead of being undefined, contrary to the behaviour stated in the API documentation.

v2.8.0 - 2026-01-30 🌟

  • 🌟 GET /v2/drivers/custom-attributes: new endpoint to query driver custom attributes with entry IDs for synchronization with third party systems. Supports filtering by driver IDs, attribute IDs, and date range. Results are paginated (100 drivers per page) and sorted by driver ID, attribute ID, and start date.
  • 🌟 PUT /v2/drivers/custom-attributes: new endpoint to create/update driver custom attribute entries with entry IDs for synchronization with third party systems.
  • 💥 GET /v2/driver-attributes: deprecated in favor of GET /v2/drivers/custom-attributes. The new endpoint provides entry IDs, improved pagination, and better filtering capabilities.

v2.7.2 - 2026-01-30 🌟

  • 🌟 GET /v2/operational-plan: Added taskDisplayIds query parameter to filter tasks by display ID. Filtering cascades to related duty assignments, blocks with task events, and vehicle assignments.

v2.7.1 - 2026-01-26 🌟

  • 🌟 PATCH /private_hires/order/{orderId}: Support deletion of a private hire order and all its associated resources, such as tasks and blocks.

v2.7.0 - 2026-01-15 🌟

  • 🌟 POST /v2/drivers: new endpoint to create drivers
  • 🌟 PUT /v2/drivers: new endpoint to update drivers
  • 🐞 POST /v1/vehicles: fix bug where response status on creating new vehicles was 200 instead of 201

v2.6.1 - 2026-01-14 🌟

  • 🌟 Fixed typing bug as originDepot and destinationDepot are sometimes undefined in duty event summaries across multiple endpoints. Despite this they were typed as required. Now these fields are correctly typed as optional. Affects the following endpoints:
    • GET /v1/operational-plan
    • GET /v2/operational-plan
    • GET /v1/calendar
    • GET /v1/calendar/planned-assignments

v2.6.0 - 2026-01-12 🌟

  • 🌟 GET /v2/drivers: new endpoint to fetch paginated driver information with advanced filtering capabilities. Supports filtering by driver IDs, region names, employment status, and date. Results are sorted by driver ID and paginated (100 results per page).
  • 💥 GET /driver: deprecated in favor of GET /v2/drivers. The new endpoint provides improved filtering, pagination, and date-based filtering capabilities.

v2.5.0 - 2025-12-28 🌟

  • 🌟 GET /v2/drivers/employment-periods: new paginated endpoint to query driver employment periods. Supports filtering by driver IDs and date range. Returns up to 100 results per page, sorted by driver ID, start date, and end date.

v2.4.0 - 2025-12-22 🌟

  • 🌟 GET /v2/drivers/absences: new paginated endpoint to query driver absences. Supports filtering by driver IDs, absence codes, and date range. Returns up to 100 results per page, sorted by driver ID, start date, start time, end date, and end time.

v2.3.25 - 2025-12-29 🌟

  • 🌟 PUT /v1/vehicles/custom-attributes: new endpoint to create and update vehicle custom attributes.

v2.3.24 - 2025-12-24 🌟

  • 🌟 POST /v1/absences: Added balance validation feature. When the entitlementBanksEffectiveDate feature flag is enabled, the API validates that absences do not cause negative balance violations for entitlement banks that do not allow negative balances. If violations are detected, the API returns HTTP 422 with details about which drivers have violations and which banks are affected.
    • Added optional skipBalanceValidation query parameter (defaults to false). When set to "true", skips balance validation.
    • The HTTP 422 error can only occur when ALL of the following conditions are met:
      1. The entitlementBanksEffectiveDate feature flag is enabled
      2. Entitlement banks are configured and do NOT allow negative balances
      3. The driver has entitlements
      4. The absence is connected to the bank (by absence type)
      5. The driver would violate the balance constraints (would cause negative balance)
      6. The skipBalanceValidation query parameter is NOT set to "true" (validation is enabled by default)

v2.3.23 - 2025-12-11 🌟

  • 🌟 GET /v1/vehicles/custom-attributes: new endpoint to fetch vehicle custom attributes.

v2.3.22 - 2025-12-03 🌟

  • 🌟 POST /v1/drivers/employment-periods: new endpoint to create driver employment periods.
  • 🌟 PUT /v1/drivers/employment-periods/{periodId}: new endpoint to update driver employment periods by ID.

v2.3.21 - 2025-12-02 🌟

  • 🌟 PUT /v1/vehicles/downtimes: new endpoint to create or update vehicle downtimes

v2.3.20 - 2025-11-28 🐞

  • 🐞 POST /v1/absences: fix an issue where modifying the dates of an existing absence would sometimes be blocked by an incorrect validation error.

v2.3.19 - 2025-11-20 🐞

  • 🐞 POST /v1/drivers: fix bug where using regionName field returned validation error instead of accepting it

v2.3.18 - 2025-11-19 🌟

  • 🌟 GET /v1/vehicles/downtimes: fixes a couple of minor property naming issues with the response body. This is a non-breaking change as the API endpoint itself was not released yet at the time of the fix.

v2.3.17 - 2025-11-13 🌟

  • 🌟 PUT /v1/vehicles: new endpoint to update vehicles.

v2.3.16 - 2025-11-03 🌟

  • 🌟 GET /v1/vehicles/downtimes: new endpoint to fetch vehicle downtimes with filtering and pagination.

v2.3.15 - 2025-10-30 🌟

  • 🌟 GET /v2/operational-plan: Added lastAssignedDriverId field to assignment properties in response.

v2.3.14 - 2025-10-29 🌟

  • 🌟 POST /v1/vehicles: new endpoint to create vehicles.

v2.3.13 - 2025-10-13 🌟

  • 🌟 GET /v1/vehicles: new endpoint to fetch a list of vehicles.

v2.3.12 - 2025-10-09

  • 🌟 Calendar external APIs spare types support: Enhanced calendar and operational-plan endpoints to include spare types configuration when the feature flag is enabled. Spare tasks now display with proper type names and additional metadata including start/end times and spare type codes. Affected endpoints:
    • GET /v1/calendar/{depotId}
    • GET /v1/calendar-planned-assignments/{depotId}
    • GET /v1/operational-plan/{depotId}
    • GET /v1/operational-plan, GET /v2/operational-plan

v2.3.11 - 2025-10-02

  • 🌟 GET /v1/preferences/absence-types: new endpoint to fetch a list configured absence types.

v2.3.10 - 2025-08-18 🌟

  • 🌟 GET /v1/driver-day-labels: new endpoint to fetch a list of labels applied for drivers within a given date range.

v2.3.9 - 2025-08-06 🐞🌟

  • 🐞 POST /v1/drivers: fix API documentation inconsistency where note field was documented as supported but was actually rejected by the API
  • 🌟 POST /v1/drivers: add new clearly named fields with deprecation of confusing legacy field names:
    • Added regionName field (use instead of deprecated depot field)
    • Added groupName field (use instead of deprecated group field)
    • Added depotName field (use instead of deprecated opUnitId field)
    • Legacy fields remain supported for backward compatibility

Note: These changes are non-breaking because the note field was never functional, and all other changes only add new fields while maintaining full backward compatibility with existing field names.

v2.3.8 - 2025-05-23 🐞

  • 🐞 GET /v1/operational-plan/{depotId}, GET /v1/operational-plan, GET /v2/operational-plan: fix bug in response body where assignments.properties.cancellationReason was under certain conditions returned as a string instead of as an object

v2.3.7 - 2025-03-18 🌟

  • 🌟 POST /v1/drivers: add support for custom attributes

v2.3.6 - 2024-10-20 🌟🐞

  • 🌟 new /v1/preferences/holidays endpoint added

v2.3.5 - 2024-09-16 🌟🐞

  • Apidoc improvements
    • 🐞 fix wrongly described endpoint of /v1/regions (was incorrectly specified as /region in v2.3.4)

v2.3.4 - 2024-08-27 🌟

  • 🌟 Added new endpoint /v1/regions

v2.3.3 - 2024-08-26 🌟

  • 🌟 /group endpoint now returns regionUuid field, which is an alias of deprecated depot field
  • 🌟 /group endpoint now returns additional regionName field

v2.3.2 - 2024-07-28 🌟

🌟 Added the optibusTimeplanId field to the optibus Ids object within tasks and blocks

v2.3.1 - 2024-07-15 🌟

Op Units in assignments - we are introducing the op unit in the operational plan. in V1 and V2, the naming of depots remains unchanged although for some customers this would be considered a region. Within these customers, the lower level division is called an operational unit (opUnit). In future versions, "depots" would be renamed to "region", and units would be renamed to "depot".

  • 🌟 Addition: Op Units in the operational calendar assignment
    • in both V1/V2, Op Unit Uuid now appears in the properties of each assignment
    • in V2 only, the full list of op units is available at the region level

v2.3.0 - 2024-07-03 🌟

Introducing support for private hire endpoints

  • POST /private_hires/order: Creation of the private hire order and trips associated to it.
  • GET /private_hires/order/{orderId}/info: Retrieval of the private hire order, the trips associated and the driver/vehicle assignments, besides other useful information.
  • PATCH /private_hires/order/{orderId}: Modification of private hire order status.
  • PATCH /private_hires/order/{orderId}/trips: Modification of trips associated to a private hire order.

v2.2.1 - 2024-07-02 🌟

  • 🌟 Added a new optional parameter 'includeUnassigned' to 'v1/operational-plan' and 'v2/operational-plan'. In conjunction with supplying driver ids, this would instruct the endpoint to return unassigned tasks as well as assigned tasks according to the driver filter.

v2.2.0 - 2024-03-10 🌟

Adjustment to operational-plan endpoints. Additional properties were added, and some additional aliases introduced for a more coherent naming structure. This is intended to ease a transition from the deprecated end point v1/operational-plan to v2/operational-plan (OPS-8538). While there are breaking changes in v2/operational-plan, there are no active users at this endpoint currently yet, so we are treating it as a minor version upgrade from 2.1.0 to 2.2.0

  • 🌟 Additions to v1/operational-plan. On each event:
    • eventId has been added as an alias for the existing id property
    • eventType has been added as an alias for the existing type property
    • noteText has been added
    • reinforcedTripReference has been added to reinforcement events
    • splitTripReference has been added the parts of trips that were split
    • More properties have been typed on eventJsonData, these vary per eventType.
      • blockId has been added as an alias for the existing vehicleId
      • Each event type is now more strongly typed so it should be clearer what properties exist on what events.
  • 💥 Additions and changes to v2/operational-plan. On each event:
    • all v1 changes described above, plus:
    • type has been removed and replaced by eventType
    • id has been removed and replaced by uuid
    • eventJsonData has been removed and all properties that were inside this object are now on the event level

v2.1.0 - 2024-02-12 🌟

In v1/operational-plan and v2/operational-plan

  • Additional source ids for tasks and blocks added Optibus IDs to tasks and blocks (OPS-8855)

    • The properties are contained within a new object called optibusIds on each task and block as follows export type OptibusIds = { optibusRosterId: string; optibusRosterDatasetId: string; optibusScheduleId: string; }; It is important to document that tasks and blocks and days off that have been created inside Ops will NOT have these IDs. Therefore, we are adding additional properties called: source and wasModifiedInOperations
      • If the source is “scheduling“:
        • optibusIds will exist
        • wasModifiedInOperations will exist. True, if the task has been modified in anyway (excluding cancellations) else, False.
      • If the source is “operations“:
        • optibusIds will NOT exist
        • wasModifiedInOperations will NOT exist.
  • Adding dutyType to certain tasks added dutyType to the task, where dutyType is a property that comes from Rosters/Schedules imported into Optibus Operations from Optibus Planning/Scheduling/Rostering (OPS-8877)

v2.0.0 - 2024-01-29 💥

Changes in this release do not contain breaking changes to existing endpoints, but we are deprecating endpoint v1/operational-plan by 2024-06-30 in favor of v2/operational-plan, therefore marking this as a major release, increasing overall API version from 1.3.0 to 2.0.0:

  • 🐞 A bug was fixed where some tasks were not getting filtered when using the driver filter (OPS-8280)
  • 💥 New v2/operational-plan endpoint. (OPS-6125) which contains a number of breaking changes if switching from v1/operational-plan. Note that v1/operational-plan is still available, but will be deprecated by 2024-06-30:
    • 💥 Removed query params: assignedOnly, vehicleIds
    • 💥 depotId is no longer a path parameter, it has been replaced by query param depotUuids which is now a list
    • 💥 driverIds query parameter is now called driverUuids
    • 💥 from query parameter is now called fromDate
    • 💥 to query parameter is now called toDate
    • 💥 Response is now a list where each item is a depot. Each item now has the properties depotUuid and depotName alongside the previous operational plan properties.
    • 💥 Failure to fetch a plan for a depot will fail the whole request.
    • 💥 If one or more of the requested depots is not found then return a 404 and an error which includes the list of missing depots (OPS-8707)
    • 💥 The end point to retrieve a single depot (ie v2/operational-plan/{depotId}) has been removed. Instead their is only the v2/operational-plan endpoint and specific depots can be requested using a depotUuids query parameter on the request.
    • 💥 The block/task summary is removed in v2 (OPS-8757). Therefore:
      • destination.originStop and destination.originDepot are completely removed in v2/operational-plan
      • originStopName, originStopId, originStopLabel, originDepotName, originDepotId and originDepotLabel (and the equivalent for destination) are moved up to the task/block level.
  • Stops Properties
    • 🌟 in v1/operational-plan/{depotId} (and v2/operational-plan), added originStopName, originStopId, originStopLabel, originDepotName, originDepotId and originDepotLabel to the duty and block summary (and the equivalent for destination) (OPS-8539)
last updated: 2026-02-23