Shift

The shift resource.

Basehttps://rest.carbon.ms/shift
GET/shift

List shifts

Retrieve a paginated list of shifts. Filter, order, and select columns with PostgREST query parameters.

Query parameters

selectstring

Comma-separated columns to return. Defaults to all.

orderstring

Column to sort by, e.g. `createdAt.desc`.

limitinteger

Maximum rows to return.

offsetinteger

Rows to skip, for pagination.

GEThttps://rest.carbon.ms/shift
curl --request GET \
  --url 'https://rest.carbon.ms/shift?select=*&limit=10' \
  --header 'Authorization: Bearer <api-key>'
Response
[
  {
    "id": "abc123def456",
    "name": "Example",
    "startTime": "string",
    "endTime": "string",
    "locationId": "xyz789",
    "sunday": true,
    "monday": true,
    "tuesday": true
  }
]
GET/shift

Retrieve a shift

Fetch a single shift by filtering on `id`.

Query parameters

idstring

Match on the shift's `id`, e.g. `eq.{id}`.

GEThttps://rest.carbon.ms/shift
curl --request GET \
  --url 'https://rest.carbon.ms/shift?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
Response
{
  "id": "abc123def456",
  "name": "Example",
  "startTime": "string",
  "endTime": "string",
  "locationId": "xyz789",
  "sunday": true,
  "monday": true,
  "tuesday": true
}
POST/shift

Create a shift

Create a new shift.

Body parameters

namestringrequired
startTimestringrequired
endTimestringrequired
locationIdstringrequired

References location.id

sundaybooleanrequired
mondaybooleanrequired
tuesdaybooleanrequired
wednesdaybooleanrequired
thursdaybooleanrequired
fridaybooleanrequired
saturdaybooleanrequired
activebooleanrequired
companyIdstringrequired

References company.id

customFieldsobject
tagsarray
POSThttps://rest.carbon.ms/shift
curl --request POST \
  --url https://rest.carbon.ms/shift \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"name":"Example","startTime":"string","endTime":"string","locationId":"xyz789","sunday":true,"monday":true,"tuesday":true,"wednesday":true,"thursday":true,"friday":true,"saturday":true,"active":true,"companyId":"xyz789"}'
Response
{
  "id": "abc123def456",
  "name": "Example",
  "startTime": "string",
  "endTime": "string",
  "locationId": "xyz789",
  "sunday": true,
  "monday": true,
  "tuesday": true
}
PATCH/shift

Update a shift

Update an existing shift, matched on `id`.

Body parameters

namestringrequired
startTimestringrequired
endTimestringrequired
locationIdstringrequired

References location.id

sundaybooleanrequired
mondaybooleanrequired
tuesdaybooleanrequired
wednesdaybooleanrequired
thursdaybooleanrequired
fridaybooleanrequired
saturdaybooleanrequired
activebooleanrequired
companyIdstringrequired

References company.id

customFieldsobject
tagsarray
PATCHhttps://rest.carbon.ms/shift
curl --request PATCH \
  --url 'https://rest.carbon.ms/shift?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"name":"Example"}'
Response
{
  "id": "abc123def456",
  "name": "Example",
  "startTime": "string",
  "endTime": "string",
  "locationId": "xyz789",
  "sunday": true,
  "monday": true,
  "tuesday": true
}
DELETE/shift

Delete a shift

Delete a shift, matched on `id`. Returns 204 No Content.

Query parameters

idstring

The `id` of the shift to delete, e.g. `eq.{id}`.

DELETEhttps://rest.carbon.ms/shift
curl --request DELETE \
  --url 'https://rest.carbon.ms/shift?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
204 No Content