curl -X POST "https://api.usegately.com/api/v1/campaigns/send-bulk" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Project-ID: YOUR_PROJECT_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "VIP Promo",
"subject": "Exclusive offer for you",
"content": "<p>Here is your exclusive deal.</p>",
"recipient_ids": [
"customer_alice@example.com",
"customer_bob@example.com"
]
}'
import { GatelyCampaigns } from '@gately/sdk'
const campaigns = new GatelyCampaigns({ projectId: 'YOUR_PROJECT_ID' })
const result = await campaigns.sendBulk({
name: 'VIP Promo',
subject: 'Exclusive offer for you',
content: '<p>Here is your exclusive deal.</p>',
recipient_ids: [
'customer_alice@example.com',
'customer_bob@example.com',
],
})
console.log(`Sent to ${result.successful_sends} of ${result.total_recipients}`)
{
"success": true,
"campaign": {
"id": "a1b2c3d4-e5f6-4789-abcd-ef1234567890",
"name": "VIP Promo",
"status": "sent",
"total_recipients": 2,
"delivered_count": 2
},
"total_recipients": 2,
"successful_sends": 2,
"failed_sends": 0,
"message": "Email campaign sent to 2 of 2 recipients"
}
{
"error": "No valid recipients found"
}
Email Campaigns
Send Bulk Campaign
Send a campaign to a list of resolved recipient IDs
POST
/
api
/
v1
/
campaigns
/
send-bulk
curl -X POST "https://api.usegately.com/api/v1/campaigns/send-bulk" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Project-ID: YOUR_PROJECT_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "VIP Promo",
"subject": "Exclusive offer for you",
"content": "<p>Here is your exclusive deal.</p>",
"recipient_ids": [
"customer_alice@example.com",
"customer_bob@example.com"
]
}'
import { GatelyCampaigns } from '@gately/sdk'
const campaigns = new GatelyCampaigns({ projectId: 'YOUR_PROJECT_ID' })
const result = await campaigns.sendBulk({
name: 'VIP Promo',
subject: 'Exclusive offer for you',
content: '<p>Here is your exclusive deal.</p>',
recipient_ids: [
'customer_alice@example.com',
'customer_bob@example.com',
],
})
console.log(`Sent to ${result.successful_sends} of ${result.total_recipients}`)
{
"success": true,
"campaign": {
"id": "a1b2c3d4-e5f6-4789-abcd-ef1234567890",
"name": "VIP Promo",
"status": "sent",
"total_recipients": 2,
"delivered_count": 2
},
"total_recipients": 2,
"successful_sends": 2,
"failed_sends": 0,
"message": "Email campaign sent to 2 of 2 recipients"
}
{
"error": "No valid recipients found"
}
An alternative to Send Campaign for when you already have a flat list of recipient IDs rather than contact list or segment IDs.
Recipient IDs must follow the format
customer_<email> or form_customer_<email>. IDs with a member_ prefix are not supported by this endpoint — use recipient_list_ids in the standard send endpoint instead.
Headers
Request Body
Array of recipient IDs. Supported formats:
customer_alice@example.comform_customer_alice@example.com
Optional file attachments — same shape as Send Campaign
Response
Same shape as Send Campaign.curl -X POST "https://api.usegately.com/api/v1/campaigns/send-bulk" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Project-ID: YOUR_PROJECT_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "VIP Promo",
"subject": "Exclusive offer for you",
"content": "<p>Here is your exclusive deal.</p>",
"recipient_ids": [
"customer_alice@example.com",
"customer_bob@example.com"
]
}'
import { GatelyCampaigns } from '@gately/sdk'
const campaigns = new GatelyCampaigns({ projectId: 'YOUR_PROJECT_ID' })
const result = await campaigns.sendBulk({
name: 'VIP Promo',
subject: 'Exclusive offer for you',
content: '<p>Here is your exclusive deal.</p>',
recipient_ids: [
'customer_alice@example.com',
'customer_bob@example.com',
],
})
console.log(`Sent to ${result.successful_sends} of ${result.total_recipients}`)
{
"success": true,
"campaign": {
"id": "a1b2c3d4-e5f6-4789-abcd-ef1234567890",
"name": "VIP Promo",
"status": "sent",
"total_recipients": 2,
"delivered_count": 2
},
"total_recipients": 2,
"successful_sends": 2,
"failed_sends": 0,
"message": "Email campaign sent to 2 of 2 recipients"
}
{
"error": "No valid recipients found"
}
Was this page helpful?