WingifyGuides

Update a campaign

Request URI for Sub Account

PATCH /accounts/40505/campaigns/15

{`

`}

Request Format

{
  "campaigns" : {
     "name" : "New name"
  }
}

Update a campaign

🚧 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.

#For FullStack campaigns

You can update the projects as follows:

{
     "campaigns": {
          "projects": [{
               "id": 66,
               "environments": [{
                         "id": 1
                    },
                    {
                         "id": 2
                    }
               ]
          }]
     }
}

#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/{campaign_id}": {
      "patch": {
        "summary": "Update a campaign",
        "description": "",
        "operationId": "update-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"
            }
          },
          {
            "name": "campaign_id",
            "in": "path",
            "description": "Campaign Id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"_data\": {\n    \"id\": 15,\n    \"name\": \"New name\",\n    \"type\": \"ab\",\n    \"status\": \"NOT_STARTED\",\n    \"createdOn\": 1472631589,\n    \"labels\": [],\n    \"percentTraffic\": 100,\n    \"createdBy\": {\n      \"id\": 40505,\n      \"name\": \"Sample\",\n      \"imageUrl\": \"*****\"\n    },\n    \"urls\": [\n      {\n        \"type\": \"url\",\n        \"value\": \"http://wingify.com\"\n      }\n    ],\n    \"excludedUrls\": [],\n    \"primaryUrl\": \"http://wingify.com\",\n    \"integrations\": {\n      \"ga\": {\n        \"enabled\": false,\n        \"slot\": 4,\n        \"prefix\": \"\"\n      },\n      \"clicktale\": {\n        \"enabled\": false\n      },\n      \"ua\": {\n        \"enabled\": false,\n        \"dimension\": 1,\n        \"prefix\": \"\"\n      },\n      \"gtm\": {\n        \"enabled\": false\n      }\n    },\n    \"thresholds\": {\n      \"winningPercent\": 0.95,\n      \"losingPercent\": 0.05,\n      \"visitors\": 20\n    },\n    \"device\": \"desktop\",\n    \"variations\": [\n      {\n        \"id\": 1,\n        \"name\": \"Control\",\n        \"isControl\": true,\n        \"isDisabled\": false,\n        \"heatmapThumbUrl\": \"<url>\",\n        \"screenshots\": {\n          \"quick\": \"<url>\"\n        },\n        \"percentSplit\": 100,\n        \"editorData\": {\n          \"stack\": null\n        },\n        \"isBase\": true\n      }\n    ],\n    \"goals\": [\n      {\n        \"id\": 1,\n        \"isPrimary\": true,\n        \"name\": \"New goal\",\n        \"excludedUrls\": [],\n        \"isCreatedInEditor\": false,\n        \"type\": \"visitPage\",\n        \"urls\": [\n          {\n            \"type\": \"url\",\n            \"value\": \"http://wingify.com\"\n          }\n        ],\n        \"averageData\": []\n      }\n    ],\n    \"dataIntervalRange\": [],\n    \"variationGoalData\": [],\n    \"schedules\": [],\n    \"stats\": {\n      \"conversionRate\": \"0.05\",\n      \"liftInConversionRate\": \"0.05\",\n      \"certaintyMode\": \"0.01\",\n      \"expectedMonthlyVisitors\": 300000,\n      \"expectedRevenuePerVisitor\": \"2\"\n    }\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "_data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "example": 15,
                          "default": 0
                        },
                        "name": {
                          "type": "string",
                          "example": "New name"
                        },
                        "type": {
                          "type": "string",
                          "example": "ab"
                        },
                        "status": {
                          "type": "string",
                          "example": "NOT_STARTED"
                        },
                        "createdOn": {
                          "type": "integer",
                          "example": 1472631589,
                          "default": 0
                        },
                        "labels": {
                          "type": "array"
                        },
                        "percentTraffic": {
                          "type": "integer",
                          "example": 100,
                          "default": 0
                        },
                        "createdBy": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "integer",
                              "example": 40505,
                              "default": 0
                            },
                            "name": {
                              "type": "string",
                              "example": "Sample"
                            },
                            "imageUrl": {
                              "type": "string",
                              "example": "*****"
                            }
                          }
                        },
                        "urls": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "example": "url"
                              },
                              "value": {
                                "type": "string",
                                "example": "http://wingify.com"
                              }
                            }
                          }
                        },
                        "excludedUrls": {
                          "type": "array"
                        },
                        "primaryUrl": {
                          "type": "string",
                          "example": "http://wingify.com"
                        },
                        "integrations": {
                          "type": "object",
                          "properties": {
                            "ga": {
                              "type": "object",
                              "properties": {
                                "enabled": {
                                  "type": "boolean",
                                  "example": false,
                                  "default": true
                                },
                                "slot": {
                                  "type": "integer",
                                  "example": 4,
                                  "default": 0
                                },
                                "prefix": {
                                  "type": "string",
                                  "example": ""
                                }
                              }
                            },
                            "clicktale": {
                              "type": "object",
                              "properties": {
                                "enabled": {
                                  "type": "boolean",
                                  "example": false,
                                  "default": true
                                }
                              }
                            },
                            "ua": {
                              "type": "object",
                              "properties": {
                                "enabled": {
                                  "type": "boolean",
                                  "example": false,
                                  "default": true
                                },
                                "dimension": {
                                  "type": "integer",
                                  "example": 1,
                                  "default": 0
                                },
                                "prefix": {
                                  "type": "string",
                                  "example": ""
                                }
                              }
                            },
                            "gtm": {
                              "type": "object",
                              "properties": {
                                "enabled": {
                                  "type": "boolean",
                                  "example": false,
                                  "default": true
                                }
                              }
                            }
                          }
                        },
                        "thresholds": {
                          "type": "object",
                          "properties": {
                            "winningPercent": {
                              "type": "number",
                              "example": 0.95,
                              "default": 0
                            },
                            "losingPercent": {
                              "type": "number",
                              "example": 0.05,
                              "default": 0
                            },
                            "visitors": {
                              "type": "integer",
                              "example": 20,
                              "default": 0
                            }
                          }
                        },
                        "device": {
                          "type": "string",
                          "example": "desktop"
                        },
                        "variations": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer",
                                "example": 1,
                                "default": 0
                              },
                              "name": {
                                "type": "string",
                                "example": "Control"
                              },
                              "isControl": {
                                "type": "boolean",
                                "example": true,
                                "default": true
                              },
                              "isDisabled": {
                                "type": "boolean",
                                "example": false,
                                "default": true
                              },
                              "heatmapThumbUrl": {
                                "type": "string",
                                "example": "<url>"
                              },
                              "screenshots": {
                                "type": "object",
                                "properties": {
                                  "quick": {
                                    "type": "string",
                                    "example": "<url>"
                                  }
                                }
                              },
                              "percentSplit": {
                                "type": "integer",
                                "example": 100,
                                "default": 0
                              },
                              "editorData": {
                                "type": "object",
                                "properties": {
                                  "stack": {}
                                }
                              },
                              "isBase": {
                                "type": "boolean",
                                "example": true,
                                "default": true
                              }
                            }
                          }
                        },
                        "goals": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer",
                                "example": 1,
                                "default": 0
                              },
                              "isPrimary": {
                                "type": "boolean",
                                "example": true,
                                "default": true
                              },
                              "name": {
                                "type": "string",
                                "example": "New goal"
                              },
                              "excludedUrls": {
                                "type": "array"
                              },
                              "isCreatedInEditor": {
                                "type": "boolean",
                                "example": false,
                                "default": true
                              },
                              "type": {
                                "type": "string",
                                "example": "visitPage"
                              },
                              "urls": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "example": "url"
                                    },
                                    "value": {
                                      "type": "string",
                                      "example": "http://wingify.com"
                                    }
                                  }
                                }
                              },
                              "averageData": {
                                "type": "array"
                              }
                            }
                          }
                        },
                        "dataIntervalRange": {
                          "type": "array"
                        },
                        "variationGoalData": {
                          "type": "array"
                        },
                        "schedules": {
                          "type": "array"
                        },
                        "stats": {
                          "type": "object",
                          "properties": {
                            "conversionRate": {
                              "type": "string",
                              "example": "0.05"
                            },
                            "liftInConversionRate": {
                              "type": "string",
                              "example": "0.05"
                            },
                            "certaintyMode": {
                              "type": "string",
                              "example": "0.01"
                            },
                            "expectedMonthlyVisitors": {
                              "type": "integer",
                              "example": 300000,
                              "default": 0
                            },
                            "expectedRevenuePerVisitor": {
                              "type": "string",
                              "example": "2"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "campaigns": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "default": "New name"
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                },
                "required": [
                  "campaigns"
                ]
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}