Create a Campaign
1 min
POST
https://api.optimizely.com/v2/campaigns
actionstring<p>Action to change the state of the Campaign. 'publish' publishes your campaign, making any changes live to the world. Status will be 'paused'. 'start' publishes your campaign, making any changes live to the world. Status will be 'running'.</p>
acceptstringGenerated from available response content types
bodyobjectA string in JSON format that includes all the fields to create a Project
201Return the created Campaign
defaultUnexpected error
curl --request POST \
--url https://api.optimizely.com/v2/campaigns \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"changes": [
{
"type": "",
"value": "window.someGlobalFunction();"
}
],
"metrics": [
{
"metrics": [
{
"aggregator": "unique",
"scope": "visitor"
}
]
}
],
"project_id": 1000,
"type": "personalization",
"url_targeting": {
"edit_url": "https://www.optimizely.com"
}
}'