Create a campaign
Request URI for Sub Account
POST /accounts/40505/campaigns
`}
Request Format
{
"type": "ab",
"urls": [
{
"type": "url",
"value": "http://wingify.com"
}
],
"primaryUrl": "http://wingify.com",
"goals": [
{
"name": "New goal",
"type": "visitPage",
"urls": [
{
"type": "url",
"value": "http://wingify.com"
}
]
}
]
}
Create a campaign
🚧 Warning
Note:
If stats are not provided, default value for stats (same as given in this request) are used for the campaign created.
🚧 Warning
Note:
For split campaign creation, two or more variations must be present in the request with urls for which the split campaign needs to be run.
🚧 Warning
Note:
The "globalCode" section allows you to add Pre/Post-Campaign JS/CSS snippets within the editor. This globalCode block is optional and can be omitted if not needed.
#OpenAPI definition
{
"openapi": "3.1.0",
"info": {
"title": "api",
"version": "4"
},
"servers": [
{
"url": "https://app.wingify.com/api/v2"
}
],
"components": {
"securitySchemes": {
"sec0": {
"type": "apiKey",
"in": "header",
"name": "token"
}
}
},
"security": [
{
"sec0": []
}
],
"paths": {
"/accounts/{account_id}/campaigns": {
"post": {
"summary": "Create a campaign",
"description": "",
"operationId": "create-a-campaign",
"parameters": [
{
"name": "account_id",
"in": "path",
"description": "Use 'current' keyword to refer to the Main Workspace or the Integer Workspace Id",
"required": true,
"schema": {
"type": "string",
"default": "current"
}
}
],
"responses": {
"201": {
"description": "201",
"content": {
"application/json": {
"examples": {
"Result": {
"value": "{\n \"_data\": {\n \"id\": 15,\n \"status\": \"NOT_STARTED\",\n \"goals\": [\n {\n \"id\": 1,\n \"name\": \"New goal\"\n }\n ]\n }\n}"
}
},
"schema": {
"type": "object",
"properties": {
"_data": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 15,
"default": 0
},
"status": {
"type": "string",
"example": "NOT_STARTED"
},
"goals": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 1,
"default": 0
},
"name": {
"type": "string",
"example": "New goal"
}
}
}
}
}
}
}
}
}
}
}
},
"deprecated": false,
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"type": {
"type": "string",
"default": "ab"
},
"urls": {
"type": "array",
"items": {
"properties": {
"type": {
"type": "string",
"default": "url"
},
"value": {
"type": "string",
"default": "http://wingify.com"
}
},
"type": "object",
"required": [
"type",
"value"
]
}
},
"primaryUrl": {
"type": "string",
"default": "http://wingify.com"
},
"goals": {
"type": "array",
"items": {
"properties": {
"name": {
"type": "string",
"default": "New Goal"
},
"type": {
"type": "string",
"default": "visitPage"
},
"urls": {
"type": "array",
"items": {
"properties": {
"type": {
"type": "string",
"default": "url"
},
"value": {
"type": "string",
"default": "http://wingify.com"
}
},
"type": "object",
"required": [
"type",
"value"
]
}
}
},
"type": "object",
"required": [
"name",
"type",
"urls"
]
}
}
},
"required": [
"primaryUrl",
"goals",
"type",
"urls"
]
},
"examples": {
"Request format": {
"summary": "Request format",
"value": {
"type": "ab",
"urls": [
{
"type": "url",
"value": "http://wingify.com"
}
],
"primaryUrl": "http://wingify.com",
"goals": [
{
"name": "New goal",
"type": "visitPage",
"urls": [
{
"type": "url",
"value": "http://wingify.com"
}
]
}
]
}
}
}
}
}
}
}
}
},
"x-readme": {
"headers": [],
"explorer-enabled": true,
"proxy-enabled": true
},
"x-readme-fauxas": true
}