Skip to main content
POST
/
api
/
v1
/
campaigns
/
send
curl -X POST "https://api.usegately.com/api/v1/campaigns/send" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Project-ID: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "June Newsletter",
    "subject": "What we shipped this month",
    "content": "<h1>June Update</h1><p>Here is what we built...</p>",
    "recipient_all_contacts": true
  }'
{
  "success": true,
  "campaign": {
    "id": "a1b2c3d4-e5f6-4789-abcd-ef1234567890",
    "name": "June Newsletter",
    "subject": "What we shipped this month",
    "status": "sent",
    "total_recipients": 842,
    "delivered_count": 835,
    "sent_at": "2025-06-15T10:00:00.000Z"
  },
  "total_recipients": 842,
  "successful_sends": 835,
  "failed_sends": 7,
  "message": "Email campaign sent to 835 of 842 recipients"
}
Creates a campaign record and immediately sends it to all resolved recipients. Pass scheduled_at to queue it for later instead. At least one recipient source is required — you can combine multiple.

Headers

Authorization
string
required
Bearer YOUR_API_KEY
X-Project-ID
string
Your project UUID. Not required if the API key already encodes the project.

Request Body

name
string
required
Display name stored in the dashboard (e.g. "June Newsletter")
subject
string
required
Email subject line shown to recipients
content
string
required
HTML body of the email. YouTube <iframe> embeds are automatically converted to linked thumbnail images.
recipient_emails
string[]
Explicit list of email addresses to send to
recipient_list_ids
string[]
IDs of contact lists — all members of each list receive the email
recipient_segment_ids
string[]
IDs of contact segments — filtered contacts receive the email
recipient_all_contacts
boolean
Set true to send to every contact in the project
scheduled_at
string
ISO 8601 datetime to schedule delivery (e.g. "2025-07-01T09:00:00Z"). Omit to send immediately.
attachments
object[]
Optional file attachments. Each object must have content (base64), filename, and type (MIME). Max 10 MB per file.

Response

success
boolean
true when the campaign was created and sending initiated
campaign
object
The created campaign record
total_recipients
number
Total unique addresses targeted
successful_sends
number
Emails accepted by the mail service
failed_sends
number
Emails that failed to send
message
string
Human-readable summary (e.g. "Email campaign sent to 835 of 842 recipients")
curl -X POST "https://api.usegately.com/api/v1/campaigns/send" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Project-ID: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "June Newsletter",
    "subject": "What we shipped this month",
    "content": "<h1>June Update</h1><p>Here is what we built...</p>",
    "recipient_all_contacts": true
  }'
{
  "success": true,
  "campaign": {
    "id": "a1b2c3d4-e5f6-4789-abcd-ef1234567890",
    "name": "June Newsletter",
    "subject": "What we shipped this month",
    "status": "sent",
    "total_recipients": 842,
    "delivered_count": 835,
    "sent_at": "2025-06-15T10:00:00.000Z"
  },
  "total_recipients": 842,
  "successful_sends": 835,
  "failed_sends": 7,
  "message": "Email campaign sent to 835 of 842 recipients"
}