GET
/api/public/v1/campaignsList campaigns
Marketing sends: one message written once and sent to an audience of a location’s customers. The rest of xRM talks to one customer at a time; this is the layer above. An SMS campaign sends from a phone number of its own, because Twilio allows one A2P registration per messaging service and one service per number — marketing traffic cannot share the company’s transactional sender.
Required scope
The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Settings → Company → API, and to a teammate under Employee → Permissions.
campaigns:read
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
locationId | string | Required | Whose campaigns to read. |
limit | number | Optional | Maximum number of items to return (1-100).Default: 20 |
offset | number | Optional | Number of items to skip before starting to collect the result set.Default: 0 |
sortBy | string | Optional | Field to sort by. Allowed values vary by endpoint.Default: createdAt |
sortOrder | string asc desc | Optional | Sort direction.Default: desc |
search | string | Optional | Free-text search across the resource’s primary fields. |
createdAfter | string | Optional | ISO 8601 timestamp — only return items created after this time. |
createdBefore | string | Optional | ISO 8601 timestamp — only return items created before this time. |
updatedAfter | string | Optional | ISO 8601 timestamp — only return items updated after this time. |
status | string DRAFT REGISTERING READY SCHEDULED SENDING SENT PAUSED FAILED | Optional | REGISTERING is SMS-only — its carrier registration is pending. READY can send; SENT is done. |
channel | string EMAIL SMS | Optional | Which pipe it sends down. |
GETExample request
curl
curl -X GET "https://www.pxb.app/api/public/v1/campaigns" \
-H "Authorization: Bearer your_access_token"200Example response
json
{
"message": "Campaigns retrieved successfully!",
"content": {
"campaigns": [
{
"id": "cmp_3311",
"locationId": "loc_abc123",
"name": "Autumn service reminder",
"channel": "EMAIL",
"status": "DRAFT",
"subject": "Time for your autumn service",
"body": "Hi {{name}} — you are due for a service.",
"audience": {
"lifecycleStages": [
"CUSTOMER"
],
"inactiveDays": 180,
"createdWithinDays": null,
"neverContacted": false
},
"scheduledAt": null,
"startedAt": null,
"sentAt": null,
"createdAt": "2026-08-26T12:00:00.000Z",
"updatedAt": "2026-08-26T12:00:00.000Z"
}
],
"pagination": {
"total": 42,
"limit": 20,
"offset": 0,
"hasMore": true
}
}
}In the console
The same thing done by hand, for anyone comparing the API against the screen they already use.
xRM → Campaigns
/xrm/campaigns