Campaigns
Use this endpoint to manipulate and obtain details on Salesbox’s Campaigns.
Base Endpoint
https://segmentai.salesbox.com.br/api/campaigns
Get Campaign
GET /api/campaigns/{id}
Get Campaign’s data.
HTTP Request
GET /api/campaigns/ID
Response
Expected Response Code: 200
{
"campaign": {
"id": 1,
"name": "Welcome Campaign",
"description": "Campaign to welcome new contacts",
"type": "email",
"status": "active",
"createdAt": "2024-01-15T10:00:00+00:00",
"modifiedAt": "2024-01-15T10:00:00+00:00",
"startDate": "2024-01-16T00:00:00+00:00",
"endDate": null
}
}
List Campaigns
GET /api/campaigns
Get a list of campaigns.
Query Parameters
Name |
Type |
Description |
|---|---|---|
|
string |
Text to search campaigns by |
|
int |
Which page to display |
|
int |
How many records to return |
|
string |
Column to sort by |
|
string |
Sort direction: asc or desc |
|
string |
Filter by campaign status (active, inactive, completed) |
Create Campaign
POST /api/campaigns/new
Create a new campaign.
Request Body
Name |
Type |
Description |
|---|---|---|
|
string |
Campaign name |
|
string |
Campaign description |
|
string |
Campaign type (email, sms, etc) |
|
string |
Campaign status (active, inactive) |
|
string |
Campaign start date (ISO 8601 format) |
|
string |
Campaign end date (ISO 8601 format) |
Edit Campaign
PATCH /api/campaigns/{id}/edit
Edit an existing campaign.
Request Body
Same fields as Create Campaign.
Delete Campaign
DELETE /api/campaigns/{id}/delete
Delete an existing campaign.
Add Contact to Campaign
POST /api/campaigns/{campaignId}/contact/{contactId}/add
Add a contact to a campaign.
Remove Contact from Campaign
POST /api/campaigns/{campaignId}/contact/{contactId}/remove
Remove a contact from a campaign.
Get Campaign Contacts
GET /api/campaigns/{id}/contacts
Get a list of contacts in a campaign.
Query Parameters
Same as List Contacts endpoint.