Conversations
Endpoints for managing conversation history.
Creates a new, empty conversation with an agent for a specific user. This is useful for initializing a chat session before the first message is sent. This operation is free of charge.
Authorizations
Body
agentIdstringRequired
The ID of the agent to start a conversation with.
userIdstringRequired
A unique identifier for the end-user.
Responses
201
Conversation created successfully.
application/json
default
An unexpected error occurred.
application/json
post
/v1/conversationsPOST /v1/conversations HTTP/1.1
Host: api.kex.gg
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 34
{
"agentId": "text",
"userId": "text"
}
{
"id": "text",
"agentId": "text",
"createdAt": 1
}
Retrieves the full message history for a specific conversation. This operation is free of charge.
Authorizations
Path parameters
conversationIdstringRequired
The unique identifier of the conversation.
Responses
200
An array of messages from the conversation.
application/json
404
The specified resource was not found.
application/json
default
An unexpected error occurred.
application/json
get
/v1/conversations/{conversationId}GET /v1/conversations/{conversationId} HTTP/1.1
Host: api.kex.gg
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
[
{
"role": "user",
"content": "text",
"timestamp": 1
}
]