Skip to main content
POST
/
v1
/
shift
Create a shift
curl --request POST \
  --url https://api.sandbox.usenash.com/v1/shift \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Shift 1",
  "plannedStart": "2021-01-01T00:00:00Z",
  "plannedEnd": "2021-01-01T00:00:00Z",
  "id": "sft_fKUFVWZQGbEfsyMwJYntE2",
  "plannedBreakDuration": 30,
  "shiftMetadata": {
    "key": "value"
  },
  "optimizationParams": {
    "serviceTimeRelativeEfficiency": 1,
    "plannedBreaks": [
      {
        "end": 30,
        "start": 0
      }
    ],
    "departureDelay": 15,
    "vehicleConfig": {
      "key": "value"
    }
  },
  "status": "active",
  "storeLocationId": "123",
  "externalStoreLocationId": "123",
  "zoneIds": [
    "123"
  ],
  "externalZoneIds": [
    "123"
  ]
}
'
{
  "id": "<string>",
  "name": "<string>",
  "plannedStart": "<string>",
  "plannedEnd": "<string>",
  "status": "<string>",
  "createdAt": "<string>",
  "updatedAt": "<string>",
  "plannedBreakDuration": 123,
  "shiftMetadata": {},
  "optimizationParams": {
    "serviceTimeRelativeEfficiency": 1,
    "plannedBreaks": [
      {
        "end": 30,
        "start": 0
      }
    ],
    "departureDelay": 15,
    "vehicleConfig": {
      "key": "value"
    }
  },
  "storeLocationId": "<string>",
  "externalStoreLocationId": "<string>",
  "zoneIds": [
    "<string>"
  ],
  "externalZoneIds": [
    "<string>"
  ],
  "courierId": "<string>",
  "vehicleId": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Input for creating a shift.

name
string
required

The name of the shift.

Example:

"Shift 1"

plannedStart
string
required

The planned start timestamp of the shift.

Example:

"2021-01-01T00:00:00Z"

plannedEnd
string
required

The planned end timestamp of the shift.

Example:

"2021-01-01T00:00:00Z"

id
string | null

The ID of the shift.

Example:

"sft_fKUFVWZQGbEfsyMwJYntE2"

plannedBreakDuration
integer | null

The planned break duration of the shift.

Example:

30

shiftMetadata
Shiftmetadata · object

The metadata of the shift.

Example:
{ "key": "value" }
optimizationParams
OptimizationParams · object

The optimization parameters of the shift.

status
string | null

The status of the shift.

Example:

"active"

storeLocationId
string | null

The store location ID of the shift.

Example:

"123"

externalStoreLocationId
string | null

The external store location ID of the shift.

Example:

"123"

zoneIds
string[] | null

The zone IDs of the shift.

Example:
["123"]
externalZoneIds
string[] | null

The external zone IDs of the shift.

Example:
["123"]

Response

OK

Response for shift.

id
string
required

The ID of the shift.

name
string
required

The name of the shift.

plannedStart
string
required

The planned start timestamp of the shift.

plannedEnd
string
required

The planned end timestamp of the shift.

status
string
required

The status of the shift.

createdAt
string
required

The creation timestamp of the shift.

updatedAt
string
required

The update timestamp of the shift.

plannedBreakDuration
integer | null

The planned break duration of the shift.

shiftMetadata
Shiftmetadata · object

The metadata of the shift.

optimizationParams
OptimizationParams · object

The optimization parameters of the shift.

storeLocationId
string | null

The store location ID of the shift.

externalStoreLocationId
string | null

The external store location ID of the shift.

zoneIds
string[] | null

The zone IDs of the shift.

externalZoneIds
string[] | null

The external zone IDs of the shift.

courierId
string | null

The courier ID of the shift.

vehicleId
string | null

The vehicle ID of the shift.