PATCH /campaigns/{campaign_id}
Update a campaign's metadata.
Servers
- https://api.optimizely.com/v2
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
campaign_id |
Integer | Yes |
The Campaign ID of the Campaign you want to change |
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
action |
String | No |
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'. Valid values:
|
Request body fields
| Name | Type | Required | Description |
|---|---|---|---|
metrics[] |
Array | No |
An ordered list of metrics to track for the Campaign |
metrics[].aggregator |
String | No |
The aggregation function for the numerator of the metric. 'unique' measures the number of unique visitors/sessions that include the specified Event. 'count' measures the total number of occurrences of Event for the scope (visitor/session). 'sum' is the sum of the 'field' value Valid values:
|
metrics[].field |
String | No |
The field to aggregate for the numerator of the metric. Required when 'aggregator' = 'sum', otherwise omitted Valid values:
|
metrics[].winning_direction |
String | No |
The winning direction of this metric Valid values:
|
metrics[].event_id |
Integer | No |
The ID for the Event to select data from. Omitted for global metrics that are not relative to a specific Event, i.e. "overall revenue" |
metrics[].scope |
String | No |
Specifies how Events should be grouped together. Can also be thought of as the denonimator of the metric. 'session' divides by the number of sessions. "Influenced sessions", or sessions that do not contain a decision Event but carry a decision from a previous session are not included in counts for numerator or denominator. 'visitor' divides by the number of visitors. 'event' divides by the total occurrences (impressions) of the specified Event Valid values:
|
page_ids[] |
Array | No |
A list of Page IDs used in the Campaign. Only |
changes[] |
Array | No |
A list of changes to apply to the Campaign |
changes[].id |
String | No |
The ID of the change |
changes[].selector |
String | No |
CSS selector to determine where changes are applied. Required for changes of type 'custom_css'. |
changes[].name |
String | No |
Name of the change |
changes[].dependencies[] |
Array | No |
A list of dependent change IDs that must happen before this change |
changes[].src |
String | No |
The path to the change payload on the CDN. Only present if 'async' is True. |
changes[].type |
String | Yes |
The type of this change. Valid values:
|
changes[].value |
String | Yes |
The value for the change can be JavaScript or CSS as a string. |
changes[].async |
Boolean | No |
Indicates whether or not to execute the change asyncronously. If true, src will be returned in the response. Otherwise, it will be not included. |
holdback |
Integer | No |
Percentage of visitors to exclude from personalization, measured in basis points. 100 basis points = 1% traffic. For example, a value of 500 would mean that 95% of visitors will see a personalized experience and 5% will see the holdback. |
name |
String | No |
The name of the Campaign |
description |
String | No |
The description or goal for a Campaign |
experiment_priorities[] |
Array | No |
A list of lists of Experiment IDs that indicate the relative priority of how to show those Experiments in the context of the Campaign. Each list inside of the list represents a group of Experiments of equal priority where groups that appear earlier in the list are of higher priority to be shown. |
url_targeting |
Object | No | |
url_targeting.activation_type |
String | No |
How this page is activated. See the full documentation on the Page object. Valid values:
|
url_targeting.key |
String | No |
Unique string identifier for this Page within the Project |
url_targeting.activation_code |
String | No |
Stringified Javascript function that determines when the Page is activated. Only required when activation_type is 'polling' or 'callback'. |
url_targeting.conditions |
String | No |
Conditions to activate the experiment; our knowledge base article on Activation Types is the best guide for how to set up this data. |
url_targeting.page_id |
Integer | No |
The unique identifier of the Page that represents the experiment or campaign's URL Targeting. |
url_targeting.edit_url |
String | Yes |
URL to load in the editor for this page |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.