Messages API
Create Message
Create a new message
POST
/
messages
/
create
curl --request POST \
--url https://api.duohub.ai/messages/create \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{
"sessionID": "123e4567-e89b-12d3-a456-426614174000",
"role": "user",
"content": "Hello, how can I help you today?"
}'
{
"status": "success",
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"sessionID": "987fcdeb-51a2-43b7-91fa-987654321000",
"role": "user",
"content": "Hello, how can I help you today?",
"userID": "d99e7428-40e1-7073-aa50-94cee086b518",
"customerUserID": "cust-123",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
}
}
Authorizations
Your duohub API key. Type: str
Body
application/json
Response
201
application/json
Message created successfully
The response is of type object
.
curl --request POST \
--url https://api.duohub.ai/messages/create \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{
"sessionID": "123e4567-e89b-12d3-a456-426614174000",
"role": "user",
"content": "Hello, how can I help you today?"
}'
{
"status": "success",
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"sessionID": "987fcdeb-51a2-43b7-91fa-987654321000",
"role": "user",
"content": "Hello, how can I help you today?",
"userID": "d99e7428-40e1-7073-aa50-94cee086b518",
"customerUserID": "cust-123",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
}
}
Assistant
Responses are generated using AI and may contain mistakes.