Developers
ENPT

Quickstart

Your first conversation with the avatar in three steps.

In three steps your system sends a question to the avatar and gets the answer back, exactly as a customer would on WhatsApp.

Get a token

Ask Tolky for your host token. See Authentication.

Create a conversation

Every exchange belongs to a conversation. Create one and keep its ID.

Send a message

Send the customer's message with the conversation ID. The avatar answers in the response.
RequestsTechnical details

1. Create a conversation

curl -X POST "https://api.tolky.to/api/externalAPIs/public/tolkyReasoning/conversations/create" \
  -H "Authorization: Bearer $TOLKY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "code": 200,
  "message": "OK",
  "data": { "conversationId": "3f0c2a8e-..." }
}

Send "subSlug": "<avatar-sub-slug>" to start the conversation with a specific avatar. Without it, the main avatar of the account answers.

2. Send a message

curl -X POST "https://api.tolky.to/api/externalAPIs/public/tolkyReasoning/callReasoning" \
  -H "Authorization: Bearer $TOLKY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "hostId": "<your-host-id>",
    "conversationId": "3f0c2a8e-...",
    "question": "What are your opening hours?"
  }'

3. Read the answer

{
  "code": 200,
  "message": "OK",
  "data": {
    "assistantResponse": {
      "string": "We are open Monday to Friday, 9am to 6pm.",
      "wppParsed": [{ "type": "text", "content": "We are open Monday to Friday, 9am to 6pm." }]
    },
    "conversationId": "3f0c2a8e-...",
    "responseStatus": { "ok": true, "message": null }
  }
}
  • Check data.responseStatus.ok. When it is false, the API answers with HTTP 503 and adds errorDetails.
  • wppParsed is an array: one item per message part (text, image, link).
  • Calls can take up to 60 seconds. Retry with backoff on 408, 500 and 503.

Check it worked

The conversation appears in Conversations in the platform, with the question and the avatar's answer.

Read files with Claude

To read invoices, documents, images or audio instead of chatting, see Use Tolky with Claude. It has a prompt you paste into Claude Code, which then calls the media extraction API for you.

Previous

Authentication

Next

Use Tolky with Claude