API reference

Test Calls

Test calls against drafts

MethodPathSummary
POST/v1/account/test-callStart a browser test call against a draft or published version
POST/v1/account/test-chat/messagesSend 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}/endClose 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.

FieldTypeRequiredDescription
groupDraftbooleanNoDefault: false.
groupIdstring (grp_… ID)YesID (grp_…)
playbookIdstring (pb_… ID)YesID (pb_…)
versioninteger | enumNoDefault: "draft".

Response 201

FieldTypeRequiredDescription
groupDraftbooleanYes—
playbookVersionIdstring (pbv_… ID)YesID (pbv_…)
sessionobjectYes—
session.roomNamestringYes—
session.serverUrlstringYes—
session.tokenstringYes—
testNumberobject | nullYes—
testNumber.e164stringYes—
testNumber.idstring (pn_… ID)YesID (pn_…)
versionintegerYes—

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.

FieldTypeRequiredDescription
conversationIdstring (call_… ID) | nullYes—
groupDraftbooleanNoDefault: false.
groupIdstring (grp_… ID)YesID (grp_…)
messageIdstringYesPattern: ^[A-Za-z0-9_-]\{8,64\}$.
playbookIdstring (pb_… ID)YesID (pb_…)
slotIdstringNoPattern: ^[A-Za-z0-9_-]\{1,32\}$.
textstringYes1–4000 characters.
versioninteger | enumNoDefault: "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

NameTypeRequiredDescription
conversationIdstring (call_… ID)YesID (call_…)

Request body

application/json, required.

FieldTypeRequiredDescription
groupIdstring (grp_… ID)YesID (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"
}'