PATCH
/api/public/v1/campaigns/{campaignId}Update a campaign
Edits the content or the audience of a campaign that has not started sending. The channel is not editable — changing it would mean throwing the campaign away anyway.
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:write
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
campaignId | string | Required | Campaign ID. |
Request Body
| Property | Type | Description |
|---|---|---|
name | string | |
subject | string | EMAIL only. |
body | string | |
audience | object | Replaces the whole filter. |
PATCHExample request
curl
curl -X PATCH "https://www.pxb.app/api/public/v1/campaigns/{campaignId}" \
-H "Authorization: Bearer your_access_token" \
-H "Content-Type: application/json" \
-d '{
"subject": "Your autumn service is due"
}'200Example response
json
{
"message": "Campaign updated successfully!",
"content": {
"campaign": {
"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"
}
}
}400Example response
json
{
"message": "This campaign has already started sending."
}In the console
The same thing done by hand, for anyone comparing the API against the screen they already use.