Client token handshake
The handshake gives a short-lived agent client token for one agent, plus the agent's widget settings. The token lets a mobile app or your own chat window talk to the agent without your API key.
| Where your chat runs | How to get the token |
|---|---|
| The LUMA website widget | Nothing to do: the widget runs the handshake itself |
| Your own chat design on a web page | Your server calls the handshake and gives the token to the page (browsers on other sites cannot call this address directly) |
| Your mobile app | The app or your server calls the handshake |
POST https://api.itechintl.com/v1/widget/handshake
Plan: every plan. Credits: free. Authentication: none (the token is limited to one agent).
Request
curl --request POST 'https://api.itechintl.com/v1/widget/handshake' \
--header 'Content-Type: application/json' \
--data '{
"project_id": "PROJECT_ID",
"chatbot_id": "AGENT_ID"
}'
| Field | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | Project ID from the agent's Install page (data-pid in the embed code) |
chatbot_id | string | yes | Agent ID from the Install page (data-cid in the embed code) |
version | string | no | draft returns the unpublished widget settings, for previews |
Response 200
{
"message": "Success",
"data": {
"jwt": "AGENT_CLIENT_TOKEN",
"title": "Sales Assistant",
"welcome_message": "Hi, how can I help you today?",
"placeholder_text": "Type your question",
"widget_theme_color": "#0B2A4A",
"widget_position": "right",
"theme_mode": "light",
"enable_sources": true,
"enable_suggested_questions": true,
"show_registration_form": false,
"css_text": ""
}
}
| Field | Description |
|---|---|
jwt | The agent client token. Send it as Authorization: Bearer <jwt> to the chat endpoints. Valid for 1 hour. |
| other fields | The agent's widget settings, as configured in the app (appearance, texts, options) |
Token lifetime
- Valid for 1 hour. When a chat call answers
401, run the handshake again and retry once. - The token allows chatting with this agent only. It cannot send WhatsApp messages or read your data.
Errors
| Status | error.code | When |
|---|---|---|
| 400 | BAD REQUEST | Missing or invalid project_id or chatbot_id |
| 500 | INTERNAL SERVER ERROR | Unexpected error; retry |