---
title: Get analysis data of a Smart Campaign
slug: campaign/api/get-analysis-data-of-a-smart-campaign
docTags: 
createdAt: 2026-09-02T15:04:15.718Z
---

{
  "id": "Ii4GHcPs4RUDQfSxAuQnc",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.campaign.episerver.net/rest/{clientId}/smartcampaigns/{campaignId}/analysis",
    "servers": [
      {
        "url": "https://api.campaign.episerver.net/rest/{clientId}/smartcampaigns/{campaignId}/analysis"
      }
    ],
    "name": "Get analysis data of a Smart Campaign",
    "description": "<p>Get detailed analysis data of a Smart Campaign, such as start date of the analysis, current state of the analysis or the number of mailing recipients.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "clientId",
          "type": "integer<int64>",
          "description": "Client ID",
          "format": "int64"
        },
        {
          "kind": "required",
          "name": "campaignId",
          "type": "integer<int64>",
          "description": "Smart Campaign ID",
          "format": "int64"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json",
            "application/vnd.optivo.broadmail.v1+json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "Authorization",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "The analysis data was retrieved successfully.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "RestAnalysisData",
            "schema": [
              {
                "name": "count",
                "kind": "optional",
                "type": "integer<int32>",
                "description": "Number of recipients that can receive the mailing",
                "format": "int32"
              },
              {
                "name": "analysisDate",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "Start date of the analysis",
                "format": "date-time"
              },
              {
                "name": "state",
                "kind": "optional",
                "type": "string<running | finished | failed>",
                "description": "Current state of the analysis",
                "enum": [
                  "running",
                  "finished",
                  "failed"
                ]
              },
              {
                "name": "childMailings",
                "kind": "optional",
                "type": "map",
                "description": "Number of recipients of the child mailings",
                "example": "",
                "customType": "map<string, integer>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/RestAnalysisData",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "409",
        "description": "The analysis data could not be retrieved because the analysis is not finished or was not started.",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "c-gCQdAUVAfEMmyphig_h",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.campaign.episerver.net/rest/{clientId}/smartcampaigns/{campaignId}/analysis \\\n     --header 'accept: application/json'"
        },
        {
          "id": "bw_o9jo2vcx0yDOi-mAyV",
          "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(\"https://api.campaign.episerver.net/rest/{clientId}/smartcampaigns/{campaignId}/analysis\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "wsESH_wgAybI1AJGxHjzb",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.campaign.episerver.net/rest/{clientId}/smartcampaigns/{campaignId}/analysis\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "FuCvP8-C-tdgQRjmZLu28",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.campaign.episerver.net/rest/{clientId}/smartcampaigns/{campaignId}/analysis\"\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": "c-gCQdAUVAfEMmyphig_h"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// The analysis data was retrieved successfully.\n{\n  \"count\": \"\",\n  \"analysisDate\": \"\",\n  \"state\": \"\",\n  \"childMailings\": \"\"\n}"
        },
        {
          "id": "response-1-409",
          "language": "409",
          "code": "// The analysis data could not be retrieved because the analysis is not finished or was not started.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}