Skip to content

Pick an A/B test's winner

PUT
/api/v1/automations/workflows/{workflowId}/split-tests/{nodeId}/winner
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.

workflowId
required
string
>= 1 characters <= 64 characters
nodeId
required
string
>= 1 characters <= 64 characters
Idempotency-Key
string
>= 1 characters <= 255 characters

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-1f2d3c4b5a69
Media typeapplication/json
object
winner
required
Any of:
string
>= 1 characters <= 64 characters

Example generated

{
"winner": "example"
}

Done

Media typeapplication/json
object
nodeId
required

The A/B split node’s id.

string
name
required

The split node’s name.

string
published
required

Whether the split is in the version runs use; one only in the editor’s changes counts nothing until it’s published.

boolean
goal
required
object
event
required
Any of:

An event about the run’s contact, such as order.paid.

string
Allowed values: contact.tag_added contact.tag_removed form.submitted message.received booking.created booking.cancelled order.paid invoice.paid quote.accepted document.signed opportunity.won opportunity.lost review.received newsletter.unsubscribed email.opened newsletter.clicked page.visited qr.scanned video.watched video.cta_clicked linkedin.connected
tag
required

For a tag event, the tag; empty for any.

string
days
required

Wins, and money from orders and invoices paid, count for this many days after a contact takes a path.

number
goalChanged
required

Contacts were counted under another goal too, since it changed: reset the results to count afresh.

boolean
winner
required
Any of:
object
path
required
string
decidedAt
required
string format: date-time
decidedBy
required
string
firstAt
required
Any of:
string format: date-time
lastAt
required
Any of:
string format: date-time
counting
required

Contacts whose days to win are still going.

number
elsewhere
required

Contacts counted on paths the split doesn’t have now.

number
currency
required
string
paths
required
Array<object>
object
id
required
string
label
required
string
share
required

Its share of new contacts, 0 to 100.

number
entered
required

Contacts who took it.

number
converted
required

Of them, those who won.

number
rate
required
number | null
lift
required

Its rate over the first path’s, relative: 0.2 is 20% more.

number | null
liftLow
required
number | null
liftHigh
required
number | null
chanceToBeBest
required
number | null
revenue
required

What its contacts paid in orders and invoices in their days, in the currency’s minor units.

number
buyers
required
number
revenuePerContact
required
number | null
entered
required
number
converted
required
number
days
required

Days since the first contact was counted.

number
verdict
required

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.

string
Allowed values: decided no_goal not_started too_early keep_going winner no_difference
leader
required

The path most likely to be best, or the picked winner.

string | null
neededPerPath
required
number | null
minDays
required
number
minContacts
required
number
daily
required
Array<object>
object
date
required
string
paths
required
Array<object>
object
path
required
string
entered
required
number
rate
required
number | null

Example

{
"goal": {
"event": "contact.tag_added"
},
"verdict": "decided"
}

What was sent isn’t valid (invalid).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

No key, or one that’s unknown, off or expired.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The key doesn’t have the permission this needs.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Nothing has that id (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

A request with the same Idempotency-Key is still running (conflict).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The Idempotency-Key was used with a different request.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Over the rate limit; see retry-after.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}