Passar para o conteúdo principal

Requests Webhook Format

Atualizado essa semana

Webhook payload model for request events.

Fields

  • target (string): Target of the action (e.g., "request").

  • targetId (string): ID of the affected request.

  • action (string): Action performed on the request (e.g., "created", "updated", "deleted").

  • date (string): ISO 8601 timestamp of the event.

  • byUserId (string): ID of the user who triggered the event.

  • companyId (string): Company ID.

  • service (string): Service that emitted the event.

  • platform (string): Platform (e.g., "web", "mobile").

  • newData (RequestData): Struct containing the new state of the request.

  • oldData (RequestData): Struct containing the previous state of the request.

RequestData Struct

The RequestData struct contains the following fields:

  • id (string): Request ID.

  • companyId (string): Company ID.

  • target (string): Target entity type (e.g., "asset", "location").

  • parentId (string): ID of the parent entity.

  • parentInfo (string): Display name of the parent entity.

  • madeBy (string): User ID who created the request.

  • operationalEventId (string): Associated operational event ID.

  • status (string): Request status (e.g., "pending", "approved", "rejected").

  • createdAt (string): ISO 8601 creation timestamp.

  • updatedAt (string): ISO 8601 last update timestamp.

  • createdByUserId (string): Creator user ID.

  • updatedByUserId (string): Last updater user ID.

  • number (int): Sequential number.

  • requestProcedures ([]string): List of procedure IDs.

  • template (RequestTemplate): Request template details.

Request Template Struct

The RequestTemplate struct contains the following fields:

  • title (string): Request title.

  • description (string): Request description.

  • tags ([]string): Tags.

  • dueDate (string): ISO 8601 due date.

  • categoryIds ([]string): Category IDs.

  • priorityId (string): Priority ID.

  • assignedUserIds ([]string): Assigned user IDs.

  • assignedTeamIds ([]string): Assigned team IDs.

  • locationId (string): Associated location ID.

  • linkedWorkOrderIds ([]string): Linked work order IDs.

  • linkedRequestIds ([]string): Linked request IDs.

  • identifiedAssetFailures ([]string): Identified asset failure IDs.

  • companyId (string): Company ID.

Example JSON

{
"target": "request",
"targetId": "request-001",
"action": "updated",
"date": "2025-09-29T18:04:03Z",
"byUserId": "user-abc",
"companyId": "company-xyz",
"service": "requests-service",
"platform": "web",
"newData": {
"id": "request-001",
"companyId": "company-xyz",
"target": "asset",
"parentId": "asset-001",
"parentInfo": "Hydraulic Press #3",
"madeBy": "user-abc",
"operationalEventId": "op-event-001",
"status": "approved",
"createdAt": "2025-09-28T08:00:00Z",
"updatedAt": "2025-09-29T18:04:03Z",
"createdByUserId": "user-abc",
"updatedByUserId": "user-admin",
"number": 77,
"requestProcedures": [
"procedure-001"
],
"template": {
"title": "Lubrication request",
"description": "Requesting scheduled lubrication for press bearings",
"tags": [
"lubrication",
"preventive"
],
"dueDate": "2025-10-05T00:00:00Z",
"categoryIds": [
"category-maintenance"
],
"priorityId": "priority-high",
"assignedUserIds": [
"user-def"
],
"assignedTeamIds": [
"team-maintenance"
],
"locationId": "location-002",
"linkedWorkOrderIds": [
"wo-123"
],
"linkedRequestIds": [],
"identifiedAssetFailures": [
"failure-001"
],
"companyId": "company-xyz"
}
},
"oldData": {
"id": "request-001",
"companyId": "company-xyz",
"target": "asset",
"parentId": "asset-001",
"parentInfo": "Hydraulic Press #3",
"madeBy": "user-abc",
"operationalEventId": "op-event-001",
"status": "pending",
"createdAt": "2025-09-28T08:00:00Z",
"updatedAt": "2025-09-29T09:00:00Z",
"createdByUserId": "user-abc",
"updatedByUserId": "user-abc",
"number": 77,
"requestProcedures": [],
"template": {
"title": "Lubrication request",
"description": "Requesting scheduled lubrication for press bearings",
"tags": [
"lubrication"
],
"dueDate": "2025-10-05T00:00:00Z",
"categoryIds": [
"category-maintenance"
],
"priorityId": "priority-medium",
"assignedUserIds": [],
"assignedTeamIds": [],
"locationId": "location-002",
"linkedWorkOrderIds": [],
"linkedRequestIds": [],
"identifiedAssetFailures": [],
"companyId": "company-xyz"
}
}
}
Respondeu à sua pergunta?