Update a campaign
Update a draft or scheduled campaign — only the fields you send change. Set contact_ids or smart_list_id to null to switch recipient source.
PATCH
https://api.centerfy.ai/webhooks/inbound/campaigns/:id Headers
| Header | Required | Value | Description |
|---|---|---|---|
x-api-key | Yes | your sub-account API key (cfy_…) | Authenticates the request; or use Authorization: Bearer <key>. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | Yes | The campaign id. |
Body parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | No | — | Campaign name; max 200 characters. |
message_content | string | No | — | SMS text, or the email body (HTML); max 100,000 characters. |
subject | string | No | — | Email campaigns only — a single line, max 500 characters. 400 if sent for an SMS campaign. |
contact_ids | string (uuid)[] | null | No | — | Recipients — contacts in this sub-account; max 10,000, duplicates removed. Use this or smart_list_id, not both. |
smart_list_id | string (uuid) | null | No | — | Send to the members of this smart list (resolved when the campaign is sent). Use this or contact_ids, not both. |
business_hours_enabled | boolean | No | — | Only send within business_hours_config. Defaults to false. |
business_hours_config | object | null | No | — | { timezone, monday … sunday }. timezone is an IANA name (max 64 chars); each day is { enabled: boolean, start: “HH:MM”, end: “HH:MM” } and start/end are required and start must be before end when enabled. |
Request body
{
"subject": "Last chance: 20% off",
"business_hours_enabled": true,
"business_hours_config": {
"timezone": "America/Los_Angeles",
"monday": {
"enabled": true,
"start": "09:00",
"end": "17:00"
}
}
}Example
curl -X PATCH "https://api.centerfy.ai/webhooks/inbound/campaigns/{id}" \
-H "x-api-key: $CENTERFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"subject": "Last chance: 20% off",
"business_hours_enabled": true,
"business_hours_config": {
"timezone": "America/Los_Angeles",
"monday": {
"enabled": true,
"start": "09:00",
"end": "17:00"
}
}
}' import { CenterfyClient } from "@centerfy/sdk";
const centerfy = new CenterfyClient({ apiKey: process.env.CENTERFY_API_KEY! });
const result = await centerfy.campaigns.update("<campaignId>", {
"subject": "Last chance: 20% off",
"business_hours_enabled": true,
"business_hours_config": {
"timezone": "America/Los_Angeles",
"monday": {
"enabled": true,
"start": "09:00",
"end": "17:00"
}
}
});
console.log(result); centerfy campaigns update <campaignId> '{"subject":"Last chance: 20% off","business_hours_enabled":true,"business_hours_config":{"timezone":"America/Los_Angeles","monday":{"enabled":true,"start":"09:00","end":"17:00"}}}' MCP tool: centerfy_campaigns_update (see MCP server)
Response
{
"status": "success",
"campaign": {
"id": "4b7e1c2d-3a4f-4e5d-9c8b-7a6f5e4d3c2b",
"name": "October promo",
"campaign_type": "email",
"status": "draft",
"subject": "20% off this week",
"message_content": "<p>Hi there, our October sale is on.</p>",
"contact_ids": [
"3f1c2a9e-7b4d-4c8a-9e2f-1a2b3c4d5e6f",
"6a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"
],
"smart_list_id": null,
"start_date": null,
"business_hours_enabled": false,
"business_hours_config": null,
"progress": 0,
"contacted": 0,
"success": 0,
"pending": 0,
"opened_count": 0,
"clicked_count": 0,
"unsubscribed_count": 0,
"created_at": "2026-10-06T10:00:00.000Z",
"updated_at": "2026-10-06T10:00:00.000Z"
}
}Errors
409— unless the campaign is draft or scheduled.400— if a field is empty, subject is sent for an SMS campaign, the result would have both contact_ids and smart_list_id, a contact or smart list is not in this sub-account, or business_hours_config is invalid.404— if the campaign is not in this sub-account.
Notes
Send at least one field. campaign_type cannot be changed.