Browse this section
API reference

Conversations

Keep context across several queries.

A conversation groups queries so follow-ups can refer to earlier turns ("and which of those are overdue?").

MethodPathPurpose
POST/conversationsCreate (as_user, optional knowledge_bases, title)
GET/conversations/{id}Retrieve with turns
GET/conversationsList for a user
DELETE/conversations/{id}Delete
conv=$(curl -s -X POST https://api.brewmycode.com/v1/conversations \
  -H "Authorization: Bearer $BMC_API_KEY" -H "Content-Type: application/json" \
  -d '{ "as_user": "marja@example.com", "knowledge_bases": ["ops-eu"] }' | jq -r .id)

curl -X POST https://api.brewmycode.com/v1/queries \
  -H "Authorization: Bearer $BMC_API_KEY" -H "Content-Type: application/json" \
  -d "{ \"conversation\": \"$conv\", \"query\": \"Which suppliers have open August invoices?\", \"as_user\": \"marja@example.com\" }"

curl -X POST https://api.brewmycode.com/v1/queries \
  -H "Authorization: Bearer $BMC_API_KEY" -H "Content-Type: application/json" \
  -d "{ \"conversation\": \"$conv\", \"query\": \"Which of those are overdue?\", \"as_user\": \"marja@example.com\" }"

Conversations created from Slack and Teams threads appear here too, with channel set. Retention follows the workspace's query retention setting.