API reference
Test Calls
Test calls against drafts
| Method | Path | Summary |
|---|---|---|
POST | /v1/account/test-call | Start a browser test call against a draft or published version |
POST | /v1/account/test-chat/messages | Send a message to a draft through the website chat. The reply streams back as server-sent events: conversation, debug…, sentence…, choices, calendar, done (or error) |
POST | /v1/account/test-chat/{conversationId}/end | Close a test chat now, so its call page and saved trace are ready, instead of after 30 quiet minutes |
Start a browser test call against a draft or published version#
POST /v1/account/test-call
Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).
Request body
application/json, required.
| Field | Type | Required | Description |
|---|---|---|---|
groupDraft | boolean | No | Default: false. |
groupId | string (grp_… ID) | Yes | ID (grp_…) |
playbookId | string (pb_… ID) | Yes | ID (pb_…) |
version | integer | enum | No | Default: "draft". |
Response 201
| Field | Type | Required | Description |
|---|---|---|---|
groupDraft | boolean | Yes | — |
playbookVersionId | string (pbv_… ID) | Yes | ID (pbv_…) |
session | object | Yes | — |
session.roomName | string | Yes | — |
session.serverUrl | string | Yes | — |
session.token | string | Yes | — |
testNumber | object | null | Yes | — |
testNumber.e164 | string | Yes | — |
testNumber.id | string (pn_… ID) | Yes | ID (pn_…) |
version | integer | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, 503, with an ErrorBody body.
Example
bash
curl -X POST "$ANSWERSTACK_API_URL/v1/account/test-call" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"playbookId": "pb_2ZPh7XbT0v9Ao4iJ3qK1mN8sRgE",
"groupId": "grp_2ZPh7XbT0v9Ao4iJ3qK1mN8sRgE"
}'Send a message to a draft through the website chat. The reply streams back as server-sent events: conversation, debug…, sentence…, choices, calendar, done (or error)#
POST /v1/account/test-chat/messages
Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).
Request body
application/json, required.
| Field | Type | Required | Description |
|---|---|---|---|
conversationId | string (call_… ID) | null | Yes | — |
groupDraft | boolean | No | Default: false. |
groupId | string (grp_… ID) | Yes | ID (grp_…) |
messageId | string | Yes | Pattern: ^[A-Za-z0-9_-]\{8,64\}$. |
playbookId | string (pb_… ID) | Yes | ID (pb_…) |
slotId | string | No | Pattern: ^[A-Za-z0-9_-]\{1,32\}$. |
text | string | Yes | 1–4000 characters. |
version | integer | enum | No | Default: "draft". |
Response 200
No content.
Errors: 400, 401, 403, 404, 409, 410, 429, 500, 503, with an ErrorBody body.
Example
bash
curl -X POST "$ANSWERSTACK_API_URL/v1/account/test-chat/messages" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"messageId": "string",
"text": "string",
"playbookId": "pb_2ZPh7XbT0v9Ao4iJ3qK1mN8sRgE",
"groupId": "grp_2ZPh7XbT0v9Ao4iJ3qK1mN8sRgE",
"conversationId": "call_2ZPh7XbT0v9Ao4iJ3qK1mN8sRgE"
}'Close a test chat now, so its call page and saved trace are ready, instead of after 30 quiet minutes#
POST /v1/account/test-chat/{conversationId}/end
Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
conversationId | string (call_… ID) | Yes | ID (call_…) |
Request body
application/json, required.
| Field | Type | Required | Description |
|---|---|---|---|
groupId | string (grp_… ID) | Yes | ID (grp_…) |
Response 204
No content.
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
bash
curl -X POST "$ANSWERSTACK_API_URL/v1/account/test-chat/{conversationId}/end" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"groupId": "grp_2ZPh7XbT0v9Ao4iJ3qK1mN8sRgE"
}'