Get Campaign Report

Overview

The Get Campaign Report API retrieves metrics and metadata for a specific campaign.

  • Supports all campaign types (Push, Email, SMS, In-App, Web, etc.).
  • You must provide the id of the campaign.
  • If the campaign has not completed, the API returns an error indicating its status.

📘

Use Cases

  • Integrate campaign reports into analytics dashboards.
  • Track delivery, click, and conversion metrics.
  • Monitor campaign health and optimize performance.
  • Automate reporting workflows.

Base URL

The sample base URL for the India region:
https://in1.api.clevertap.com/1/targets/result.json

Refer to Region for more details.

Authentication

Authentication is required using the account ID and passcode headers.

Headers

HeaderDescriptionRequiredExample
X-CleverTap-Account-IdYour CleverTap account ID.YesABCD-RSTU-1234
X-CleverTap-PasscodePasscode generated for the account to authenticate API requests.YesXXXXXX
Content-TypeContent type of the request payload. Must be application/json.Yesapplication/json

HTTP Method

POST

Body Parameters

The following table lists the body parameters:

ParameterDescriptionTypeExample ValueRequired
idThe CleverTap campaign ID of the campaign whose report you want. Applies to all campaign types. You can find this ID in the CleverTap Dashboard under each campaign, or via the Get Campaigns API.Integer1457432766Yes

Sample Payload

The following is the sample payload:

{
  "id": 1457432766
}

Example Request

The following is the sample request:

curl -X POST \
"https://in1.api.clevertap.com/1/targets/result.json" \
-H "X-CleverTap-Account-Id: ACCOUNT_ID" \
-H "X-CleverTap-Passcode: PASSCODE" \
-H "Content-Type: application/json" \
-d '{
  "id": 1457432766
}'
require 'net/http'
require 'json'
require 'uri'

uri = URI("https://in1.api.clevertap.com/1/targets/result.json")
request = Net::HTTP::Post.new(uri)
request["X-CleverTap-Account-Id"] = "ACCOUNT_ID"
request["X-CleverTap-Passcode"] = "PASSCODE"
request["Content-Type"] = "application/json"
request.body = { id: 1457432766 }.to_json

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts response.body
import requests

url = "https://in1.api.clevertap.com/1/targets/result.json"
headers = {
    "X-CleverTap-Account-Id": "ACCOUNT_ID",
    "X-CleverTap-Passcode": "PASSCODE",
    "Content-Type": "application/json",
}
payload = { "id": 1457432766 }

response = requests.post(url, headers=headers, json=payload)
if response.status_code == 200:
    print("Report:", response.json())
else:
    print("Error:", response.text)
const axios = require("axios");

const url = "https://in1.api.clevertap.com/1/targets/result.json";
const headers = {
  "X-CleverTap-Account-Id": "ACCOUNT_ID",
  "X-CleverTap-Passcode": "PASSCODE",
  "Content-Type": "application/json",
};
const data = { id: 1457432766 };

axios.post(url, data, { headers })
  .then((res) => console.log("Report:", res.data))
  .catch((err) => console.error("Error:", err.response?.data || err.message));
<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();

$headers = array(
  'X-CleverTap-Account-Id' => 'ACCOUNT_ID',
  'X-CleverTap-Passcode' => 'PASSCODE',
  'Content-Type' => 'application/json'
);

$data = json_encode(array("id" => 1457432766));

$response = Requests::post(
  'https://in1.api.clevertap.com/1/targets/result.json',
  $headers,
  $data
);

echo $response->body;
?>

Example Response

The following are the sample response:

{
  "status": "success",
  "result": {
    "sent": 82,
    "delivered": 80,
    "clicked": 28,
    "bounced": 2,
    "unsubscribed": 1,
    "opened": 40,
    "converted": 5
  },
  "metadata": {
    "campaign_id": 1457432766,
    "campaign_name": "My Campaign",
    "campaign_type": "push",
    "created_at": "2025-03-01T10:00:00Z",
    "completed_at": "2025-03-01T12:00:00Z",
    "last_updated": "2025-03-01T12:05:00Z"
  }
}

Response Parameters

The following are the response parameters:

FieldDescriptionType
sentNumber of messages attempted to be sent.Integer
deliveredNumber of messages successfully delivered.Integer
clickedNumber of users who clicked the message (push, email, SMS with links).Integer
openedNumber of users who opened the message (applies to email).Integer
bouncedNumber of messages that failed due to invalid addresses or delivery issues.Integer
unsubscribedNumber of users who unsubscribed after receiving the message.Integer
convertedNumber of users who completed a conversion event attributed to the campaign.Integer
metadataContains campaign metadata like name, type, and timestamps.Object

📘

Notes

  • Metrics are integers and cannot be negative.
  • Reports are finalized only after campaign completion.
  • For recurring campaigns, reports are available per instance.
  • If no data is available, fields may be omitted or set to null.

Error Codes

The following are the error codes:

HTTP StatusError CodeDescriptionExample JSON Payload
200successRequest successful and metrics returned.{"status":"success","result":{"sent":82}}
400invalid_payloadMalformed request body or missing id.{"status":"fail","error":"Missing campaign id","code":400}
400invalid_id_formatThe campaign ID is not a valid integer.{"status":"fail","error":"Invalid campaign id format","code":400}
401unauthorizedAuthentication failed due to missing/invalid credentials.{"status":"fail","error":"Invalid Credentials","code":401}
403forbiddenThe account does not have permission to use this API.{"status":"fail","error":"Forbidden","code":403}
404report_not_foundCampaign ID does not exist or no report available.{"status":"fail","error":"Report not found","code":404}
409campaign_not_completedThe campaign has not completed, so report cannot be generated.{"status":"fail","error":"This target hasn't been completed""code":404}
429rate_limit_exceededToo many requests made in a short time. Limit: 60 requests/min per campaign. For more information, refer to API Request Limit.{"status":"fail","error":"Rate limit exceeded","code":429}
500internal_errorUnexpected error occurred on the server.{"status":"fail","error":"Internal server error","code":500}

Limitations

  • Only one campaign ID can be requested per call.
  • Bulk report retrieval is not supported.
  • Recommended polling interval: once every 1–5 minutes per campaign.
  • Reports are updated in near real-time but finalized only after completion.

//kapa search bot