---
title: Get a single campaign
slug: get-a-single-campaign
docTags: 
createdAt: 2026-05-04T13:13:49.254Z
---

{
  "id": "t19GrSJHzQqQG4wt1yFKN",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "/v1/campaigns/{id}",
    "servers": [],
    "name": "Get a single campaign",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "description": "",
          "pattern": "\\d+"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "websiteId",
          "type": "string",
          "description": "",
          "default": null,
          "pattern": "\\d+"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "bearer",
          "name": "bearer",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Returned when successful",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "CampaignDetail",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "integer",
                "description": ""
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "",
                "minLength": 1,
                "maxLength": 255
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "",
                "maxLength": 2048
              },
              {
                "name": "type",
                "kind": "optional",
                "type": "string",
                "description": "",
                "default": "personalization"
              },
              {
                "name": "goalsReached",
                "kind": "optional",
                "type": "integer",
                "description": "",
                "default": 0
              },
              {
                "name": "views",
                "kind": "optional",
                "type": "integer",
                "description": "",
                "default": 0
              },
              {
                "name": "value",
                "kind": "optional",
                "type": "integer",
                "description": "",
                "default": 0
              },
              {
                "name": "createDate",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "",
                "format": "date-time"
              },
              {
                "name": "updateDate",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "",
                "format": "date-time"
              },
              {
                "name": "startDate",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "",
                "format": "date-time"
              },
              {
                "name": "endDate",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "",
                "format": "date-time"
              },
              {
                "name": "active",
                "kind": "optional",
                "type": "boolean",
                "description": "",
                "default": false
              },
              {
                "name": "controlShare",
                "kind": "optional",
                "type": "integer",
                "description": "",
                "default": 5,
                "minimum": 0,
                "maximum": 100
              },
              {
                "name": "trafficAllocation",
                "kind": "optional",
                "type": "integer",
                "description": "",
                "default": 10,
                "minimum": 0,
                "maximum": 100
              },
              {
                "name": "targetId",
                "kind": "optional",
                "type": "integer",
                "description": ""
              },
              {
                "name": "targetMode",
                "kind": "optional",
                "type": "string",
                "description": "",
                "default": "live"
              },
              {
                "name": "variations",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/CampaignVariation",
                "customType": "CampaignVariation[]",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer",
                    "description": ""
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "share",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "minimum": 0,
                    "maximum": 100
                  },
                  {
                    "name": "targetId",
                    "kind": "optional",
                    "type": "integer",
                    "description": ""
                  },
                  {
                    "name": "order",
                    "kind": "optional",
                    "type": "integer",
                    "description": ""
                  }
                ]
              },
              {
                "name": "primaryGoalId",
                "kind": "optional",
                "type": "integer",
                "description": ""
              },
              {
                "name": "significanceLevel",
                "kind": "optional",
                "type": "integer",
                "description": "",
                "default": 90,
                "enum": [
                  "80",
                  "90",
                  "95",
                  "100"
                ]
              },
              {
                "name": "methodology",
                "kind": "optional",
                "type": "string<bayesian | frequentist>",
                "description": "",
                "default": "frequentist",
                "enum": [
                  "bayesian",
                  "frequentist"
                ]
              },
              {
                "name": "power",
                "kind": "optional",
                "type": "integer",
                "description": "",
                "default": 80,
                "minimum": 60,
                "maximum": 99
              },
              {
                "name": "mde",
                "kind": "optional",
                "type": "number<float>",
                "description": "",
                "default": 20,
                "format": "float",
                "minimum": 1,
                "maximum": 100
              }
            ],
            "modelRef": "#/components/schemas/CampaignDetail",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Campaign not found",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "ZgJhCDL3mhwiu-mk50Swj",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url '/v1/campaigns/{id}?websiteId=string' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "46FuPwsZejjFVpP4gQpIH",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"/v1/campaigns/{id}?websiteId=string\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "XjaYy_luFatgNK7fR_X9y",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"/v1/campaigns/{id}?websiteId=string\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "vxrdOUFl_i55ktegcVtV1",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"/v1/campaigns/{id}?websiteId=string\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "ZgJhCDL3mhwiu-mk50Swj"
    },
    "results": {
      "languages": [
        {
          "id": "QVGFuqIKHhuParuExH63u",
          "language": "200",
          "code": "// Returned when successful\n{\n  \"id\": 0,\n  \"name\": \"\",\n  \"description\": \"\",\n  \"type\": \"\",\n  \"goalsReached\": 0,\n  \"views\": 0,\n  \"value\": 0,\n  \"createDate\": \"\",\n  \"updateDate\": \"\",\n  \"startDate\": \"\",\n  \"endDate\": \"\",\n  \"active\": false,\n  \"controlShare\": 0,\n  \"trafficAllocation\": 0,\n  \"targetId\": 0,\n  \"targetMode\": \"\",\n  \"variations\": [\n    {\n      \"id\": 0,\n      \"name\": \"\",\n      \"share\": 0,\n      \"targetId\": 0,\n      \"order\": 0\n    }\n  ],\n  \"primaryGoalId\": 0,\n  \"significanceLevel\": 0,\n  \"methodology\": \"\",\n  \"power\": 0,\n  \"mde\": \"\"\n}"
        },
        {
          "id": "qt5jucsEsPQIXcONMk9Zc",
          "language": "404",
          "code": "// Campaign not found\n"
        }
      ],
      "selectedLanguageId": "QVGFuqIKHhuParuExH63u"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}