Work Order
Webhook payload model for work order events.
Fields
- date (string): ISO 8601 timestamp of the event.
- action (string): Action performed on the work order (e.g., "created", "updated", "deleted").
- target (string): Target of the action (e.g., "workOrder").
- targetId (string): ID of the affected work order.
- companyId (string): Company ID associated with the work order.
- newData (WorkOrderData): Struct containing the new state of the work order.
- oldData (WorkOrderData): Struct containing the previous state of the work order.
WorkOrderData Struct
The WorkOrderData struct contains the following fields:
- id (string): ID of the work order.
- title (string): Title of the work order.
- status (string): Current status of the work order.
- number (int): Work order number.
- companyId (string): Company ID associated with the work order.
- startedAt (string, optional): Timestamp when the work order was started.
- completedAt (string, optional): Timestamp when the work order was completed.
- planningStatus (string, optional): Planning status of the work order.
- assetId (string, optional): ID of the associated asset.
- locationId (string, optional): ID of the associated location.
- priorityId (string, optional): ID of the priority level.
- scheduleId (string, optional): ID of the associated schedule.
Example (JSON)
{
"date": "2025-09-29T18:04:03Z",
"action": "updated",
"target": "workOrder",
"targetId": "wo-12345",
"companyId": "6931fa3b469dc5a8adefc0e7",
"newData": {
"id": "wo-12345",
"title": "Fix HVAC System",
"status": "in_progress",
"number": 1042,
"companyId": "6931fa3b469dc5a8adefc0e7",
"startedAt": "2025-09-29T10:00:00Z",
"planningStatus": "scheduled",
"assetId": "asset-001",
"locationId": "location-003",
"priorityId": "priority-high",
"scheduleId": "6931fa6f42ee085b929a3ca1"
},
"oldData": {
"id": "wo-12345",
"title": "Fix HVAC System",
"status": "open",
"number": 1042,
"companyId": "6931fa3b469dc5a8adefc0e7",
"planningStatus": "unscheduled",
"assetId": "asset-001",
"locationId": "location-003",
"priorityId": "priority-high"
}
}
