API v1
Campaign API Reference
Complete API documentation for managing email campaigns programmatically. Create, update, send, and track your campaigns with ease.
Authentication
All API requests require authentication using a Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_TOKEN
Campaign Object
Core data structure for campaigns
id readonly int
name string
subject string
content string
template_id int
email_service_id int
from_name string
from_email string
is_open_tracking bool
is_click_tracking bool
sent_count readonly int
open_count readonly int
click_count readonly int
send_to_all bool
tags array
scheduled_at datetime
List Campaigns
Retrieve a paginated list of campaigns
Endpoint
GET /api/v1/campaigns
Response Code
200 OKSample Request
GET /api/v1/campaigns HTTP/1.1 Host: sendportal.local Authorization: Bearer 9w2fN7d4F3Banyv7gihYOWJEH6MvtYyZ Accept: application/json
Sample Response
{
"data": [
{
"id": 1,
"name": "name",
"subject": "My Campaign Subject",
"content": "My Email Content",
"status_id": 1,
"template_id": 1,
"email_service_id": 1,
"from_name": "SendPortal",
"from_email": "test@sendportal.io",
"is_open_tracking": true,
"is_click_tracking": true,
"sent_count": 0,
"open_count": 0,
"click_count": 0,
"send_to_all": true,
"tags": [],
"save_as_draft": false,
"scheduled_at": "2020-07-24 08:46:54",
"created_at": "2020-07-24 08:23:38",
"updated_at": "2020-07-24 09:43:42"
}
],
"meta": {
"current_page": 1,
"per_page": 25,
"total": 1
}
} Show Campaign
Get details of a single campaign
Endpoint
GET /api/v1/campaigns/{campaignId}
Response Code
200 OKCreate Campaign
Create a new campaign
Endpoint
POST /api/v1/campaigns
Response Code
201 CreatedRequest Fields
name - string (required) subject - string (required) content - string (required) template_id - int (required) is_open_tracking - bool (optional) tags - array (optional) Send Campaign
Trigger campaign delivery
Endpoint
POST /api/v1/campaigns/{campaignId}/send
Response Code
200 OKImportant
Once a campaign is sent, it cannot be recalled. Ensure all content and recipient lists are correct before sending.
Need Help?
Check out our complete documentation or reach out to our support team for assistance with your integration.