One endpoint. Plain JSON.
The public chat API is intentionally minimal. A question in, a reply out, an optional conversation ID to link turns.
Authentication
No API key is required for the public chat endpoint. Your agent’s embed token is the credential — keep it out of public source code if you want to restrict access. You can lock the endpoint to specific domains from the Configure tab.
Base URL
https://resposai.com
POST /api/chat/[token]
Send a message to an agent and receive a reply. Optionally pass a conversation ID to continue a prior session.
Request
POST /api/chat/{token}
Content-Type: application/json
{
"question": "What are your opening hours?",
"conversation_id": "optional-uuid-to-continue"
}| Field | Type | Required | Description |
|---|---|---|---|
| question | string | Yes | The visitor's message. |
| conversation_id | string (UUID) | No | Omit to start a new conversation. Include to append to an existing one. |
Response
{
"conversation_id": "550e8400-e29b-41d4-a716-446655440000",
"reply": "We're open Monday–Friday, 9 am to 6 pm."
}Error responses
| Code | Meaning |
|---|---|
| 400 | Missing or empty question field. |
| 403 | Origin not in allowed-domain list, or agent is paused/draft. |
| 404 | Token not found — check the token in your URL. |
| 500 | Upstream error (AI inference or database). Retry with backoff. |
CORS
All POST and OPTIONS requests to /api/chat/* return permissive CORS headers by default. If you have configured allowed domains, only those origins will receive a non-403 response.
Rate limits
60 messages per visitor per hour per agent. Exceeded requests return HTTP 429. The limit resets on the clock hour.
Example: curl
curl -X POST https://resposai.com/api/chat/YOUR_TOKEN \
-H "Content-Type: application/json" \
-d '{"question":"What is your return policy?"}'Example: JavaScript fetch
const res = await fetch('https://resposai.com/api/chat/YOUR_TOKEN', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
question: 'Do you ship internationally?',
conversation_id: savedConversationId ?? undefined,
}),
})
const { reply, conversation_id } = await res.json()
// save conversation_id for the next turnNeed a webhook for WhatsApp? See the documentation or the integrations page.