Post a message into an existing chat, authored as the contact (not as the admin). Only custom channels are supported.
curl --request POST \
--url https://api.useinvent.com/orgs/{org_id}/contacts/{contact_id}/chats/{chat_id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": [
{
"type": "text",
"text": "<string>",
"start_timestamp": 123,
"end_timestamp": 123
}
],
"channel_id": "<string>"
}
'{
"id": "<string>",
"role": "user",
"model": "<string>",
"status": "RUNNING",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"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-11-07T05:31:56Z"
},
"start_timestamp": 123,
"end_timestamp": 123
}
]
}
],
"tools": [
{
"name": "<string>",
"display_name": "<string>",
"action_name": "<string>",
"description": "<string>",
"icon": "StepFormIcon",
"icon_url": "<string>",
"parameters": {},
"enabled_by_default": true,
"callback": "<string>",
"validation": "<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>",
"type": "internal",
"user_id": "<string>",
"avatar": "<string>",
"name": "<string>",
"username": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"country": "<string>",
"agent": "<string>",
"ip": "<string>",
"language": "<string>",
"contact": {
"id": "<string>",
"name": "<string>",
"blocked": true,
"is_admin": true
},
"link": "<string>"
}
},
"error": "<string>",
"broadcast_id": "<string>",
"is_broadcast_message": true,
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123,
"reasoning_tokens": 123,
"input_tokens_cache_read": 123,
"input_tokens_cache_write": 123,
"turns": [
{
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123,
"reasoning_tokens": 123,
"input_tokens_cache_read": 123,
"input_tokens_cache_write": 123
}
]
}
}Bearer token authentication using your API key
Org ID
Contact ID
Chat ID
The message content, authored as the contact.
1User message parts
Show child attributes
The custom contact channel to send as. Required when the contact has more than one custom channel on this chat.
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
ID of the broadcast this message originates from
Whether this message was sent via a broadcast template
The usage information for the message
Show child attributes
Was this page helpful?
curl --request POST \
--url https://api.useinvent.com/orgs/{org_id}/contacts/{contact_id}/chats/{chat_id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": [
{
"type": "text",
"text": "<string>",
"start_timestamp": 123,
"end_timestamp": 123
}
],
"channel_id": "<string>"
}
'{
"id": "<string>",
"role": "user",
"model": "<string>",
"status": "RUNNING",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"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-11-07T05:31:56Z"
},
"start_timestamp": 123,
"end_timestamp": 123
}
]
}
],
"tools": [
{
"name": "<string>",
"display_name": "<string>",
"action_name": "<string>",
"description": "<string>",
"icon": "StepFormIcon",
"icon_url": "<string>",
"parameters": {},
"enabled_by_default": true,
"callback": "<string>",
"validation": "<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>",
"type": "internal",
"user_id": "<string>",
"avatar": "<string>",
"name": "<string>",
"username": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"country": "<string>",
"agent": "<string>",
"ip": "<string>",
"language": "<string>",
"contact": {
"id": "<string>",
"name": "<string>",
"blocked": true,
"is_admin": true
},
"link": "<string>"
}
},
"error": "<string>",
"broadcast_id": "<string>",
"is_broadcast_message": true,
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123,
"reasoning_tokens": 123,
"input_tokens_cache_read": 123,
"input_tokens_cache_write": 123,
"turns": [
{
"input_tokens": 123,
"output_tokens": 123,
"total_tokens": 123,
"reasoning_tokens": 123,
"input_tokens_cache_read": 123,
"input_tokens_cache_write": 123
}
]
}
}