Pick an A/B test's winner
const url = 'https://digize.com/api/v1/automations/workflows/example/split-tests/example/winner';const options = { method: 'PUT', headers: { 'Idempotency-Key': '5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69', 'x-api-key': '<x-api-key>', 'Content-Type': 'application/json' }, body: '{"winner":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://digize.com/api/v1/automations/workflows/example/split-tests/example/winner \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \ --header 'x-api-key: <x-api-key>' \ --data '{ "winner": "example" }'Sends every run that gets to an A/B split down one path from now on, runs already going too, and stops counting new contacts. A null winner puts the split back to testing by its shares. The split has to be in the published version.
Needs the automations:write permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.
Example
5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Done
object
The A/B split node’s id.
The split node’s name.
Whether the split is in the version runs use; one only in the editor’s changes counts nothing until it’s published.
Contacts were counted under another goal too, since it changed: reset the results to count afresh.
Contacts whose days to win are still going.
Contacts counted on paths the split doesn’t have now.
object
Its share of new contacts, 0 to 100.
Contacts who took it.
Of them, those who won.
Its rate over the first path’s, relative: 0.2 is 20% more.
What its contacts paid in orders and invoices in their days, in the currency’s minor units.
Days since the first contact was counted.
Decided once a winner is picked; no_goal without a goal; otherwise too_early until it has run 7 days with 50 contacts on each path, then winner at a 95% chance of being best, no_difference once each path has the contacts to show a 20% lift, or keep_going.
The path most likely to be best, or the picked winner.
object
object
Example
{ "goal": { "event": "contact.tag_added" }, "verdict": "decided"}What was sent isn’t valid (invalid).
object
object
object
Example
{ "error": { "code": "invalid" }}No key, or one that’s unknown, off or expired.
object
object
object
Example
{ "error": { "code": "invalid" }}The key doesn’t have the permission this needs.
object
object
object
Example
{ "error": { "code": "invalid" }}Nothing has that id (not_found).
object
object
object
Example
{ "error": { "code": "invalid" }}A request with the same Idempotency-Key is still running (conflict).
object
object
object
Example
{ "error": { "code": "invalid" }}The Idempotency-Key was used with a different request.
object
object
object
Example
{ "error": { "code": "invalid" }}Over the rate limit; see retry-after.
object
object
object
Example
{ "error": { "code": "invalid" }}