Webhook Reference
A standard webhook sent by OmniChat has the following format:
Field | Type | Description |
---|---|---|
objectId | string | Informs the id of the object |
resource | string | Informs the type of object that was sent, can it be: Message |
event | string (enum) | Event type on the object: CREATE |
timestamp | timestamp | Event date/time. |
payload | json | Object containing resource data. Only Message resource has this field set. |
Message payload format:
Field | Type | Description |
---|---|---|
chat | json | Tells which conversation the message belongs to. It's a json containing the fields:
The Chat object is a conversation grouper. With it, it is possible to know metadata of the conversation, such as the customer's phone number, the status of the conversation, among others. It is possible to know the Chat data through the endpoint: |
platform | string | Informs the platform of the conversation: WAB-OMNICHAT |
status | string | Informs the status of the message: INCOMING_RECEIVED (received and unread) |
system | boolean | Informs if it is a systemic message. |
type | string | Informs the type of message content: IMAGE |
text | string | The text of the message |
createdAt | ISO string | Tells you when the message was created |
updatedAt | ISO string | Tells you when the message was updated |
objectId | string | Payload object id (it's the same as the main object) |
routeToUser | json | When the message type is routing and the routing is for the user, this field will be filled in with the information of the user who received the routing.
It is possible to get the User's data through this endpoint |
routeToTeam | json | When the message type is routing and the routing is for a team, this field will be filled in with the information of the team that received the routing.
It is possible to get the Team data through this endpoint |
user | json | Omnichat user that sent this message, this field will be filled in with the information of the user who received the routing.
It is possible to get the User's data through this endpoint |
Updated 14 days ago