createShift API Endpoint

The Fleet Manager can create a new driver shift using the createShift API.

API Details

POST https://api.zendrive.com/fleet/v1/shift

Creates a shift for a fleet in the Zendrive backend.

Headers

Name
Type
Description

API KEY <API_KEY>*

Application/JSON

Authorization header

Request Payload

{
  "shift_name": "morning_shift",
  "shift_intervals": [
    {
      "start_time": {
        "day_of_week": "Sunday",
        "time": "11:00 PM"
      },
      "end_time": {
        "day_of_week": "Monday",
        "time": "02:00 AM"
      }
    },
    {
      "start_time": {
        "day_of_week": "Monday",
        "time": "11:00 AM"
      },
      "end_time": {
        "day_of_week": "Monday",
        "time": "02:00 PM"
      }
    }
  ],
  "timezone": "America/Los_Angeles"
}

Request Fields

Request Parameter
Description

shift_name

Shift name as set by the fleet manager.

shift_intervals

List of shift interval objects. Each element of the list represents a single shift interval with start and end time.

timezone

Timezone as set by the fleet manager.

Notes:

  • The shift name can be 50 characters long and comprise of alphanumeric characters, ‘_', '-’ and space.

  • If the Business Hours feature is enabled, a default shift comprising 24 hours a day, 7 days a week is created in the system. You can update this configuration later.

Was this helpful?