curl -X PUT "https://api.usegately.com/api/v1/campaigns/CAMPAIGN_ID" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Project-ID: YOUR_PROJECT_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "June Newsletter (revised)",
"subject": "What we shipped this month — updated",
"content": "<h1>June Update</h1><p>Updated content here.</p>"
}'
import { GatelyCampaigns } from '@gately/sdk'
const campaigns = new GatelyCampaigns({ projectId: 'YOUR_PROJECT_ID' })
const updated = await campaigns.update('CAMPAIGN_ID', {
name: 'June Newsletter (revised)',
subject: 'What we shipped this month — updated',
content: '<h1>June Update</h1><p>Updated content here.</p>',
})
{
"success": true,
"message": "Campaign updated successfully",
"campaign": {
"id": "a1b2c3d4-e5f6-4789-abcd-ef1234567890",
"name": "June Newsletter (revised)",
"subject": "What we shipped this month — updated",
"status": "scheduled",
"updated_at": "2025-06-15T11:30:00.000Z"
}
}
{
"error": "Cannot update campaign that is sending or already sent"
}
{
"error": "Missing required fields: name, subject, content"
}
Email Campaigns
Update Campaign
Update a draft or scheduled campaign’s name, subject, or content
PUT
/
api
/
v1
/
campaigns
/
{campaignId}
curl -X PUT "https://api.usegately.com/api/v1/campaigns/CAMPAIGN_ID" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Project-ID: YOUR_PROJECT_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "June Newsletter (revised)",
"subject": "What we shipped this month — updated",
"content": "<h1>June Update</h1><p>Updated content here.</p>"
}'
import { GatelyCampaigns } from '@gately/sdk'
const campaigns = new GatelyCampaigns({ projectId: 'YOUR_PROJECT_ID' })
const updated = await campaigns.update('CAMPAIGN_ID', {
name: 'June Newsletter (revised)',
subject: 'What we shipped this month — updated',
content: '<h1>June Update</h1><p>Updated content here.</p>',
})
{
"success": true,
"message": "Campaign updated successfully",
"campaign": {
"id": "a1b2c3d4-e5f6-4789-abcd-ef1234567890",
"name": "June Newsletter (revised)",
"subject": "What we shipped this month — updated",
"status": "scheduled",
"updated_at": "2025-06-15T11:30:00.000Z"
}
}
{
"error": "Cannot update campaign that is sending or already sent"
}
{
"error": "Missing required fields: name, subject, content"
}
Campaigns with status
sending or sent cannot be updated. Attempting to do so returns a 400 error.Headers
string
required
Bearer YOUR_API_KEYstring
Your project UUID. Not required if the API key already encodes the project.
Path Parameters
string
required
Campaign UUID
Request Body
All three body fields are required.string
required
Updated campaign display name
string
required
Updated email subject line
string
required
Updated HTML body content
string
Pre-processed HTML — defaults to
content if omittedResponse
boolean
true on successstring
Human-readable confirmation
object
The full updated campaign object
curl -X PUT "https://api.usegately.com/api/v1/campaigns/CAMPAIGN_ID" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Project-ID: YOUR_PROJECT_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "June Newsletter (revised)",
"subject": "What we shipped this month — updated",
"content": "<h1>June Update</h1><p>Updated content here.</p>"
}'
import { GatelyCampaigns } from '@gately/sdk'
const campaigns = new GatelyCampaigns({ projectId: 'YOUR_PROJECT_ID' })
const updated = await campaigns.update('CAMPAIGN_ID', {
name: 'June Newsletter (revised)',
subject: 'What we shipped this month — updated',
content: '<h1>June Update</h1><p>Updated content here.</p>',
})
{
"success": true,
"message": "Campaign updated successfully",
"campaign": {
"id": "a1b2c3d4-e5f6-4789-abcd-ef1234567890",
"name": "June Newsletter (revised)",
"subject": "What we shipped this month — updated",
"status": "scheduled",
"updated_at": "2025-06-15T11:30:00.000Z"
}
}
{
"error": "Cannot update campaign that is sending or already sent"
}
{
"error": "Missing required fields: name, subject, content"
}
Was this page helpful?