curl "https://api.usegately.com/api/v1/campaigns/CAMPAIGN_ID/stats" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Project-ID: YOUR_PROJECT_ID"
const res = await fetch(
'https://api.usegately.com/api/v1/campaigns/CAMPAIGN_ID/stats',
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'X-Project-ID': 'YOUR_PROJECT_ID',
}
}
)
const stats = await res.json()
import { GatelyCampaigns } from '@gately/sdk'
const campaigns = new GatelyCampaigns({ projectId: 'YOUR_PROJECT_ID' })
const stats = await campaigns.getStats('CAMPAIGN_ID')
// SDK adds derived rates automatically
console.log(`Delivery rate: ${stats.delivery_rate}%`)
console.log(`Open rate: ${stats.open_rate}%`)
console.log(`Click rate: ${stats.click_rate}%`)
{
"sent": 842,
"delivered": 835,
"opened": 412,
"clicked": 98,
"bounced": 7,
"complained": 1
}
{
"sent": 500,
"delivered": 0,
"opened": 0,
"clicked": 0,
"bounced": 0,
"complained": 0
}
Email Campaigns
Get Campaign Stats
Retrieve delivery and engagement statistics for a campaign
GET
/
api
/
v1
/
campaigns
/
{campaignId}
/
stats
curl "https://api.usegately.com/api/v1/campaigns/CAMPAIGN_ID/stats" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Project-ID: YOUR_PROJECT_ID"
const res = await fetch(
'https://api.usegately.com/api/v1/campaigns/CAMPAIGN_ID/stats',
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'X-Project-ID': 'YOUR_PROJECT_ID',
}
}
)
const stats = await res.json()
import { GatelyCampaigns } from '@gately/sdk'
const campaigns = new GatelyCampaigns({ projectId: 'YOUR_PROJECT_ID' })
const stats = await campaigns.getStats('CAMPAIGN_ID')
// SDK adds derived rates automatically
console.log(`Delivery rate: ${stats.delivery_rate}%`)
console.log(`Open rate: ${stats.open_rate}%`)
console.log(`Click rate: ${stats.click_rate}%`)
{
"sent": 842,
"delivered": 835,
"opened": 412,
"clicked": 98,
"bounced": 7,
"complained": 1
}
{
"sent": 500,
"delivered": 0,
"opened": 0,
"clicked": 0,
"bounced": 0,
"complained": 0
}
Returns event counts aggregated from the email tracking system. Stats are populated as emails are delivered, opened, and clicked — a freshly sent campaign may show zeros until tracking events arrive.
Headers
Path Parameters
Response
The SDK’s
getStats() method adds derived delivery_rate, open_rate, and click_rate percentages calculated client-side from these raw counts.curl "https://api.usegately.com/api/v1/campaigns/CAMPAIGN_ID/stats" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Project-ID: YOUR_PROJECT_ID"
const res = await fetch(
'https://api.usegately.com/api/v1/campaigns/CAMPAIGN_ID/stats',
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'X-Project-ID': 'YOUR_PROJECT_ID',
}
}
)
const stats = await res.json()
import { GatelyCampaigns } from '@gately/sdk'
const campaigns = new GatelyCampaigns({ projectId: 'YOUR_PROJECT_ID' })
const stats = await campaigns.getStats('CAMPAIGN_ID')
// SDK adds derived rates automatically
console.log(`Delivery rate: ${stats.delivery_rate}%`)
console.log(`Open rate: ${stats.open_rate}%`)
console.log(`Click rate: ${stats.click_rate}%`)
{
"sent": 842,
"delivered": 835,
"opened": 412,
"clicked": 98,
"bounced": 7,
"complained": 1
}
{
"sent": 500,
"delivered": 0,
"opened": 0,
"clicked": 0,
"bounced": 0,
"complained": 0
}
Was this page helpful?