Skip to main content
GET
/
campaign
/
{identifier}
Get campaign by ID
curl --request GET \
  --url https://api.sendx.io/api/v1/rest/campaign/{identifier} \
  --header 'X-Team-ApiKey: <api-key>'
import requests

url = "https://api.sendx.io/api/v1/rest/campaign/{identifier}"

headers = {"X-Team-ApiKey": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'X-Team-ApiKey': '<api-key>'}};

fetch('https://api.sendx.io/api/v1/rest/campaign/{identifier}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sendx.io/api/v1/rest/campaign/{identifier}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Team-ApiKey: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.sendx.io/api/v1/rest/campaign/{identifier}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("X-Team-ApiKey", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.sendx.io/api/v1/rest/campaign/{identifier}")
.header("X-Team-ApiKey", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.sendx.io/api/v1/rest/campaign/{identifier}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Team-ApiKey"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "id": "campaign_LUE9BTxmksSmqHWbh96zsn",
  "name": "Spring Sale Campaign",
  "trackReply": true,
  "status": 1,
  "scheduleType": 0,
  "scheduleCondition": "2024-03-20",
  "timeCondition": "10:00 PM",
  "timezone": "America/New_York",
  "preferredTimeCondition": "10:00 PM",
  "preferredTimezone": "America/New_York",
  "strategy": "Batch Sending",
  "sendInContactsTimezone": true,
  "smartSend": true,
  "isArchived": false,
  "sender": "sender_lN1aAQOmYEUp4LtH5szP3l",
  "campaignScreenshotUrl": "https://cdn.sendx.io/campaigns/spring_sale_preview.png",
  "includedLists": [
    "list_0tOFLp5RgV7s3LNiHrjGYs",
    "list_A1b2C3d4E5f6G7h8I9j0Kl"
  ],
  "includedTags": [
    "tag_6GN4DNyrHNt4KktCNG8PDO"
  ],
  "excludedTags": [
    "tag_Bv4Wq9Xp6Zn5Ly0Kt8JhQe"
  ],
  "subject": "🌸 Spring Sale - Save up to 40%!"
}
📧 Campaign Details Include:
  • Complete campaign configuration
  • Content and design information
  • Targeting and segmentation rules
  • Schedule and timezone settings
🔍 Use Cases:
  • Preview campaign before sending
  • Check campaign status
  • Review targeting settings
  • Access campaign for editing

Authorizations

X-Team-ApiKey
string
header
required

Team API key for authentication. Find your API key in SendX Settings → Team API Key.

Example:

X-Team-ApiKey: your_team_api_key_here

Path Parameters

identifier
string
required

Campaign identifier

  • campaign_IMBoxK2iB5sUdgiNOjqAMA
Pattern: ^(campaign_)?[a-zA-Z0-9]{22}$

Response

✅ Campaign retrieved successfully

name
string
required

Internal campaign name

Example:

"Summer Sale 2024"

subject
string
required

Email subject line

Example:

"🌞 Summer Sale - 50% Off Everything!"

sender
string
required

Sender id

Example:

"sender_4vK3WFhMgvOwUNyaL4QxCD"

scheduleType
integer
default:0
required

Campaign scheduling type.

Values:

  • 0 - Schedule later
  • 1 - Send Now
scheduleCondition
string
required

datetime for scheduled campaigns (required if scheduleType=1)

Example:

"2024-12-30"

timezone
string
required

Campaign timezone

Example:

"America/New_York"

includedLists
string[]
required

Included list IDs with prefix

Pattern: ^list_[a-zA-Z0-9]{22}$
Example:
[
"list_vUCjsUmrVXtSppS8rD0Ssq",
"list_0tOFLp5RgV7s3LNiHrjGYs"
]
excludedLists
string[]
required

Excluded list IDs with prefix

Pattern: ^list_[a-zA-Z0-9]{22}$
Example:
["list_Mn7Op8Qr9St0Uv1Wx2Yz3A"]
id
string

Unique ID for the campaign

Example:

"campaign_6h8DnYrHt4KktCnG8PDO5Z"

preheader
string

Email preview text

Example:

"Limited time offer - Shop now!"

htmlContent
string

HTML email content

textContent
string

Plain text email content

status
integer

Campaign status.

Values:

  • 0 - Draft
  • 1 - Scheduled
  • 2 - Sending
  • 3 - Sent
  • 4 - Quarantined
  • 5 - Evaluating
  • 6 - Evaluation Failed
  • 7 - Warming Up
isArchived
boolean

Whether the campaign is archived

Example:

false

campaignScreenshotUrl
string

URL to the campaign screenshot

Example:

"https://cdn.sendx.io/campaigns/screenshot_abc123.png"

timeCondition
string

Time-related condition for the campaign

Example:

"9:00 AM"

smartSend
boolean

Timezone for the scheduled send

Example:

"America/New_York"

sendInContactsTimezone
boolean

Send at specified time in each contact's timezone

Example:

true

preferredTimeCondition
string

Preferred time condition, in case of smartSend and sendInContactTimeZone

Example:

"10:00 AM"

preferredTimezone
string

Preferred timezone for smart send optimization

Example:

"America/Los_Angeles"

strategy
string

Campaign delivery strategy

Example:

"Batch Sending"

includedSegments
string[]

Included segment IDs

Pattern: ^segment_[a-zA-Z0-9]{22}$
Example:
["segment_engaged_30_days"]
includedTags
string[]

Included tag IDs with prefix

Pattern: ^tag_[a-zA-Z0-9]{22}$
Example:
[
"tag_6GN4DNyrHNt4KktCNG8PDO",
"tag_UhsDkjL772Qbj5lWtT62VK"
]
excludedSegments
string[]

Excluded segment IDs

Pattern: ^segment_[a-zA-Z0-9]{22}$
Example:
[]
excludedTags
string[]

Excluded tag IDs with prefix

Pattern: ^tag_[a-zA-Z0-9]{22}$
Example:
["tag_Bv4Wq9Xp6Zn5Ly0Kt8JhQe"]
created
string<date-time>
updated
string<date-time>