Passar para o conteúdo principal

Locations

Atualizado essa semana

Webhook payload model for location events.

Fields

- target (string): Target of the action (e.g., "location").

- targetId (string): ID of the affected location.

- action (string): Action performed on the location (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 associated with the location.

- newData (LocationData): Struct containing the new state of the location.

- oldData (LocationData): Struct containing the previous state of the location.

LocationData Struct

The LocationData struct contains the following fields:

- id (string): Location ID.

- name (string): Location name.

- companyId (string): Company ID.

- parentId (string): Parent location ID.

- code (string): Location code.

- createdAt (string): ISO 8601 creation timestamp.

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

- createdByUserId (string): Creator user ID.

- updatedByUserId (string): Last updater user ID.

- image (string): Image URL.

- locationCustomFields ([]string): Custom field IDs.

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

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

- assignedUsers ([]string): Assigned user IDs (denormalized).

- assignedTeams ([]string): Assigned team IDs (denormalized).

- createdByUser (LocationUser): User object of the creator.

LocationUser Struct

The LocationUser struct contains the following fields:

- id (string): User ID.

- name (string): User full name.

- email (string): User email.

- number (int): User number.

- companyId (string): Company ID.

- image (LocationUserImage): User avatar image metadata.

LocationUserImage Struct

The LocationUserImage struct contains the following fields:

- id (string): Image ID.

- uploadedBy (string): User ID who uploaded the image.

- companyId (string): Company ID.

- internal (bool): Whether the image is internal.

- filename (string): Original filename.

- contentType (string): MIME type (e.g., "image/png").

- conversion (*string): Conversion status (nullable).

- size (int): File size in bytes.

- url (string): Public URL of the image.

- key (string): Storage key.

- uploaded (bool): Whether the upload is complete.

- createdAt (string): ISO 8601 creation timestamp.

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

Example (JSON)

{

"target": "location",

"targetId": "location-002",

"action": "updated",

"date": "2025-09-29T18:04:03Z",

"byUserId": "user-abc",

"companyId": "company-xyz",

"newData": {

"id": "location-002",

"name": "Floor 2 - Section A",

"companyId": "company-xyz",

"parentId": "location-001",

"code": "FL2-A",

"createdAt": "2024-03-10T09:00:00Z",

"updatedAt": "2025-09-29T18:04:03Z",

"createdByUserId": "user-admin",

"updatedByUserId": "user-abc",

"locationCustomFields": [],

"assignedTeamIds": [

"team-maintenance"

],

"assignedUserIds": [

"user-abc",

"user-def"

],

"assignedUsers": [

"user-abc"

],

"assignedTeams": [

"team-maintenance"

],

"createdByUser": {

"companyId": "company-xyz",

"email": "[email protected]",

"name": "Admin User",

"number": 1,

"image": {

"uploadedBy": "user-admin",

"companyId": "company-xyz",

"internal": false,

"filename": "avatar.png",

"contentType": "image/png",

"conversion": null,

"size": 20480,

"key": "avatars/admin.png",

"uploaded": true,

"createdAt": "2024-01-01T00:00:00Z",

"updatedAt": "2024-06-01T00:00:00Z",

"id": "image-001"

},

"id": "user-admin"

}

},

"oldData": {

"id": "location-002",

"name": "Floor 2",

"companyId": "company-xyz",

"parentId": "location-001",

"code": "FL2",

"createdAt": "2024-03-10T09:00:00Z",

"updatedAt": "2025-08-15T10:00:00Z",

"createdByUserId": "user-admin",

"updatedByUserId": "user-admin",

"image": "",

"locationCustomFields": [],

"assignedTeamIds": [],

"assignedUserIds": [],

"assignedUsers": [],

"assignedTeams": [],

"createdByUser": {

"companyId": "company-xyz",

"email": "[email protected]",

"name": "Admin User",

"number": 1,

"image": {

"uploadedBy": "user-admin",

"companyId": "company-xyz",

"internal": false,

"filename": "avatar.png",

"contentType": "image/png",

"conversion": null,

"size": 20480,

"key": "avatars/admin.png",

"uploaded": true,

"createdAt": "2024-01-01T00:00:00Z",

"updatedAt": "2024-06-01T00:00:00Z",

"id": "image-001"

},

"id": "user-admin"

}

}

}

Respondeu à sua pergunta?