API reference

Campaigns

List, manage, send, and report on email campaigns. Paths are relative to https://app.blacklistguard.com/api/v1 and require your X-API-Key header.

List campaigns

GET /campaigns

Query parameters: page, limit. Returns a campaigns array plus a pagination object. Each campaign carries its own counts and rates — sent_count, open_rate, bounce_count, mailing_list_name, and so on.

Get a campaign

GET /campaigns/{id}

Returns the full campaign, including its content, delivery settings, and current stats.

Create & update

POST /campaigns
PUT  /campaigns/{id}

Both take the campaign object as the JSON body. PUT is a full-object update. A new campaign is created as a draft; start delivery with POST /campaigns/{id}/send.

Core fields

FieldTypeRequiredNotes
namestringYesInternal campaign name.
subjectstringYesSubject line.
from_emailstringYesMust be on a verified domain or a verified sender, else 400.
from_namestringNoSender display name.
reply_tostringNoReply-to address.
message_typestringNoemail (default) or sms.
phone_field_namestringSMS onlySubscriber field holding the phone number.

Targeting

FieldTypeNotes
recipient_typestringmailing_list, segment, or custom. Auto-detected if omitted (segment_id → segment, else segment_conditions → custom, else mailing list).
mailing_list_iduuidA single list (multiple lists aren't supported). Validated when you send, not on create.
segment_iduuidUsed when recipient_type is segment.
segment_conditionsJSONInline segment rules (see segment operators). Required when recipient_type is custom.

Content

FieldTypeNotes
html_contentstringHTML body.
text_contentstringPlain-text body.

Tracking & delivery

FieldTypeNotes
enable_open_trackingboolOmit to inherit the list's default.
enable_click_trackingboolOmit to inherit the list's default.
url_domain_iduuidTracking domain for links.
use_custom_headersboolEnable the raw header block below.
custom_headersstringRaw headers, used when use_custom_headers is true.
virtual_mta_ipstringA sending IP, or routing_rule:<uuid> to select a routing rule.
routing_rule_iduuidRouting rule to send through.
bounce_emailstringWhere bounces are routed.
sender_emailstringEnvelope sender override.

Scheduling & attachments

FieldTypeNotes
scheduled_atdatetimeInterpreted in your workspace's timezone, stored as UTC. Dispatch still happens via the scheduler or /send.
attachmentsarraySame shape as Send an email: { filename, content_type, content, disposition, content_id }.
Not supported: A/B testing, preheader/preview text, and multiple lists per campaign (use one mailing_list_id, or a segment / custom conditions).

The response is the created or updated campaign — read back its id, status (draft on create), recipient_type, total_recipients, timestamps, and the stat fields (sent_count, open_count, rates — all zero until it sends). status, sent_at, and the statistics are system-managed and read-only.

Only draft campaigns can be edited. Once a campaign is scheduled, sending, sent, paused, or cancelled, PUT returns 409 with code CONFLICT — duplicate it into a new draft to make changes.

Send, pause & resume

POST /campaigns/{id}/send
POST /campaigns/{id}/pause
POST /campaigns/{id}/resume

send begins delivery to the campaign's audience. pause halts an in-progress send; resume continues it.

Delete

DELETE /campaigns/{id}

Analytics

GET /campaigns/{id}/activity
GET /campaigns/{id}/smtp-domain-stats
GET /campaigns/{id}/messages
GET /campaigns/{id}/recent-activity
  • activity — hourly cumulative series: [{ time, sent, opens, clicks, unsubscribes, complaints }].
  • smtp-domain-stats — delivery broken down by recipient domain: { pagination, stats:[{ domain, total_messages, percent_total, success, bounced, failure, still_trying }] }.
  • messages — per-recipient results: { messages:[{ id, time, localpart, domain, status, attempts, error_message }], pagination }. Filter with status, email, page, limit.
  • recent-activity — per-event feed: { activities:[{ id, type, email, description, timestamp }], pagination } where type is sent|opened|clicked|bounced|unsubscribed|complained.