API reference
Widget Keys
Widget Keys endpoints.
| Method | Path | Summary |
|---|---|---|
GET | /v1/account/widget/keys | The account's widget keys, newest first |
POST | /v1/account/widget/keys | Create 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
| Field | Type | Required | Description |
|---|---|---|---|
keys | array<WidgetKey> | Yes | — |
keys[].allowedOrigins | array<string> | Yes | — |
keys[].chatEnabled | boolean | Yes | — |
keys[].createdAt | string (date-time) | Yes | — |
keys[].exposeEventContent | boolean | Yes | — |
keys[].groupId | string (grp_… ID) | null | Yes | — |
keys[].groupMode | enum | Yes | One of: "fixed", "param". |
keys[].groupName | string | null | Yes | — |
keys[].id | string (wk_… ID) | Yes | ID (wk_…) |
keys[].kind | enum | Yes | One of: "live", "test". |
keys[].lastSeenAt | string (date-time) | null | Yes | — |
keys[].name | string | Yes | — |
keys[].publicId | string | Yes | — |
keys[].status | enum | Yes | One of: "active", "disabled". |
keys[].voiceEnabled | boolean | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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.
| Field | Type | Required | Description |
|---|---|---|---|
allowedOrigins | array<string> | Yes | Up to 50 items. |
chatEnabled | boolean | No | Default: true. |
exposeEventContent | boolean | No | Default: false. |
groupId | string (grp_… ID) | No | ID (grp_…) |
groupMode | enum | No | One of: "fixed", "param". Default: "fixed". |
kind | enum | No | One of: "live", "test". Default: "live". |
name | string | Yes | 1–80 characters. |
voiceEnabled | boolean | No | Default: false. |
Response 201
| Field | Type | Required | Description |
|---|---|---|---|
allowedOrigins | array<string> | Yes | — |
chatEnabled | boolean | Yes | — |
createdAt | string (date-time) | Yes | — |
exposeEventContent | boolean | Yes | — |
groupId | string (grp_… ID) | null | Yes | — |
groupMode | enum | Yes | One of: "fixed", "param". |
groupName | string | null | Yes | — |
id | string (wk_… ID) | Yes | ID (wk_…) |
kind | enum | Yes | One of: "live", "test". |
lastSeenAt | string (date-time) | null | Yes | — |
name | string | Yes | — |
publicId | string | Yes | — |
status | enum | Yes | One of: "active", "disabled". |
voiceEnabled | boolean | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Name | Type | Required | Description |
|---|---|---|---|
keyId | string (wk_… ID) | Yes | ID (wk_…) |
Request body
application/json, required.
| Field | Type | Required | Description |
|---|---|---|---|
allowedOrigins | array<string> | No | Up to 50 items. |
chatEnabled | boolean | No | — |
exposeEventContent | boolean | No | — |
groupId | string (grp_… ID) | null | No | — |
groupMode | enum | No | One of: "fixed", "param". |
name | string | No | 1–80 characters. |
status | enum | No | One of: "active", "disabled". |
voiceEnabled | boolean | No | — |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
allowedOrigins | array<string> | Yes | — |
chatEnabled | boolean | Yes | — |
createdAt | string (date-time) | Yes | — |
exposeEventContent | boolean | Yes | — |
groupId | string (grp_… ID) | null | Yes | — |
groupMode | enum | Yes | One of: "fixed", "param". |
groupName | string | null | Yes | — |
id | string (wk_… ID) | Yes | ID (wk_…) |
kind | enum | Yes | One of: "live", "test". |
lastSeenAt | string (date-time) | null | Yes | — |
name | string | Yes | — |
publicId | string | Yes | — |
status | enum | Yes | One of: "active", "disabled". |
voiceEnabled | boolean | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
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
| Name | Type | Required | Description |
|---|---|---|---|
keyId | string (wk_… ID) | Yes | ID (wk_…) |
Response 204
No content.
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
curl -X DELETE "$ANSWERSTACK_API_URL/v1/account/widget/keys/{keyId}" \
-H "Authorization: Bearer $ACCESS_TOKEN"