Experiments
Update experiment
PATCH
/
v2
/
agents
/
{uuid}
/
experiments
/
{experiment_id}
Update experiment
curl --request PATCH \
--url https://api.sempera.org/v2/agents/{uuid}/experiments/{experiment_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"traffic_percentage": 50,
"variant_percent": 50
}
'import requests
url = "https://api.sempera.org/v2/agents/{uuid}/experiments/{experiment_id}"
payload = {
"name": "<string>",
"traffic_percentage": 50,
"variant_percent": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', traffic_percentage: 50, variant_percent: 50})
};
fetch('https://api.sempera.org/v2/agents/{uuid}/experiments/{experiment_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"experiment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "<string>",
"client": "<string>",
"name": "<string>",
"status": "draft",
"variant_version_id": "<string>",
"variant_percent": 50,
"traffic_percentage": 50,
"control_version_id": "<string>",
"baseline_current_version_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"stopped_at": "2023-11-07T05:31:56Z",
"served_on": [
"<string>"
],
"not_served": [
"<string>"
]
}
},
"errors": null
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}Authorizations
A workspace API key, sent as Authorization: Bearer sempera_sk_... Each operation names the one scope it needs. Scopes, key kinds and roles are in the Authentication guide.
Body
application/json
⌘I
Update experiment
curl --request PATCH \
--url https://api.sempera.org/v2/agents/{uuid}/experiments/{experiment_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"traffic_percentage": 50,
"variant_percent": 50
}
'import requests
url = "https://api.sempera.org/v2/agents/{uuid}/experiments/{experiment_id}"
payload = {
"name": "<string>",
"traffic_percentage": 50,
"variant_percent": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', traffic_percentage: 50, variant_percent: 50})
};
fetch('https://api.sempera.org/v2/agents/{uuid}/experiments/{experiment_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"experiment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "<string>",
"client": "<string>",
"name": "<string>",
"status": "draft",
"variant_version_id": "<string>",
"variant_percent": 50,
"traffic_percentage": 50,
"control_version_id": "<string>",
"baseline_current_version_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"stopped_at": "2023-11-07T05:31:56Z",
"served_on": [
"<string>"
],
"not_served": [
"<string>"
]
}
},
"errors": null
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}{
"error": {
"code": "AGENT_ENV_UNPINNED",
"message": "<string>",
"request_id": "<string>",
"field": "<string>",
"scope": "<string>",
"reason": "<string>"
}
}