Create Experiment
Create a new experiment.
/api/v1/experiments/Authentication
Syllable-API-KeyrequiredSend Syllable-API-Key in the header.
Need a credential? Create or manage an API token in the Syllable Console.
Parameters
This endpoint has no declared parameters.
Request body
application/json
body
ExperimentCreateRequest
required
4 fields
namestringrequiredThe name of the experiment
descriptionstring | nulloptionalThe hypothesis under test
variantsDaoExperimentVariantWrite[]optionalThe variants of the experiment, as a complete set. Two or more, each on a different agent, exactly one of them the control.
Item schema
itemsDaoExperimentVariantWriterequiredOne variant of an experiment as it is written.
Variants are always written as a complete set, because a weight only means anything next to the other weights, so there is no model for writing one on its own. The fields are checked by ExperimentsDao._validate_variants and not by the model, so that every rule about a variant reads in one place.
4 fields
namestringrequiredThe name of the variant, unique within the experiment
weightintegerrequiredThe relative weight of the variant, not a percentage. (E.g., if two variants both have a weight of 10, they are equally likely to be selected.)
is_controlbooleanoptionalWhether this is the reference variant the others are measured against
falseagent_idintegerrequiredThe agent this variant runs
target_idintegerrequiredThe channel target being split
Request example
{
"name": "string",
"description": "string",
"variants": [
{
"name": "string",
"weight": 0,
"is_control": false,
"agent_id": 0
}
],
"target_id": 0
}Responses
200Successful Response
application/json
response
ExperimentResponse
required
12 fields
idintegerrequiredThe internal ID of the experiment
namestringrequiredThe name of the experiment
target_idinteger | nullrequiredThe channel target being split, or null if that target has since been deleted. A running experiment always has one.
variantsDaoExperimentVariantDetail[]requiredThe variants of the experiment, in a stable order
Item schema
itemsDaoExperimentVariantDetailrequiredA variant, with the name of the agent it runs resolved for display.
6 fields
idintegerrequiredThe internal ID of the variant
namestringrequiredThe name of the variant, which is the grouping key in reports
weightintegerrequiredThe relative weight of the variant, not a percentage. (E.g., if two variants both have a weight of 10, they are equally likely to be selected.)
is_controlbooleanrequiredWhether this is the reference variant the others are measured against
agent_idintegerrequiredThe agent this variant runs
agent_namestringrequiredThe name of that agent
descriptionstring | nulloptionalThe hypothesis under test
statusenum<string>requireddraft, running, or stopped
["draft","running","stopped"]started_atstring (date-time) | nulloptionalWhen the experiment started
stopped_atstring (date-time) | nulloptionalWhen the experiment stopped
created_atstring (date-time)requiredWhen the experiment was created
updated_atstring (date-time)requiredWhen the experiment was last written
last_updated_bystringrequiredWho last wrote it
targetDaoExperimentTargetSummary | nulloptionalThe channel target being split, resolved for display. Null when the target has since been deleted, and when the read did not load it.
5 options
idintegerrequiredThe internal ID of the channel target
targetstringrequiredThe target itself, such as a phone number
target_modeenum<string>requiredThe mode of the channel target
["voice","chat","sms","email","whatsapp"]channel_idintegerrequiredThe channel the target belongs to
channel_namestringrequiredThe name of that channel
Response example
{
"id": 0,
"name": "string",
"target_id": "string",
"variants": [
{
"id": 0,
"name": "string",
"weight": 0,
"is_control": true,
"agent_id": 0,
"agent_name": "string"
}
],
"description": "string",
"status": "string",
"started_at": "string",
"stopped_at": "string",
"created_at": "string",
"updated_at": "string",
"last_updated_by": "string",
"target": "string"
}No response body is declared.
422Validation Error
application/json
response
HTTPValidationError
required
1 field
detailValidationError[]optionalItem schema
itemsValidationErrorrequired3 fields
locstring | integer[]requiredItem schema
itemsstring | integerrequired2 options
Option 1stringrequiredOption 2integerrequiredmsgstringrequiredtypestringrequiredResponse example
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}
