Create a new message for a specific chat.
curl --request POST \
--url https://api.example.com/chats/{chat_id}/messages \
--header 'Content-Type: application/json' \
--data '
{
"message": [
{
"type": "text",
"text": "<string>",
"audio": {
"id": "<string>",
"file_path": "<string>",
"file_filename": "document.pdf",
"file_size": 1024,
"file_mimetype": "application/pdf",
"file_url": "<string>",
"created_at": "2023-12-25"
},
"start_timestamp": 123,
"end_timestamp": 123
}
]
}
'{
"id": "<string>",
"role": "user",
"model": "<string>",
"status": "RUNNING",
"created_at": "2023-12-25",
"updated_at": "2023-12-25",
"messages": [
{
"role": "system",
"parts": [
{
"type": "text",
"text": "<string>",
"audio": {
"id": "<string>",
"file_path": "<string>",
"file_filename": "document.pdf",
"file_size": 1024,
"file_mimetype": "application/pdf",
"file_url": "<string>",
"created_at": "2023-12-25"
},
"start_timestamp": 123,
"end_timestamp": 123
}
]
}
],
"tools": [
{
"name": "<string>",
"display_name": "<string>",
"action_name": "<string>",
"description": "<string>",
"icon": "StepFormIcon",
"icon_url": "<string>",
"connection_id": "<string>",
"parameters": {},
"enabled_by_default": true,
"callback": "<string>"
}
],
"features": {
"web_search": {},
"reasoning": {
"effort": "low"
}
},
"member": {
"id": "<string>",
"role": "ADMIN",
"user": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>"
},
"session": {
"id": "<string>"
},
"contact_channel": {
"id": "<string>",
"channel_type": "internal",
"channel_id": "<string>",
"channel_name": "<string>",
"channel_display_name": "<string>",
"channel_avatar": "<string>",
"country": "<string>",
"agent": "<string>",
"ip": "<string>",
"language": "<string>",
"contact": {
"id": "<string>",
"name": "<string>",
"blocked": true
},
"link": "<string>"
}
},
"error": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123,
"reasoning_tokens": 123,
"cached_input_tokens": 123
}
}Chat ID
The user message
The user message to open the chat with
1User message parts
Show child attributes
The chat message schema
The role of the message
user, assistant, system, tool, event, note The model used for the message
The chat status
RUNNING, COMPLETED, FAILED, CANCELED The message content
System message
Show child attributes
The tools used in the message
10Show child attributes
Enabled features for the model
Show child attributes
The member of the chat
Show child attributes
Error message if the message failed
The usage information for the message
Show child attributes
Was this page helpful?
curl --request POST \
--url https://api.example.com/chats/{chat_id}/messages \
--header 'Content-Type: application/json' \
--data '
{
"message": [
{
"type": "text",
"text": "<string>",
"audio": {
"id": "<string>",
"file_path": "<string>",
"file_filename": "document.pdf",
"file_size": 1024,
"file_mimetype": "application/pdf",
"file_url": "<string>",
"created_at": "2023-12-25"
},
"start_timestamp": 123,
"end_timestamp": 123
}
]
}
'{
"id": "<string>",
"role": "user",
"model": "<string>",
"status": "RUNNING",
"created_at": "2023-12-25",
"updated_at": "2023-12-25",
"messages": [
{
"role": "system",
"parts": [
{
"type": "text",
"text": "<string>",
"audio": {
"id": "<string>",
"file_path": "<string>",
"file_filename": "document.pdf",
"file_size": 1024,
"file_mimetype": "application/pdf",
"file_url": "<string>",
"created_at": "2023-12-25"
},
"start_timestamp": 123,
"end_timestamp": 123
}
]
}
],
"tools": [
{
"name": "<string>",
"display_name": "<string>",
"action_name": "<string>",
"description": "<string>",
"icon": "StepFormIcon",
"icon_url": "<string>",
"connection_id": "<string>",
"parameters": {},
"enabled_by_default": true,
"callback": "<string>"
}
],
"features": {
"web_search": {},
"reasoning": {
"effort": "low"
}
},
"member": {
"id": "<string>",
"role": "ADMIN",
"user": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>"
},
"session": {
"id": "<string>"
},
"contact_channel": {
"id": "<string>",
"channel_type": "internal",
"channel_id": "<string>",
"channel_name": "<string>",
"channel_display_name": "<string>",
"channel_avatar": "<string>",
"country": "<string>",
"agent": "<string>",
"ip": "<string>",
"language": "<string>",
"contact": {
"id": "<string>",
"name": "<string>",
"blocked": true
},
"link": "<string>"
}
},
"error": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123,
"reasoning_tokens": 123,
"cached_input_tokens": 123
}
}