DocsAPI ReferenceChat/api/v1/chat/ai-turn
postChatPublic API v1

/api/v1/chat/ai-turn

Persists both messages in cas__chat_message and returns the answer + ids. Creates the room when roomId is omitted.

chatpostApiV1ChatAi-turn

Parameters

1 query · 7 body

8 total
Query · 1
apiKeystringRequired

Your BizKitHub API key (passed as GET parameter).

Key format: A 32-character string matching: ^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$
Prefixes: PROD (production key), DEV_ (individual developer), ROOT (system key with no limits). Learn more

Body · 7
questionstringRequired

The user prompt.

Length: 1
roomIdstring

Chat room public id (cas__chat_room.external_id), 24 chars.

Length: 2424
modelstring
Length: 0100
sourcestring
Length: 032
externalUserRefstring
Length: 064
contactExternalIdstring
Length: 1616
metadataobject

Request

POST /api/v1/chat/ai-turn

post
curl -X POST "https://api.bizkithub.com/api/v1/chat/ai-turn?apiKey=PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "question": "example_question",
  "roomId": "ZUiVZuKwAaXNoT4nGUbnKR75",
  "model": "example_model",
  "source": "example_source",
  "externalUserRef": "example_externalUserRef",
  "contactExternalId": "example_contactExternalId",
  "metadata": {}
}'

Response

JSON payload

{
  "roomId": "ZUiVZuKwAaXNoT4nGUbnKR75",
  "userMessageId": "example_userMessageId",
  "assistantMessageId": "example_assistantMessageId",
  "answer": "example_answer"
}

All response codes

1 status code documented

Need an API key?

All BizKitHub API endpoints require authentication via API key.

Get API Key