/api/v1/chat-messages (POST)
const url = 'https://api.endless.zaia.app/api/v1/chat-messages';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"chatId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","chatThreadId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","content":"example","externalId":"example","senderId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","detail":{"attachments":[{"file":"example","extension":"png","name":"example"}]},"role":"user"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.endless.zaia.app/api/v1/chat-messages \ --header 'Content-Type: application/json' \ --data '{ "chatId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "chatThreadId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "content": "example", "externalId": "example", "senderId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "detail": { "attachments": [ { "file": "example", "extension": "png", "name": "example" } ] }, "role": "user" }'Creates a new chat message.
Request Bodyrequired
Seção intitulada “Request Bodyrequired”object
The chat ID associated with the message.
The id of the chat thread that the message belongs to.
External reference in the integrated system.
A UUID v4 string that identifies an entity.
object
The attachments submitted when creating the chat message.
object
The file identifier or path.
The attachment subtype represented by this payload.
The display name of the PNG file.
object
The file identifier or path.
The attachment subtype represented by this payload.
The display name of the PDF file.
object
The file identifier or path.
The attachment subtype represented by this payload.
The mode of the audio attachment. “attachment” sends it as an attachment and “message” sends it as the main message.
object
The file identifier or path.
The attachment subtype represented by this payload.
The display name of the markdown file.
object
The file identifier or path.
The attachment subtype represented by this payload.
The display name of the text file.
The role allowed when creating the chat message.
Responses
Seção intitulada “Responses”The chat message was created.
object
A UUID v4 string that identifies an entity.
The chat ID associated with the message.
The id of the chat thread that the message belongs to.
The content of the message.
The structured detail payload associated with the message.
object
The attachments associated with the chat message.
object
The file identifier or path.
The attachment ID associated with this payload.
The description of the PNG image.
The attachment subtype represented by this payload.
The display name of the PNG file.
object
The file identifier or path.
The attachment ID associated with this payload.
The description of the PDF file.
The attachment subtype represented by this payload.
The display name of the PDF file.
object
The file identifier or path.
The attachment ID associated with this payload.
The attachment subtype represented by this payload.
The mode of the audio attachment. “attachment” sends it as an attachment and “message” sends it as the main message.
The summary of the audio file.
The transcription of the audio file.
object
The file identifier or path.
The attachment ID associated with this payload.
The description of the markdown file.
The attachment subtype represented by this payload.
The display name of the markdown file.
object
The file identifier or path.
The attachment ID associated with this payload.
The description of the text file.
The attachment subtype represented by this payload.
The display name of the text file.
The delivery status for external channel messages.
object
object
The attachment IDs included in the delivery payload.
The text chunk included in the delivery payload.
object
The text chunk included in the delivery payload.
object
The attachment IDs included in the delivery payload.
object
object
object
object
object
object
object
object
The stable identifier of this delivery entry.
The external provider that received the delivery payload.
When the delivery payload was recorded.
External reference in the integrated system.
The delivery status represented by this payload.
object
object
The attachment IDs included in the delivery payload.
The text chunk included in the delivery payload.
object
The text chunk included in the delivery payload.
object
The attachment IDs included in the delivery payload.
object
object
object
object
object
object
object
object
The stable identifier of this delivery entry.
The external provider that received the delivery payload.
When the delivery payload was recorded.
The error payload returned when the delivery failed.
External reference in the integrated system.
The delivery status represented by this payload.
object
object
The attachment IDs included in the delivery payload.
The text chunk included in the delivery payload.
object
The text chunk included in the delivery payload.
object
The attachment IDs included in the delivery payload.
object
object
object
object
object
object
object
object
The stable identifier of this delivery entry.
The external provider that received the delivery payload.
When the delivery payload was recorded.
The delivery status represented by this payload.
Referral metadata when the message originated from Click-to-WhatsApp.
object
The primary text from the ad or post.
The Click-to-WhatsApp click identifier.
The headline from the ad or post.
The image URL when the ad uses image media.
The media type used in the ad or post.
The Meta ID for the ad or post.
Whether the referral came from an ad or a post.
The URL of the ad or post.
The thumbnail URL when the ad uses video media.
The video URL when the ad uses video media.
object
object
Server-controlled journey insight collection state for Vibe Ask mode.
Sanitized journey insight summary reported to the product team.
Effective Vibe Agent mode for this message.
External reference in the integrated system.
The raw content of the message as it was generated by the assistant.
The role of the actor that produced the message.
The super identity ID of the sender (agents, squads, users or external users) of the message.
Example
{ "detail": { "attachments": [ { "extension": "png" } ], "delivery": [], "referral": null, "vibe": { "journeyInsight": { "state": "none" }, "mode": "ask" } }, "role": "user"}Invalid data provided.
The description of a known exception.
object
The error code.
The error call-to-action.
object
The error feedback.
object
The error message.
The error name.
Example
{ "cta": { "type": "support-contact" }}You are not authorized to create the chat message.
The description of a known exception.
object
The error code.
The error call-to-action.
object
The error feedback.
object
The error message.
The error name.
Example
{ "cta": { "type": "support-contact" }}Chat not found.
The description of a known exception.
object
The error code.
The error call-to-action.
object
The error feedback.
object
The error message.
The error name.
Example
{ "cta": { "type": "support-contact" }}