curl --request POST \
--url https://api.meetdarwin.ai/v1/experiments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"openings": [
{
"headline": "<string>",
"buttons": [
{
"label": "<string>",
"message": "<string>"
}
],
"name": "<string>",
"hypothesis": "<string>"
}
],
"hypothesis": "<string>",
"page": "<string>",
"unit": "<string>",
"launch": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
openings: [
{
headline: '<string>',
buttons: [{label: '<string>', message: '<string>'}],
name: '<string>',
hypothesis: '<string>'
}
],
hypothesis: '<string>',
page: '<string>',
unit: '<string>',
launch: true
})
};
fetch('https://api.meetdarwin.ai/v1/experiments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.meetdarwin.ai/v1/experiments"
payload = {
"name": "<string>",
"openings": [
{
"headline": "<string>",
"buttons": [
{
"label": "<string>",
"message": "<string>"
}
],
"name": "<string>",
"hypothesis": "<string>"
}
],
"hypothesis": "<string>",
"page": "<string>",
"unit": "<string>",
"launch": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "exp_4c1f0a2b9d3e7a10",
"object": "experiment",
"name": "<string>",
"status": "<string>",
"internal_status": "<string>",
"unit": "<string>",
"pages": [
"<string>"
],
"metric": "<string>",
"hypothesis": "<string>",
"winner": "<string>",
"verdict": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"applied_at": "2023-11-07T05:31:56Z",
"variants": [
{
"id": "<string>",
"object": "variant",
"name": "<string>",
"control": true,
"headline": "<string>",
"buttons": [
{
"label": "<string>",
"message": "<string>",
"locked": true
}
],
"angle": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"results": {
"views": 123,
"stages": {},
"rate": 123,
"rate_low": 123,
"rate_high": 123,
"chance_beats_current": 123,
"lift": 123,
"computed_at": "2023-11-07T05:31:56Z"
}
}
],
"result": "<unknown>",
"live": {
"computed_at": "2023-11-07T05:31:56Z",
"current": true,
"reason": "<string>",
"estimate": "<string>",
"views_per_day": 123,
"winner_needs": {
"views": 123,
"current_views": 123,
"successes": 123,
"chance_to_beat": 123
},
"metric": "<string>",
"openings": [
{
"id": "<string>",
"name": "<string>",
"control": true,
"views": 123,
"conversations": 123,
"reached_booking": 123,
"meetings": 123,
"successes": 123,
"rate": 123,
"chance_best": 123,
"chance_beats_current": 123,
"lift": 123,
"comparable": true,
"evidence_note": "<string>",
"share": 123,
"worse_at": [
"<string>"
]
}
]
}
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>",
"required_plan": "growth",
"feature": "fit_rules",
"upgrade_url": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>",
"required_plan": "growth",
"feature": "fit_rules",
"upgrade_url": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>",
"required_plan": "growth",
"feature": "fit_rules",
"upgrade_url": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>",
"required_plan": "growth",
"feature": "fit_rules",
"upgrade_url": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>",
"required_plan": "growth",
"feature": "fit_rules",
"upgrade_url": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>",
"required_plan": "growth",
"feature": "fit_rules",
"upgrade_url": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>",
"required_plan": "growth",
"feature": "fit_rules",
"upgrade_url": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>",
"required_plan": "growth",
"feature": "fit_rules",
"upgrade_url": "<string>"
}Start a test with your own openings
Requires the experiments:write scope.
Test one page (page) or a unit: site, a page type or a page group. Darwin adds the opening the page shows now as the current one, so your openings are compared with what visitors see today. One test per page or unit at a time. Starts at once unless launch is false.
curl --request POST \
--url https://api.meetdarwin.ai/v1/experiments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"openings": [
{
"headline": "<string>",
"buttons": [
{
"label": "<string>",
"message": "<string>"
}
],
"name": "<string>",
"hypothesis": "<string>"
}
],
"hypothesis": "<string>",
"page": "<string>",
"unit": "<string>",
"launch": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
openings: [
{
headline: '<string>',
buttons: [{label: '<string>', message: '<string>'}],
name: '<string>',
hypothesis: '<string>'
}
],
hypothesis: '<string>',
page: '<string>',
unit: '<string>',
launch: true
})
};
fetch('https://api.meetdarwin.ai/v1/experiments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.meetdarwin.ai/v1/experiments"
payload = {
"name": "<string>",
"openings": [
{
"headline": "<string>",
"buttons": [
{
"label": "<string>",
"message": "<string>"
}
],
"name": "<string>",
"hypothesis": "<string>"
}
],
"hypothesis": "<string>",
"page": "<string>",
"unit": "<string>",
"launch": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "exp_4c1f0a2b9d3e7a10",
"object": "experiment",
"name": "<string>",
"status": "<string>",
"internal_status": "<string>",
"unit": "<string>",
"pages": [
"<string>"
],
"metric": "<string>",
"hypothesis": "<string>",
"winner": "<string>",
"verdict": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"applied_at": "2023-11-07T05:31:56Z",
"variants": [
{
"id": "<string>",
"object": "variant",
"name": "<string>",
"control": true,
"headline": "<string>",
"buttons": [
{
"label": "<string>",
"message": "<string>",
"locked": true
}
],
"angle": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"results": {
"views": 123,
"stages": {},
"rate": 123,
"rate_low": 123,
"rate_high": 123,
"chance_beats_current": 123,
"lift": 123,
"computed_at": "2023-11-07T05:31:56Z"
}
}
],
"result": "<unknown>",
"live": {
"computed_at": "2023-11-07T05:31:56Z",
"current": true,
"reason": "<string>",
"estimate": "<string>",
"views_per_day": 123,
"winner_needs": {
"views": 123,
"current_views": 123,
"successes": 123,
"chance_to_beat": 123
},
"metric": "<string>",
"openings": [
{
"id": "<string>",
"name": "<string>",
"control": true,
"views": 123,
"conversations": 123,
"reached_booking": 123,
"meetings": 123,
"successes": 123,
"rate": 123,
"chance_best": 123,
"chance_beats_current": 123,
"lift": 123,
"comparable": true,
"evidence_note": "<string>",
"share": 123,
"worse_at": [
"<string>"
]
}
]
}
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>",
"required_plan": "growth",
"feature": "fit_rules",
"upgrade_url": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>",
"required_plan": "growth",
"feature": "fit_rules",
"upgrade_url": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>",
"required_plan": "growth",
"feature": "fit_rules",
"upgrade_url": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>",
"required_plan": "growth",
"feature": "fit_rules",
"upgrade_url": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>",
"required_plan": "growth",
"feature": "fit_rules",
"upgrade_url": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>",
"required_plan": "growth",
"feature": "fit_rules",
"upgrade_url": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>",
"required_plan": "growth",
"feature": "fit_rules",
"upgrade_url": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>",
"required_plan": "growth",
"feature": "fit_rules",
"upgrade_url": "<string>"
}Authorizations
A secret key (dk_live_…). Scopes: conversations:read, contacts:read, contacts:write, meetings:read, analytics:read, events:read, webhooks:write, knowledge:read, knowledge:write, agent:read, agent:write, experiments:read, experiments:write, privacy:write, chat:write.
Headers
Retry safely: the first response is replayed for 24 hours (not for streamed answers).
255Body
What your team calls the test.
1 - 1201 to 4 new openings. Each is tested against the opening the page shows now, which Darwin adds as the current one.
1 - 4 elementsShow child attributes
Show child attributes
Why the new openings should do better.
500One page to test: a path such as /pricing, or an address on your website.
1 - 500Instead of page: "site" for every page on the site's opening, "type:<home|pricing|comparison|integration|product|guide|proof|developer|company|other>" for a page type, or "group:" for a page group.
^(site|type:(home|pricing|comparison|integration|product|guide|proof|developer|company|other)|group:[a-f0-9-]{36})$Default true: start showing the openings at once. false saves the test as a draft.
Response
OK
^exp_"exp_4c1f0a2b9d3e7a10"
"experiment"draft, ready, running, winner_found, applied, stopped, paused, failed or invalidated.
What the test covers: page:, type:, group: or site.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$Show child attributes
Show child attributes
On GET /experiments/{id}: the results worked out now, as the Experiments screen shows them. Reading it saves nothing.
Show child attributes
Show child attributes