Label webhooks
This page documents webhook events related to labels from the Inventory API (labels resource).
Inventory API – labels resource
Emitted when a label is created (POST /labels), updated (PUT /labels/:labelId), or deleted (DELETE /labels/:labelId).
Events (Inventory API)
| Action | Event name | Endpoint |
|---|---|---|
| Create a label | label.created |
POST /labels |
| Update a label | label.updated |
PUT /labels/:labelId |
| Delete a label | label.deleted |
DELETE /labels/:labelId |
Payload example – created (Inventory API)
The data object for label.created is the full created label (same shape as the API response label).
{
"attemptId": "0ab70210-547a-4a7a-8e1b-e402a8663308",
"created": 1623794899,
"data": {
"_id": "60c924b8d9e6c43f77b5a5a3",
"accountId": "52a377ec430c7d4e220001fc",
"color": "#4ae852",
"createdAt": {
"offset": 0,
"value": "2021-06-15T22:07:52.532Z"
},
"description": "normal ticket",
"disabled": false,
"modelName": "tickets",
"name": "Non vip",
"type": "ticket",
"updatedAt": {
"offset": 0,
"value": "2021-06-15T22:07:52.539Z"
},
"userId": "55fc2f318791db6e1a0000b6"
},
"event": "label.created",
"id": "efec49e0-80a0-4734-bf02-2581cddd13af",
"livemode": true
}
Payload example – updated (Inventory API)
The data object for label.updated is the full updated label (same shape as the API response label).
{
"attemptId": "f6489e7c-ae53-4d9f-a61d-cd6e12ae640b",
"created": 1623794899,
"data": {
"_id": "60c924b8d9e6c43f77b5a5a3",
"accountId": "52a377ec430c7d4e220001fc",
"color": "#4ae8cd",
"createdAt": {
"offset": 0,
"value": "2021-06-15T22:07:52.532Z"
},
"description": "Ticket",
"disabled": false,
"modelName": "tickets",
"name": "Non vip",
"type": "ticket",
"updatedAt": {
"offset": 0,
"value": "2021-06-15T22:08:06.715Z"
},
"userId": "55fc2f318791db6e1a0000b6"
},
"event": "label.updated",
"id": "75372595-b02e-4462-96ef-7425d9a68694",
"livemode": true
}
Payload example – deleted (Inventory API)
The data object for label.deleted contains only the id of the deleted label.
{
"attemptId": "d58defed-a305-43f5-8ce8-0db76fae8f2b",
"created": 1623954546,
"data": {
"id": "60cb946a59d5f340cdf7641a"
},
"event": "label.deleted",
"id": "2848c400-2795-4ebf-a6f8-f935a97701f0",
"livemode": true
}
Field descriptions – data (created / updated)
data matches the Inventory API Label schema. Main fields:
| Field | Type | Description |
|---|---|---|
| _id | string | Label id (24 hex characters). |
| accountId | string | The account id. |
| userId | string | The user id. |
| name | string | The name of the label. |
| description | string | The description of the label. |
| color | string | The color of the label (e.g. hex). |
| modelName | string | The model where the label can be used (e.g. tickets). |
| disabled | boolean | The status of the label. |
| type | string | The type of the label: ticket or manifest. |
| createdBy | string | The user that created this resource. |
| updatedBy | string | The last user that updated this resource. |
| createdAt | object | The date the object was created (BzDate: offset, value). |
| updatedAt | object | The date the object was last updated (BzDate: offset, value). |
Field descriptions – data (deleted)
| Field | Type | Description |
|---|---|---|
| id | string | Id of the deleted label (24 hex characters). |