Skip to Content
inclamoDocs

Update a campaign

PATCH
/api/v1/accounts/{account_id}/campaigns/{id}

Update campaign fields, including scheduled_at to reschedule an active one-off campaign. Completed campaigns cannot be updated. Requires an account administrator and API access enabled for the account.

Authorization

headerAuthorizationBearer <token>

Authenticate with Authorization: Bearer <token> using a user API token from Profile Settings. Available in Chatwoot v4.19.0 and later.

Path Parameters

account_id*integer

The numeric ID of the account

id*integer

Account-scoped campaign ID returned by the campaign API.

Request Body

application/json
  1. body
campaign*

Response Body

Success

application/json
  1. response
id?integer

Account-scoped campaign ID. Use this value in campaign API paths.

title?string
description?string|null
account_id?integer
inbox?
sender?

Sender details, or an empty object when no sender is assigned.

message?string
template_params?|null
campaign_status?string
Value in"active""processing""completed"
campaign_type?string

Derived from the inbox type; website campaigns are ongoing and supported messaging campaigns are one-off.

Value in"ongoing""one_off"
enabled?boolean
scheduled_at?integer

Scheduled time in Unix seconds. Only present for one-off campaigns.

started_at?|

Start time in Unix seconds. Only present for one-off campaigns.

completed_at?|

Completion time in Unix seconds. Only present for one-off campaigns.

audience?array<>|

Audience for a one-off campaign. Only present for one-off campaigns.

trigger_rules?
trigger_only_during_business_hours?boolean
created_at?string
Formatdate-time
updated_at?string
Formatdate-time
Example Request
curl -X PATCH 'https://helpdesk.inclamo.com/api/v1/accounts/0/campaigns/0' \  -H 'Content-Type: application/json' \  -d '{  "campaign": {}}'
Example Response
{  "id": 0,  "title": "string",  "description": "string",  "account_id": 0,  "inbox": {    "id": 0,    "name": "string",    "website_url": "string",    "page_id": "string",    "instagram_id": "string",    "business_id": "string",    "provider_name": "string",    "profile_id": "string",    "line_channel_id": "string",    "email": "string",    "bot_name": "string",    "inbox_identifier": "string",    "channel_type": "string",    "avatar_url": "string",    "widget_color": "string",    "website_token": "string",    "enable_auto_assignment": true,    "web_widget_script": "string",    "welcome_title": "string",    "welcome_tagline": "string",    "greeting_enabled": true,    "greeting_message": "string",    "channel_id": 0,    "working_hours_enabled": true,    "enable_email_collect": true,    "csat_survey_enabled": true,    "auto_assignment_config": {},    "out_of_office_message": "string",    "working_hours": [      {        "day_of_week": 0,        "closed_all_day": true,        "open_hour": 0,        "open_minutes": 0,        "close_hour": 0,        "close_minutes": 0,        "open_all_day": true      }    ],    "timezone": "string",    "callback_webhook_url": "string",    "allow_messages_after_resolved": true,    "lock_to_single_conversation": true,    "sender_name_type": "string",    "business_name": "string",    "branded_email_layout": "string",    "hmac_mandatory": true,    "selected_feature_flags": [      "string"    ],    "reply_time": "string",    "messaging_service_sid": "string",    "phone_number": "string",    "medium": "string",    "provider": "string"  },  "sender": {},  "message": "string",  "template_params": {},  "campaign_status": "active",  "campaign_type": "ongoing",  "enabled": true,  "scheduled_at": 0,  "started_at": 0,  "completed_at": 0,  "audience": [    {      "type": "string",      "id": 0    }  ],  "trigger_rules": {},  "trigger_only_during_business_hours": true,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}