Campaigns
Manage campaigns
Return the list of the campaigns of the account environment
The ID of the account
The ID of the environment
Index of the page
0
Number of items per page
10
Success
Not Found
GET /v1/accounts/{account_id}/account_environments/{account_environment_id}/campaigns HTTP/1.1
Host: api.flagship.io
Authorization: YOUR_API_KEY
Accept: */*
{
"current_item_count": 1,
"current_page": 0,
"total_count": 1,
"items_per_page": 10,
"last_page": 1,
"items": [
{
"id": "text",
"project_id": "text",
"name": "text",
"slug": "text",
"description": "text",
"type": "ab",
"status": "draft",
"variation_groups": [
{
"id": "text",
"name": "text",
"variations": [
{
"id": "text",
"name": "text",
"reference": true,
"allocation": 1,
"modifications": {
"type": "text",
"value": {}
}
}
],
"targeting": {
"targeting_groups": [
{
"targetings": [
{
"key": "text",
"operator": "EQUALS",
"value": "text"
}
]
}
]
},
"allocation_config": {
"start_date": "2025-09-08T13:14:59.370Z",
"timezone": "text",
"start_allocation": 1,
"periodic_steps": {
"allocation_step": 1,
"step": 1,
"step_type": "day"
},
"custom_steps": [
{
"allocation_step": 1,
"step": 1,
"step_type": "day"
}
],
"rollback_condition": {
"goal": {
"type": "transaction",
"id": "text",
"label": "text",
"operator": "contains",
"value": "text"
},
"operator": "GREATER_THAN",
"value": 1,
"min_visitors": 1
}
}
}
],
"scheduler": {
"start_date": "2025-09-08T13:14:59.370Z",
"stop_date": "2025-09-08T13:14:59.370Z",
"timezone": "text"
},
"created_at": "2025-09-08T13:14:59.370Z",
"updated_at": "2025-09-08T13:14:59.370Z",
"primary_goal": {
"type": "transaction",
"id": "text",
"label": "text",
"operator": "contains",
"value": "text",
"metrics": [
"uniqueConversions"
]
},
"secondary_goals": [
{
"type": "transaction",
"id": "text",
"label": "text",
"operator": "contains",
"value": "text"
},
{
"metrics": [
"uniqueConversions"
]
}
]
}
]
}
Create a campaign
The ID of the account
The ID of the environment
ID of the campaign
ID of the campaign's project
Name of the campaign
Slug of the campaign
Description of the campaign
Type of the campaign
Status of the campaign
Creation date of campaign
Update date of the campaign
Secondary goals of the campaign
Created
Validation errors
POST /v1/accounts/{account_id}/account_environments/{account_environment_id}/campaigns HTTP/1.1
Host: api.flagship.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 1080
{
"project_id": "text",
"name": "text",
"slug": "text",
"description": "text",
"type": "ab",
"variation_groups": [
{
"name": "text",
"variations": [
{
"name": "text",
"reference": true,
"allocation": 1,
"modifications": {
"type": "text",
"value": {}
}
}
],
"targeting": {
"targeting_groups": [
{
"targetings": [
{
"key": "text",
"operator": "EQUALS",
"value": "text"
}
]
}
]
},
"allocation_config": {
"start_date": "2025-09-08T13:14:59.370Z",
"timezone": "text",
"start_allocation": 1,
"periodic_steps": {
"allocation_step": 1,
"step": 1,
"step_type": "day"
},
"custom_steps": [
{
"allocation_step": 1,
"step": 1,
"step_type": "day"
}
],
"rollback_condition": {
"goal": {
"type": "transaction",
"label": "text",
"operator": "contains",
"value": "text"
},
"operator": "GREATER_THAN",
"value": 1,
"min_visitors": 1
}
}
}
],
"scheduler": {
"start_date": "2025-09-08T13:14:59.370Z",
"stop_date": "2025-09-08T13:14:59.370Z",
"timezone": "text"
},
"primary_goal": {
"type": "transaction",
"label": "text",
"operator": "contains",
"value": "text",
"metrics": [
"uniqueConversions"
]
},
"secondary_goals": [
{
"type": "transaction",
"label": "text",
"operator": "contains",
"value": "text"
},
{
"metrics": [
"uniqueConversions"
]
}
]
}
{
"id": "text",
"project_id": "text",
"name": "text",
"slug": "text",
"description": "text",
"type": "ab",
"status": "draft",
"variation_groups": [
{
"id": "text",
"name": "text",
"variations": [
{
"id": "text",
"name": "text",
"reference": true,
"allocation": 1,
"modifications": {
"type": "text",
"value": {}
}
}
],
"targeting": {
"targeting_groups": [
{
"targetings": [
{
"key": "text",
"operator": "EQUALS",
"value": "text"
}
]
}
]
},
"allocation_config": {
"start_date": "2025-09-08T13:14:59.370Z",
"timezone": "text",
"start_allocation": 1,
"periodic_steps": {
"allocation_step": 1,
"step": 1,
"step_type": "day"
},
"custom_steps": [
{
"allocation_step": 1,
"step": 1,
"step_type": "day"
}
],
"rollback_condition": {
"goal": {
"type": "transaction",
"id": "text",
"label": "text",
"operator": "contains",
"value": "text"
},
"operator": "GREATER_THAN",
"value": 1,
"min_visitors": 1
}
}
}
],
"scheduler": {
"start_date": "2025-09-08T13:14:59.370Z",
"stop_date": "2025-09-08T13:14:59.370Z",
"timezone": "text"
},
"created_at": "2025-09-08T13:14:59.370Z",
"updated_at": "2025-09-08T13:14:59.370Z",
"primary_goal": {
"type": "transaction",
"id": "text",
"label": "text",
"operator": "contains",
"value": "text",
"metrics": [
"uniqueConversions"
]
},
"secondary_goals": [
{
"type": "transaction",
"id": "text",
"label": "text",
"operator": "contains",
"value": "text"
},
{
"metrics": [
"uniqueConversions"
]
}
]
}
Return one campaign by its id
The ID of the account
The ID of the environment
The ID of the campaign
Success
Not Found
GET /v1/accounts/{account_id}/account_environments/{account_environment_id}/campaigns/{campaign_id} HTTP/1.1
Host: api.flagship.io
Authorization: YOUR_API_KEY
Accept: */*
{
"id": "text",
"project_id": "text",
"name": "text",
"slug": "text",
"description": "text",
"type": "ab",
"status": "draft",
"variation_groups": [
{
"id": "text",
"name": "text",
"variations": [
{
"id": "text",
"name": "text",
"reference": true,
"allocation": 1,
"modifications": {
"type": "text",
"value": {}
}
}
],
"targeting": {
"targeting_groups": [
{
"targetings": [
{
"key": "text",
"operator": "EQUALS",
"value": "text"
}
]
}
]
},
"allocation_config": {
"start_date": "2025-09-08T13:14:59.370Z",
"timezone": "text",
"start_allocation": 1,
"periodic_steps": {
"allocation_step": 1,
"step": 1,
"step_type": "day"
},
"custom_steps": [
{
"allocation_step": 1,
"step": 1,
"step_type": "day"
}
],
"rollback_condition": {
"goal": {
"type": "transaction",
"id": "text",
"label": "text",
"operator": "contains",
"value": "text"
},
"operator": "GREATER_THAN",
"value": 1,
"min_visitors": 1
}
}
}
],
"scheduler": {
"start_date": "2025-09-08T13:14:59.370Z",
"stop_date": "2025-09-08T13:14:59.370Z",
"timezone": "text"
},
"created_at": "2025-09-08T13:14:59.370Z",
"updated_at": "2025-09-08T13:14:59.370Z",
"primary_goal": {
"type": "transaction",
"id": "text",
"label": "text",
"operator": "contains",
"value": "text",
"metrics": [
"uniqueConversions"
]
},
"secondary_goals": [
{
"type": "transaction",
"id": "text",
"label": "text",
"operator": "contains",
"value": "text"
},
{
"metrics": [
"uniqueConversions"
]
}
]
}
Delete a campaign by its id.
The ID of the account
The ID of the environment
The ID of the campaign
Deleted
No content
Not Found
DELETE /v1/accounts/{account_id}/account_environments/{account_environment_id}/campaigns/{campaign_id} HTTP/1.1
Host: api.flagship.io
Authorization: YOUR_API_KEY
Accept: */*
No content
Update campaign informations - You can set only the properies you want to update in the request body.
The ID of the account
The ID of the environment
The ID of the campaign
ID of the campaign
ID of the campaign's project
Name of the campaign
Slug of the campaign
Description of the campaign
Type of the campaign
Status of the campaign
Creation date of campaign
Update date of the campaign
Secondary goals of the campaign
Updated
Validation errors
PATCH /v1/accounts/{account_id}/account_environments/{account_environment_id}/campaigns/{campaign_id} HTTP/1.1
Host: api.flagship.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 1080
{
"project_id": "text",
"name": "text",
"slug": "text",
"description": "text",
"type": "ab",
"variation_groups": [
{
"name": "text",
"variations": [
{
"name": "text",
"reference": true,
"allocation": 1,
"modifications": {
"type": "text",
"value": {}
}
}
],
"targeting": {
"targeting_groups": [
{
"targetings": [
{
"key": "text",
"operator": "EQUALS",
"value": "text"
}
]
}
]
},
"allocation_config": {
"start_date": "2025-09-08T13:14:59.370Z",
"timezone": "text",
"start_allocation": 1,
"periodic_steps": {
"allocation_step": 1,
"step": 1,
"step_type": "day"
},
"custom_steps": [
{
"allocation_step": 1,
"step": 1,
"step_type": "day"
}
],
"rollback_condition": {
"goal": {
"type": "transaction",
"label": "text",
"operator": "contains",
"value": "text"
},
"operator": "GREATER_THAN",
"value": 1,
"min_visitors": 1
}
}
}
],
"scheduler": {
"start_date": "2025-09-08T13:14:59.370Z",
"stop_date": "2025-09-08T13:14:59.370Z",
"timezone": "text"
},
"primary_goal": {
"type": "transaction",
"label": "text",
"operator": "contains",
"value": "text",
"metrics": [
"uniqueConversions"
]
},
"secondary_goals": [
{
"type": "transaction",
"label": "text",
"operator": "contains",
"value": "text"
},
{
"metrics": [
"uniqueConversions"
]
}
]
}
{
"id": "text",
"project_id": "text",
"name": "text",
"slug": "text",
"description": "text",
"type": "ab",
"status": "draft",
"variation_groups": [
{
"id": "text",
"name": "text",
"variations": [
{
"id": "text",
"name": "text",
"reference": true,
"allocation": 1,
"modifications": {
"type": "text",
"value": {}
}
}
],
"targeting": {
"targeting_groups": [
{
"targetings": [
{
"key": "text",
"operator": "EQUALS",
"value": "text"
}
]
}
]
},
"allocation_config": {
"start_date": "2025-09-08T13:14:59.370Z",
"timezone": "text",
"start_allocation": 1,
"periodic_steps": {
"allocation_step": 1,
"step": 1,
"step_type": "day"
},
"custom_steps": [
{
"allocation_step": 1,
"step": 1,
"step_type": "day"
}
],
"rollback_condition": {
"goal": {
"type": "transaction",
"id": "text",
"label": "text",
"operator": "contains",
"value": "text"
},
"operator": "GREATER_THAN",
"value": 1,
"min_visitors": 1
}
}
}
],
"scheduler": {
"start_date": "2025-09-08T13:14:59.370Z",
"stop_date": "2025-09-08T13:14:59.370Z",
"timezone": "text"
},
"created_at": "2025-09-08T13:14:59.370Z",
"updated_at": "2025-09-08T13:14:59.370Z",
"primary_goal": {
"type": "transaction",
"id": "text",
"label": "text",
"operator": "contains",
"value": "text",
"metrics": [
"uniqueConversions"
]
},
"secondary_goals": [
{
"type": "transaction",
"id": "text",
"label": "text",
"operator": "contains",
"value": "text"
},
{
"metrics": [
"uniqueConversions"
]
}
]
}
Switch the state of the campaign to active/inactive.
The ID of the account
The ID of the environment
The ID of the campaign
State of the toggler
Updated
No content
Not Found
PATCH /v1/accounts/{account_id}/account_environments/{account_environment_id}/campaigns/{campaign_id}/toggle HTTP/1.1
Host: api.flagship.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 17
{
"state": "draft"
}
No content
Was this helpful?