Skip to Content
iAdvizeDocs

List the widgets and versions a test can use

Returns the widgets of the site and, for each, the saved versions that can be an arm of an A/B test (the latest saved state of each version, so a version tested before is listed too), and whether a running test holds the widget. These are the ids to send to `POST /engagement-widgets/{widgetId}/experiments`.

GET
/api/v1/sites/{siteId}/widget-experiment-options

Authorization

ApiKeyAuth
headerAuthorizationBearer <token>

A WorkOS org-scoped API key, created from the dashboard's organization settings page. Identifies the tenant every read and write is scoped to. Missing, malformed, unknown, revoked, expired, or non-organization-owned keys all return 401 (no distinction, so the response can't be used to probe which keys or org ids exist).

Path Parameters

siteId*string

The site id (prefixed site_). A site id that isn't yours is a 404, same as any other cross-tenant id.

Response Body

The widgets of the site, empty when it has none.

application/json
  1. response
data*

The widgets and versions a test can be started from.

Example Request
curl -X GET 'https://example.com/api/v1/sites/string/widget-experiment-options'
Example Response
{  "data": {    "widgets": [      {        "id": "ewgt_01kvnwmagvf27rc9cze5rm9e1r",        "name": "Starter questions",        "enabled": true,        "held": false,        "versions": [          {            "id": "ewgv_01kvnwmagwf27rc9d7zef4qksf",            "number": 2,            "name": "Shorter prompts",            "status": "draft",            "format": "floating",            "isLive": false,            "matchAllPages": false,            "pageTypes": [              "product"            ]          },          {            "id": "ewgv_01kvnwmagvf27rc9cze5rm9e1r",            "number": 1,            "name": null,            "status": "champion",            "format": "floating",            "isLive": true,            "matchAllPages": false,            "pageTypes": [              "product"            ]          }        ]      }    ]  }}