The SmarterSends API lets your internal systems export campaign data, retrieve conversation usage metrics, and manage informational calendar events.
Use your own SmarterSends instance URL in place of https://your-instance.smartersends.com in the examples below.
Authentication and API keys
Include these headers with each request:
Authorization: Bearer YOUR_API_KEY
Accept: application/json
To create a key:
- Sign in with an Admin account.
- Open Integrations, then API.
- Select Generate API Key.
- Copy the key and store it securely. The full key is shown only when it is generated.
The API panel lists each key's creation date and last-used date. Delete a key to revoke it. If you lose a key, generate a replacement and revoke the old key after updating your integration.
Use API keys in trusted server-side systems. A key authenticates requests to your instance; do not expose it in browser code or treat it as a group-specific user login.
Endpoints covered in this guide
| Task | Method and path |
|---|---|
| Export campaigns | GET /api/usage/campaigns/export |
| Get conversation usage or export it as CSV | GET /api/usage/conversations/export |
| List calendar events | GET /api/events |
| Create a calendar event | POST /api/events |
| Get a calendar event | GET /api/events/{id} |
| Update a calendar event |
PUT /api/events/{id} or PATCH /api/events/{id}
|
| Delete a calendar event | DELETE /api/events/{id} |
Campaign export
GET /api/usage/campaigns/export
This endpoint generates a CSV or JSON file and returns JSON containing the file's metadata and a temporary download URL. File generation completes during the request. The response does not contain a background-job ID.
Query parameters
All parameters are optional.
| Parameter | Behavior |
|---|---|
start_date |
First day to include. Defaults to 30 days ago. |
end_date |
Last day to include. Defaults to today. When providing a range, use an end date on or after the start date. |
date_column |
Date field used to select campaigns: send_time (default), created_at, or updated_at. An unrecognized value falls back to send_time. |
type |
Use lowercase email or sms to filter by channel. email selects email campaigns, whose exported type value is mailing. Omit this parameter to include all campaign types. Other values do not apply a channel filter. |
status |
Comma-separated statuses: Draft, Sent, Canceled, Failed, Pending, Scheduled, Reviewed. Matching ignores case and duplicate values. Unrecognized values are ignored. If no recognized values remain, no status filter is applied. |
format |
csv (default) or json. |
columns |
Comma-separated output columns, in the requested order. See below. |
Dates are expanded to full days: the start becomes the beginning of its day, and the end becomes the end of its day. Supplying timestamps does not create an exact time-of-day window. Dates without an explicit timezone use the application's configured timezone; these API exports do not use a signed-in user's profile timezone. For predictable requests, supply both dates and use a consistent timezone convention.
The date filter applies to date_column. With the default send_time, campaigns without a send time do not match the range. To export drafts by when they were created, use date_column=created_at&status=draft.
Output columns
Default columns:
name,subject,send_time,type,html
Available columns:
name,subject,send_time,type,html,from_name,from_address,reply_to_address,status,sent_mailing_id,template_name,group_name,user_name
Column names are normalized to lowercase, with spaces replaced by underscores. Unknown columns are ignored and duplicates are removed. If no recognized columns remain, the default columns are used.
CSV files contain a header row. JSON files contain an array of campaign objects. When present, send_time is formatted as YYYY-MM-DD HH:mm:ss, without a timezone suffix; it is not converted to a user's profile timezone.
Example: export sent emails as JSON
curl --get 'https://your-instance.smartersends.com/api/usage/campaigns/export' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Accept: application/json' \
--data-urlencode 'start_date=2026-08-01' \
--data-urlencode 'end_date=2026-08-31' \
--data-urlencode 'type=email' \
--data-urlencode 'status=sent' \
--data-urlencode 'format=json' \
--data-urlencode 'columns=name,subject,send_time,type,status,template_name'
In Postman, select GET, enter the endpoint, add the query parameters in Params, and choose Bearer Token in Authorization.
Example response
The following values are illustrative:
{
"file": {
"extension": "json",
"content_type": "application/json",
"s3_path": "/tmp/exports/example/campaigns_20260911_120000_example.json",
"url": "https://example.com/temporary-download",
"expires_at": "2026-09-11T13:00:00+00:00"
}
}
Download the file from file.url. Even with format=json, the campaign records are in the downloadable file, not directly in this response.
The download URL is generated with a 60-minute lifetime. Use expires_at to check its expiry and request another export if needed. If a temporary URL cannot be generated, file.url is null and the response includes:
{
"message": "Export generated, but no temporary URL could be created."
}
That message accompanies the file metadata. Contact support if no download URL is available.
Conversation usage
GET /api/usage/conversations/export
Retrieve instance-wide conversation usage with a breakdown by group. JSON is returned directly by default. CSV mode generates a file and returns download metadata.
Query parameters
| Parameter | Behavior |
|---|---|
start_date |
Optional first day to include; defaults to 30 days ago. |
end_date |
Optional last day to include; defaults to today. Supply an end date on or after the start date. |
format |
json (default) or csv. |
The same full-day normalization described for campaign exports applies.
How the reporting period works
Most metrics select conversations created within the date range. Status and unread counts reflect their current state when you request the report, not a historical snapshot of their state on the end date.
Message averages include the messages recorded for those selected conversations, including messages outside the selected date range. Average first-response time measures the minutes from conversation creation to its first sent message; conversations without a sent message are excluded from that average.
Reminder and escalation counts have a different scope:
- Overall
metrics.remindersandmetrics.escalationscount those activities occurring during the selected period, including activities for conversations created earlier. - The
by_groupreminder and escalation counts require both the activity and the conversation's creation date to fall within the period.
For that reason, the sum of group reminder/escalation counts can differ from the overall totals.
JSON response fields
| Field | Contents |
|---|---|
range |
start_date and end_date as ISO 8601 timestamps. |
metrics |
Overall conversation counts and averages. |
by_group |
An array containing one summary per group represented in the selected conversations. |
The metrics object contains:
total_conversations
active_conversations
awaiting_reply
unread_conversations
at_risk
stale
reminders
escalations
avg_first_response_minutes
avg_messages_per_conversation
avg_sent_messages_per_conversation
avg_received_messages_per_conversation
Active conversations exclude closed and spam conversations. Unread conversation counts also exclude closed and spam conversations. avg_first_response_minutes is null when no qualifying first response exists.
Each by_group row contains:
group_id
group_name
total_conversations
active_conversations
awaiting_reply
unread_conversations
at_risk
stale
reminders
escalations
avg_first_response_minutes
avg_messages_per_conversation
Example: get conversation metrics
curl --get 'https://your-instance.smartersends.com/api/usage/conversations/export' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Accept: application/json' \
--data-urlencode 'start_date=2026-08-01' \
--data-urlencode 'end_date=2026-08-31' \
--data-urlencode 'format=json'
CSV export
Use the same request with format=csv. The file contains a metric,value section, a blank row, and a table of group summaries.
The response contains file.extension, file.content_type, file.s3_path, file.url, and file.expires_at. Download the CSV from file.url. The URL has a 60-minute lifetime; if it is null, contact support.
Events API
Manage one-time or recurring informational events on the SmarterSends calendar. Informational events do not send campaigns or create blackout restrictions.
List and retrieve events
GET /api/events returns an array of event objects with their associated groups.
GET /api/events/{id} returns one event object with its associated groups. Replace {id} with the event's ID.
Create an event
POST /api/events
Content-Type: application/json
Include the Bearer authorization and Accept headers described above.
| Parameter | Requirements |
|---|---|
name |
Required string, up to 255 characters. |
start_date |
Required date/time; use an ISO 8601 timestamp with a timezone. |
end_date |
Optional date/time, on or after start_date. |
description |
Optional string. |
repeats |
Optional boolean. Use false for a one-time event or true for recurrence. |
repeat_type |
daily, weekly, monthly, or yearly; uppercase equivalents are also accepted. |
repeat_interval |
Optional positive integer, such as 2 for every two weeks. |
max_occurrences |
Optional positive integer limiting the number of occurrences. |
repeat_days |
Optional array of recurrence weekdays, such as ["MO","WE","FR"]. |
repeat_months |
Optional array of recurrence months, such as [1,7]. |
all_groups |
Optional boolean. Use true to display the event to all groups. |
groups |
Optional array of existing SmarterSends group IDs. |
For a recurring event, supply repeats, repeat_type, and repeat_interval explicitly. To make an event visible, set all_groups=true or provide its intended groups.
Example request body:
{
"name": "Weekly Training",
"start_date": "2026-09-14T14:00:00Z",
"end_date": "2026-09-14T15:00:00Z",
"repeats": true,
"repeat_type": "weekly",
"repeat_interval": 1,
"max_occurrences": 8,
"repeat_days": ["MO"],
"all_groups": false,
"groups": [5, 12]
}
Replace the example group IDs with groups from your instance. A successful create returns 201 Created and the event object, including its ID and groups.
Update an event
Use PUT /api/events/{id} or PATCH /api/events/{id} with a JSON body containing the fields to change. Fields omitted from the request remain unchanged.
If you supply groups, the array replaces the event's group assignments. To clear the assignments, send an empty array. When updating end_date, include start_date so the date-order validation has both values.
A successful update returns 200 OK and the updated event object.
Delete an event
Use DELETE /api/events/{id}. A successful delete returns 204 No Content.
Deleting a recurring event removes the event record for the series, rather than a single occurrence.
Troubleshooting
-
401 Unauthorized: Check the instance URL and the
Authorization: Bearer YOUR_API_KEYheader. Confirm that the key has not been revoked. - 404 Not Found: Check the endpoint path or event ID.
- 405 Method Not Allowed: Check the HTTP method. Both export endpoints use GET.
- 422 Unprocessable Entity: Check the validation details in the JSON response, including date order, format and required event fields.
-
Empty campaign export: Check the date field, dates, type and status. Drafts without a send time require a different
date_column. - Unexpected campaign types or statuses: Use the documented filter values. Unrecognized type values apply no type filter, and a status list containing no valid values applies no status filter.
- Conversation totals do not match a historical snapshot: The report uses creation dates and current conversation state. Review the reminder/escalation scope described above.
-
Download expired or unavailable: Generate the export again after expiry. If
file.urlisnull, contact support.
Comments
0 comments
Article is closed for comments.