Pular para o conteúdo

/api/v1/chat-messages (POST)

POST
/api/v1/chat-messages
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.

Media typeapplication/json
object
chatId
required

The chat ID associated with the message.

string format: uuid
chatThreadId
required

The id of the chat thread that the message belongs to.

string format: uuid
nullable
content
required
string
<= 4000 characters
externalId
required

External reference in the integrated system.

string
nullable >= 3 characters <= 250 characters
senderId
required

A UUID v4 string that identifies an entity.

string format: uuid
detail
required
object
attachments
required

The attachments submitted when creating the chat message.

Array
Any of:
object
file
required

The file identifier or path.

string
>= 1 characters
extension
required

The attachment subtype represented by this payload.

string
Allowed values: png
name
required

The display name of the PNG file.

string
>= 3 characters <= 50 characters
role
required

The role allowed when creating the chat message.

string
Allowed values: user support

The chat message was created.

Media typeapplication/json
object
createdAt
required
string format: date-time
id
required

A UUID v4 string that identifies an entity.

string format: uuid
updatedAt
required
string format: date-time
chatId
required

The chat ID associated with the message.

string format: uuid
chatThreadId
required

The id of the chat thread that the message belongs to.

string format: uuid
nullable
content
required

The content of the message.

string
0 <= 100000 characters
detail
required

The structured detail payload associated with the message.

object
attachments
required

The attachments associated with the chat message.

Array
Any of:
object
file
required

The file identifier or path.

string
>= 1 characters
id
required

The attachment ID associated with this payload.

string format: uuid
description
required

The description of the PNG image.

string
>= 3 characters <= 250 characters
extension
required

The attachment subtype represented by this payload.

string
Allowed values: png
name
required

The display name of the PNG file.

string
>= 3 characters <= 50 characters
delivery

The delivery status for external channel messages.

Array
default:
One of:
object
content
required
Any of:
object
attachmentsIds
required

The attachment IDs included in the delivery payload.

Array<string>
text
required

The text chunk included in the delivery payload.

string
id
required

The stable identifier of this delivery entry.

string format: uuid
provider
required

The external provider that received the delivery payload.

string
Allowed values: waha whatsapp instagram telegram
timestamp
required

When the delivery payload was recorded.

string format: date-time
nullable
externalId
required

External reference in the integrated system.

string
>= 3 characters <= 250 characters
status
required

The delivery status represented by this payload.

string
Allowed values: sent
referral

Referral metadata when the message originated from Click-to-WhatsApp.

object
body
required

The primary text from the ad or post.

string
nullable
ctwaClid
required

The Click-to-WhatsApp click identifier.

string
nullable
headline
required

The headline from the ad or post.

string
nullable
imageUrl
required

The image URL when the ad uses image media.

string
nullable
mediaType
required

The media type used in the ad or post.

string
nullable
Allowed values: image video
sourceId
required

The Meta ID for the ad or post.

string
sourceType
required

Whether the referral came from an ad or a post.

string
Allowed values: ad post
sourceUrl
required

The URL of the ad or post.

string
thumbnailUrl
required

The thumbnail URL when the ad uses video media.

string
nullable
videoUrl
required

The video URL when the ad uses video media.

string
nullable
vibe
object
journeyInsight
object
state
required

Server-controlled journey insight collection state for Vibe Ask mode.

string
Allowed values: none awaiting-desired-experience reported
summary

Sanitized journey insight summary reported to the product team.

string
<= 2000 characters
mode
required

Effective Vibe Agent mode for this message.

string
Allowed values: ask build
externalId
required

External reference in the integrated system.

string
nullable >= 3 characters <= 250 characters
rawContent
required

The raw content of the message as it was generated by the assistant.

string
nullable 0 <= 100000 characters
role
required

The role of the actor that produced the message.

string
Allowed values: user assistant support system
senderId
required

The super identity ID of the sender (agents, squads, users or external users) of the message.

string format: uuid
nullable
Example
{
"detail": {
"attachments": [
{
"extension": "png"
}
],
"delivery": [],
"referral": null,
"vibe": {
"journeyInsight": {
"state": "none"
},
"mode": "ask"
}
},
"role": "user"
}

Invalid data provided.

Media typeapplication/json

The description of a known exception.

object
code

The error code.

string
cta

The error call-to-action.

object
type
required
string
Allowed values: support-contact
url
required
string format: uri
feedback
required

The error feedback.

object
enUs
string
esEs
string
ptBr
string
message
required

The error message.

string
name
required

The error name.

string
Example
{
"cta": {
"type": "support-contact"
}
}

You are not authorized to create the chat message.

Media typeapplication/json

The description of a known exception.

object
code

The error code.

string
cta

The error call-to-action.

object
type
required
string
Allowed values: support-contact
url
required
string format: uri
feedback
required

The error feedback.

object
enUs
string
esEs
string
ptBr
string
message
required

The error message.

string
name
required

The error name.

string
Example
{
"cta": {
"type": "support-contact"
}
}

Chat not found.

Media typeapplication/json

The description of a known exception.

object
code

The error code.

string
cta

The error call-to-action.

object
type
required
string
Allowed values: support-contact
url
required
string format: uri
feedback
required

The error feedback.

object
enUs
string
esEs
string
ptBr
string
message
required

The error message.

string
name
required

The error name.

string
Example
{
"cta": {
"type": "support-contact"
}
}