Messages
Endpoint for sending messages to agents.
Sends a message to an agent. Costs 1 Credit. If no conversationId is provided, a new conversation is created automatically. If one is provided, the message is added to the existing conversation.
Authorizations
Body
agentIdstringRequired
The ID of the agent to send the message to.
userIdstringRequired
A unique identifier for the end-user.
messagestringRequired
The content of the user's message.
conversationIdstringOptional
Optional. The ID of an existing conversation to continue.
Responses
200
Message sent successfully, returning the agent's response.
application/json
402
The user's credit balance is insufficient.
application/json
default
An unexpected error occurred.
application/json
post
/v1/messagesPOST /v1/messages HTTP/1.1
Host: api.kex.gg
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 75
{
"agentId": "text",
"userId": "text",
"message": "text",
"conversationId": "text"
}
{
"success": true,
"conversationId": "text",
"response": "text"
}