Overview
POST
/chat/chat-messageschatCreate chat_messages
Create a record in chat-messages.
Auth: bearerAuth — calls run as the authenticated user.
Request body
application/json · optional
- ecosystemIdoptionalstring
- chatIdstring
- senderParticipantIdoptionalstring?
- clientMessageIdoptionalstring?
- seqoptionalinteger
- rolestring
- bodyoptionalstring?
- toolCallsoptionalstring?
- toolCallIdoptionalstring?
- toolNameoptionalstring?
- replyToMessageIdoptionalstring?
- stateoptionalstring
- dateSentstring
- dateDeliveredoptionalstring?
- deletedAtoptionalstring?
- editedAtoptionalstring?
Example
{
"ecosystemId": "string",
"chatId": "string",
"senderParticipantId": "string",
"clientMessageId": "string",
"seq": 0,
"role": "string",
"body": "string",
"toolCalls": "string",
"toolCallId": "string",
"toolName": "string",
"replyToMessageId": "string",
"state": "string",
"dateSent": "string",
"dateDelivered": "string",
"deletedAt": "string",
"editedAt": "string"
}Responses
201
chat_messages
- idstring
- ecosystemIdstring
- chatIdstring
- senderParticipantIdstring?
- clientMessageIdstring?
- seqinteger
- rolestring
- bodystring?
- toolCallsstring?
- toolCallIdstring?
- toolNamestring?
- replyToMessageIdstring?
- statestring
- dateSentstring
- dateDeliveredstring?
- deletedAtstring?
- editedAtstring?
Example
{
"id": "string",
"ecosystemId": "string",
"chatId": "string",
"senderParticipantId": "string",
"clientMessageId": "string",
"seq": 0,
"role": "string",
"body": "string",
"toolCalls": "string",
"toolCallId": "string",
"toolName": "string",
"replyToMessageId": "string",
"state": "string",
"dateSent": "string",
"dateDelivered": "string",
"deletedAt": "string",
"editedAt": "string"
}400
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}401
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}Code examples
cURL
curl -X POST "https://api.agenticdeveloperhub.com/chat/chat-messages" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"ecosystemId": "string",
"chatId": "string",
"senderParticipantId": "string",
"clientMessageId": "string",
"seq": 0,
"role": "string",
"body": "string",
"toolCalls": "string",
"toolCallId": "string",
"toolName": "string",
"replyToMessageId": "string",
"state": "string",
"dateSent": "string",
"dateDelivered": "string",
"deletedAt": "string",
"editedAt": "string"
}'JavaScript
const res = await fetch("https://api.agenticdeveloperhub.com/chat/chat-messages", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: "{\n \"ecosystemId\": \"string\",\n \"chatId\": \"string\",\n \"senderParticipantId\": \"string\",\n \"clientMessageId\": \"string\",\n \"seq\": 0,\n \"role\": \"string\",\n \"body\": \"string\",\n \"toolCalls\": \"string\",\n \"toolCallId\": \"string\",\n \"toolName\": \"string\",\n \"replyToMessageId\": \"string\",\n \"state\": \"string\",\n \"dateSent\": \"string\",\n \"dateDelivered\": \"string\",\n \"deletedAt\": \"string\",\n \"editedAt\": \"string\"\n}",
});
const data = await res.json();