Skip to main content

Create Message

POST 
/ai/conversations/:conversation_id/messages

Add a new message to the conversation. Used to insert a new messages to a conversation manually ( without using chat endpoint )

Request

Path Parameters

    conversation_id uuidrequired

    The ID of the conversation

Body

required

    role Role (string)required
    content Content (string)
    name Name (string)

    tool_choice

    object

    anyOf

    tool_calls object[]
    tool_call_id Tool Call Id (string)
    sent_at date-time

    metadata

    Metadata

    property name*

    object

    anyOf

Responses

200: Successful Response

422: Validation Error

Request samples


curl -L 'https://api.telnyx.com/v2/ai/conversations/:conversation_id/messages' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"role": "string",
"content": "string",
"name": "string",
"tool_choice": "string",
"tool_calls": [
{}
],
"tool_call_id": "string",
"sent_at": "2024-07-29T15:51:28.071Z"
}'

Response samples


{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}