Guides

Webhook Reference

A standard webhook sent by OmniChat has the following format:

FieldTypeDescription
objectIdstringInforms the id of the object
resourcestringInforms the type of object that was sent, can it be:

Message
Interaction
Order
eventstring (enum)Event type on the object:

CREATE
DELETE
UPDATE
timestamptimestampEvent date/time.
payloadjsonObject containing resource data. Only Message resource has this field set.

Message payload format:

FieldTypeDescription
chatjsonTells which conversation the message belongs to.

It's a json containing the fields:

className ( in this case it will always be 'Chat' )
objectId (id of the chat)

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:
platformstringInforms the platform of the conversation:

WAB-OMNICHAT
WAB-DIALOG
INSTAGRAM
FBMESSENGER
WEBCHAT
statusstringInforms the status of the message:

INCOMING_RECEIVED (received and unread)
INCOMING_READ (rreceived and read)
INCOMING_DELETED (received and deleted - INSTAGRAM ONLY)
OUTGOING_CREATED (created internally but not sent)
OUTGOING_SENT (sent)
OUTGOING_READ (sent and read)
OUTGOING_ERROR (sending error)
OUTGOING_SILENT (internal messages that are not sent to the consumer)
systembooleanInforms if it is a systemic message.
typestringInforms the type of message content:

IMAGE
TEXT
AUDIO
VOICE
DOCUMENT
FILE
VIDEO
LOCATION
PRODUCT
VARIANT
PAYMENT_REQUEST
ORDER_CONFIRMATION
ORDER_STATUS
COLLECTION
VCARD
MULTI_VCARD
SNOOZE_START
SNOOZE_END
TEMPLATE
BUTTON
ORDER_PREVIEW
GROUPED
INTERACTIVE
INTERACTIVE_BUTTON
LIST
STICKER
ROUTING (this specific type is useful for identifying conversation routings)
textstringThe text of the message
createdAtISO stringTells you when the message was created
updatedAtISO stringTells you when the message was updated
objectIdstringPayload object id (it's the same as the main object)
routeToUserjsonWhen 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.

className ( in this case it will always be '_User' )
objectId (id of the User)

It is possible to get the User's data through this endpoint
routeToTeamjsonWhen 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.

className ( in this case it will always be 'Team' )
objectId (id of the Team)

It is possible to get the Team data through this endpoint
userjsonOmnichat user that sent this message, this field will be filled in with the information of the user who received the routing.

className ( in this case it will always be '_User' )
objectId (id of the User)

It is possible to get the User's data through this endpoint