Update a Campaign
1 min
PATCH
https://api.optimizely.com/v2/campaigns/{campaign_id}
campaign_idinteger<int64>The Campaign ID of the Campaign you want to change
actionstring<p>Action to change the state of the Campaign. 'publish' publishes your campaign, making any changes live to the world without changing the status of the campaign. 'start' publishes your campaign, making any changes live to the world. Status will be 'running'. 'pause' stops the campaign. Status will be 'paused'. No new visitors will see the campaign until it is resumed. 'resume' resumes the campaign from a paused status without publishing any new changes. Status will be 'running'. 'unarchive' unarchives an archived campaign. Status will be 'paused'.</p>
acceptstringGenerated from available response content types
bodyobjectA string in JSON format that includes all the fields you'd like to change for a Campaign
200Return the updated Campaign
400Invalid ID supplied
401Invalid credentials
403You do not have permission to edit the specified Campaign
404Campaign not found
defaultUnexpected error
curl --request PATCH \
--url https://api.optimizely.com/v2/campaigns/{campaign_id} \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"changes": [
{
"type": "",
"value": "window.someGlobalFunction();"
}
],
"metrics": [
{
"metrics": [
{
"aggregator": "unique",
"scope": "visitor"
}
]
}
],
"url_targeting": {
"edit_url": "https://www.optimizely.com"
}
}'