Send a message, get the agent's reply

POSThttps://server.heyrik.com/api/v1/chat/sessions/{id}/messages

Path parameters

idRequired

Replace {id} in the request URL with the value for this resource.

Headers

AuthorizationstringRequired

Use Bearer $HEYRIK_API_KEY with an account-scoped API key. Keep the key on your server.

Get your API key

Parameters 1

Fields documented for this operation. See the request example for placement and structure.

messagestringRequired

The user's new message. The prior turns are loaded from the session — you only send the latest one.

Response

Explore the example values. This is not a complete response schema.

dataobject
Explore 5 properties
replystring

Example "I can help you book an appointment, answer timings, and more. How can I help?"

messageobject
Explore 3 properties
idstring

Example "msg_f8511683"

rolestring

Example "assistant"

session_idstring

Example "cht_c09b79cc"

credits_chargednumber

Example 1

balance_creditsnumber

Example 4974

session_idstring

Example "cht_c09b79cc"

Error reference
POST/chat/sessions/{id}/messages
cURL
curl -X POST https://server.heyrik.com/api/v1/chat/sessions/cht_c09b79cc/messages \
  -H "Authorization: Bearer $HEYRIK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "message": "Hi, what can you do?" }'
Response example
JSON
{
  "data": {
    "reply": "I can help you book an appointment, answer timings, and more. How can I help?",
    "message": { "id": "msg_f8511683", "role": "assistant", "session_id": "cht_c09b79cc" },
    "credits_charged": 1,
    "balance_credits": 4974,
    "session_id": "cht_c09b79cc"
  }
}

Illustrative examples · No live request is sent

Docs

Build sophisticated voice experiences with HeyRik.

© 2026 HeyRik · Support