Conversations

Endpoints for managing conversation history.

Create a Conversation

post
/v1/conversations

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
post
/v1/conversations
POST /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
}

Get Conversation History

get
/v1/conversations/{conversationId}

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
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
  }
]