Schedule-groups

Schedule groups

These events are emitted by the Inventory API (btrz-api-inventory) when schedule groups are created or updated. There is no DELETE endpoint for schedule groups.

Events

Action Event name Endpoint
Create a new schedule group schedulegroups.created POST /schedule-groups
Update an existing schedule group schedulegroups.updated PUT /schedule-groups/:scheduleGroupId

Payload example created

{
  "attemptId": "5cfc6e7c-2b18-4b6d-8f97-051fafe1f45c",
  "created": 1734028705,
  "data": {
    "_id": "675b2d8d34ec0605083d9a64",
    "accountId": "52a377ec430c7d4e220001fc",
    "colour": "#234567",
    "createdAt": {
      "offset": 0,
      "value": "2024-12-12T18:38:05.939Z"
    },
    "createdBy": "55fc2f318791db6e1a0000b6",
    "enabled": false,
    "name": "Second one",
    "rule": {},
    "updatedAt": {
      "offset": 0,
      "value": "2024-12-12T18:38:05.940Z"
    },
    "updatedBy": "55fc2f318791db6e1a0000b6"
  },
  "event": "schedulegroups.created",
  "id": "01b92fd8-0954-43a7-abf5-a6b9e0adc032",
  "livemode": true
}

Field descriptions — payload (schedule group events)

Field Type Description
attemptId string UUID of the attempt that triggered the event.
created number Unix timestamp when the event was created.
event string Event name (schedulegroups.created, schedulegroups.updated).
id string UUID of the webhook event.
livemode boolean Whether the event occurred in live mode.
data._id string Schedule group id (24 hex characters).
data.accountId string Account (provider) id.
data.name string Name of the schedule group.
data.colour string Colour of the schedule group (hex e.g. #234567 or #003399).
data.enabled boolean Whether the schedule group is enabled.
data.rule object Optional rule configuration.
data.createdBy string User id that created this resource (24 hex).
data.updatedBy string User id that last updated this resource (24 hex).
data.createdAt object BzDate: creation date.
data.updatedAt object BzDate: last update date.

Payload example updated

{
  "attemptId": "0bc48a9a-0803-4d2f-bb40-521614a13076",
  "created": 1734029031,
  "data": {
    "_id": "675b2d8d34ec0605083d9a64",
    "accountId": "52a377ec430c7d4e220001fc",
    "colour": "#003399",
    "createdAt": {
      "offset": 0,
      "value": "2024-12-12T18:38:05.939Z"
    },
    "createdBy": "55fc2f318791db6e1a0000b6",
    "enabled": true,
    "name": "Second one",
    "rule": {},
    "updatedAt": {
      "offset": 0,
      "value": "2024-12-12T18:42:50.320Z"
    },
    "updatedBy": "55fc2f318791db6e1a0000b6"
  },
  "event": "schedulegroups.updated",
  "id": "6da4c177-c656-4a27-a168-0ccef56465d3",
  "livemode": true
}