API reference

Widget Keys

Widget Keys endpoints.

MethodPathSummary
GET/v1/account/widget/keysThe account's widget keys, newest first
POST/v1/account/widget/keysCreate a widget key for one group, or for a page that names its own
PATCH/v1/account/widget/keys/{keyId}Change a key: its name, its group, the origins it allows, what it offers, or whether it is disabled
DELETE/v1/account/widget/keys/{keyId}Delete a key that was never used. A key that has been used is disabled instead, so its record survives

The account's widget keys, newest first#

GET /v1/account/widget/keys

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Response 200

FieldTypeRequiredDescription
keysarray<WidgetKey>Yes—
keys[].allowedOriginsarray<string>Yes—
keys[].chatEnabledbooleanYes—
keys[].createdAtstring (date-time)Yes—
keys[].exposeEventContentbooleanYes—
keys[].groupIdstring (grp_… ID) | nullYes—
keys[].groupModeenumYesOne of: "fixed", "param".
keys[].groupNamestring | nullYes—
keys[].idstring (wk_… ID)YesID (wk_…)
keys[].kindenumYesOne of: "live", "test".
keys[].lastSeenAtstring (date-time) | nullYes—
keys[].namestringYes—
keys[].publicIdstringYes—
keys[].statusenumYesOne of: "active", "disabled".
keys[].voiceEnabledbooleanYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X GET "$ANSWERSTACK_API_URL/v1/account/widget/keys" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Create a widget key for one group, or for a page that names its own#

POST /v1/account/widget/keys

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Request body

application/json, required.

FieldTypeRequiredDescription
allowedOriginsarray<string>YesUp to 50 items.
chatEnabledbooleanNoDefault: true.
exposeEventContentbooleanNoDefault: false.
groupIdstring (grp_… ID)NoID (grp_…)
groupModeenumNoOne of: "fixed", "param". Default: "fixed".
kindenumNoOne of: "live", "test". Default: "live".
namestringYes1–80 characters.
voiceEnabledbooleanNoDefault: false.

Response 201

FieldTypeRequiredDescription
allowedOriginsarray<string>Yes—
chatEnabledbooleanYes—
createdAtstring (date-time)Yes—
exposeEventContentbooleanYes—
groupIdstring (grp_… ID) | nullYes—
groupModeenumYesOne of: "fixed", "param".
groupNamestring | nullYes—
idstring (wk_… ID)YesID (wk_…)
kindenumYesOne of: "live", "test".
lastSeenAtstring (date-time) | nullYes—
namestringYes—
publicIdstringYes—
statusenumYesOne of: "active", "disabled".
voiceEnabledbooleanYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X POST "$ANSWERSTACK_API_URL/v1/account/widget/keys" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "allowedOrigins": [
    "string"
  ]
}'

Change a key: its name, its group, the origins it allows, what it offers, or whether it is disabled#

PATCH /v1/account/widget/keys/{keyId}

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Path parameters

NameTypeRequiredDescription
keyIdstring (wk_… ID)YesID (wk_…)

Request body

application/json, required.

FieldTypeRequiredDescription
allowedOriginsarray<string>NoUp to 50 items.
chatEnabledbooleanNo—
exposeEventContentbooleanNo—
groupIdstring (grp_… ID) | nullNo—
groupModeenumNoOne of: "fixed", "param".
namestringNo1–80 characters.
statusenumNoOne of: "active", "disabled".
voiceEnabledbooleanNo—

Response 200

FieldTypeRequiredDescription
allowedOriginsarray<string>Yes—
chatEnabledbooleanYes—
createdAtstring (date-time)Yes—
exposeEventContentbooleanYes—
groupIdstring (grp_… ID) | nullYes—
groupModeenumYesOne of: "fixed", "param".
groupNamestring | nullYes—
idstring (wk_… ID)YesID (wk_…)
kindenumYesOne of: "live", "test".
lastSeenAtstring (date-time) | nullYes—
namestringYes—
publicIdstringYes—
statusenumYesOne of: "active", "disabled".
voiceEnabledbooleanYes—

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X PATCH "$ANSWERSTACK_API_URL/v1/account/widget/keys/{keyId}" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "allowedOrigins": [
    "string"
  ],
  "chatEnabled": true,
  "exposeEventContent": true,
  "groupId": "grp_2ZPh7XbT0v9Ao4iJ3qK1mN8sRgE",
  "groupMode": "fixed",
  "name": "string",
  "status": "active",
  "voiceEnabled": true
}'

Delete a key that was never used. A key that has been used is disabled instead, so its record survives#

DELETE /v1/account/widget/keys/{keyId}

Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).

Path parameters

NameTypeRequiredDescription
keyIdstring (wk_… ID)YesID (wk_…)

Response 204

No content.

Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.

Example

bash
curl -X DELETE "$ANSWERSTACK_API_URL/v1/account/widget/keys/{keyId}" \
  -H "Authorization: Bearer $ACCESS_TOKEN"