Widgets

Add a widget to an A/B test

Puts the widget into the named test, starting the test when the slot is empty, or moves it from another test; its results count from now. A widget already in that test is returned with changed: false. The widget keeps its on/off state.

post/v1/sites/{site_id}/widgets/{widget_id}/ab-test

Request

  • Base URL
    https://api.getsitecontrol.com
  • Auth
    HTTP bearer

Path parameters

site_idinteger required
widget_idinteger required

Widget id from List widgets

Headers

Idempotency-Keystring

Makes a retry of a POST safe: a repeat with the same key, body and GSC-Version returns the stored response with Idempotency-Replayed: true instead of running again. The key protects against repeated execution while the key store works. Saving the change and storing the response under the key are not atomic: if the process or the key store fails between them, the change is kept, the key is released after 15 minutes and a retry runs the request again. After a timeout or a 5xx, read the resource to check the result before retrying. 5xx and 429 responses and responses over 256 KB are not stored, so a repeat runs the request again. A key is kept for 24 hours. The same key with another body or version is 422; a repeat while the first request runs is 409.

Request body

name'1' | '2' | '3' | '4' | '5' required

One of the five slots; a slot not in use starts a new test

Response

Successful Response

changedboolean required

False when the widget already was in the requested state

Changes

No recorded changes to this operation across all 1 revision of this API.