Chat & runs
Send messages, stream replies, chat threads and approvals. 16 endpoints
GET /agent-runs
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
botId (query) | string |
Example
bash
curl -X GET 'https://api.lexcetha.com/api/v1/agent-runs' \
-H "Authorization: Bearer $LEX_TOKEN"POST /agent-runs
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
conversationId | string | ||
botId | string | ||
message | string | yes | length 1–20000 |
mode | "nalar" | "patih" | "cendikia" | ||
attachmentIds | string[] | max 5 items | |
mentions | object[] | max 10 items | |
mentions[].type | "connector" | "plugin" | "mini_program" | yes | |
mentions[].ref | string | yes | length 1–120 |
mentions[].name | string | yes | length 1–120 |
Example
bash
curl -X POST 'https://api.lexcetha.com/api/v1/agent-runs' \
-H "Authorization: Bearer $LEX_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"message":"string"}'GET /agent-runs/{runId}
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
runId (path) | string | yes |
Example
bash
curl -X GET 'https://api.lexcetha.com/api/v1/agent-runs/:runId' \
-H "Authorization: Bearer $LEX_TOKEN"POST /agent-runs/{runId}/cancel
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
runId (path) | string | yes |
Example
bash
curl -X POST 'https://api.lexcetha.com/api/v1/agent-runs/:runId/cancel' \
-H "Authorization: Bearer $LEX_TOKEN"GET /agent-runs/{runId}/tool-executions
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
runId (path) | string | yes |
Example
bash
curl -X GET 'https://api.lexcetha.com/api/v1/agent-runs/:runId/tool-executions' \
-H "Authorization: Bearer $LEX_TOKEN"GET /agent-runs/{runId}/events
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
runId (path) | string | yes |
Example
bash
curl -X GET 'https://api.lexcetha.com/api/v1/agent-runs/:runId/events' \
-H "Authorization: Bearer $LEX_TOKEN"GET /chats
Example
bash
curl -X GET 'https://api.lexcetha.com/api/v1/chats' \
-H "Authorization: Bearer $LEX_TOKEN"GET /chats/thread
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
botId (query) | string |
Example
bash
curl -X GET 'https://api.lexcetha.com/api/v1/chats/thread' \
-H "Authorization: Bearer $LEX_TOKEN"DELETE /chats/thread/messages
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
botId (query) | string |
Example
bash
curl -X DELETE 'https://api.lexcetha.com/api/v1/chats/thread/messages' \
-H "Authorization: Bearer $LEX_TOKEN"GET /conversations
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
botId (query) | string |
Example
bash
curl -X GET 'https://api.lexcetha.com/api/v1/conversations' \
-H "Authorization: Bearer $LEX_TOKEN"GET /conversations/{conversationId}
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
conversationId (path) | string | yes |
Example
bash
curl -X GET 'https://api.lexcetha.com/api/v1/conversations/:conversationId' \
-H "Authorization: Bearer $LEX_TOKEN"PATCH /conversations/{conversationId}
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
conversationId (path) | string | yes |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
title | string | yes | length 1–120 |
Example
bash
curl -X PATCH 'https://api.lexcetha.com/api/v1/conversations/:conversationId' \
-H "Authorization: Bearer $LEX_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"title":"string"}'DELETE /conversations/{conversationId}
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
conversationId (path) | string | yes |
Example
bash
curl -X DELETE 'https://api.lexcetha.com/api/v1/conversations/:conversationId' \
-H "Authorization: Bearer $LEX_TOKEN"GET /conversations/{conversationId}/messages
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
conversationId (path) | string | yes |
Example
bash
curl -X GET 'https://api.lexcetha.com/api/v1/conversations/:conversationId/messages' \
-H "Authorization: Bearer $LEX_TOKEN"GET /approvals/pending
Example
bash
curl -X GET 'https://api.lexcetha.com/api/v1/approvals/pending' \
-H "Authorization: Bearer $LEX_TOKEN"POST /approvals/{approvalId}/decision
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
approvalId (path) | string | yes |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
decision | "approve" | "reject" | yes |
Example
bash
curl -X POST 'https://api.lexcetha.com/api/v1/approvals/:approvalId/decision' \
-H "Authorization: Bearer $LEX_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"decision":"approve"}'