Update Campaign
curl --request PATCH \
--url https://api.example.com/api/v1/campaigns/{campaign_id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message_type": "<string>",
"custom_message": "<string>",
"message_payload": {},
"recipient_group_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"recipient_contact_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"scheduled_for": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.example.com/api/v1/campaigns/{campaign_id}"
payload = {
"name": "<string>",
"description": "<string>",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message_type": "<string>",
"custom_message": "<string>",
"message_payload": {},
"recipient_group_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"recipient_contact_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"scheduled_for": "2023-11-07T05:31:56Z"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
template_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
message_type: '<string>',
custom_message: '<string>',
message_payload: {},
recipient_group_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
recipient_contact_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
scheduled_for: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.example.com/api/v1/campaigns/{campaign_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"whatsapp_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient_type": "<string>",
"status": "<string>",
"total_recipients": 123,
"messages_sent": 123,
"messages_delivered": 123,
"messages_read": 123,
"messages_failed": 123,
"created_at": "<string>",
"updated_at": "<string>",
"description": "<string>",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message_type": "text",
"custom_message": "<string>",
"message_payload": {},
"recipient_group_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"recipient_contact_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"scheduled_for": "<string>",
"started_at": "<string>",
"completed_at": "<string>",
"cancelled_at": "<string>",
"failed_at": "<string>",
"error_message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}campaigns
Update Campaign
Update a campaign. Only DRAFT campaigns can be updated.
PATCH
/
api
/
v1
/
campaigns
/
{campaign_id}
Update Campaign
curl --request PATCH \
--url https://api.example.com/api/v1/campaigns/{campaign_id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message_type": "<string>",
"custom_message": "<string>",
"message_payload": {},
"recipient_group_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"recipient_contact_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"scheduled_for": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.example.com/api/v1/campaigns/{campaign_id}"
payload = {
"name": "<string>",
"description": "<string>",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message_type": "<string>",
"custom_message": "<string>",
"message_payload": {},
"recipient_group_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"recipient_contact_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"scheduled_for": "2023-11-07T05:31:56Z"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
template_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
message_type: '<string>',
custom_message: '<string>',
message_payload: {},
recipient_group_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
recipient_contact_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
scheduled_for: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.example.com/api/v1/campaigns/{campaign_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"whatsapp_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient_type": "<string>",
"status": "<string>",
"total_recipients": 123,
"messages_sent": 123,
"messages_delivered": 123,
"messages_read": 123,
"messages_failed": 123,
"created_at": "<string>",
"updated_at": "<string>",
"description": "<string>",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message_type": "text",
"custom_message": "<string>",
"message_payload": {},
"recipient_group_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"recipient_contact_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"scheduled_for": "<string>",
"started_at": "<string>",
"completed_at": "<string>",
"cancelled_at": "<string>",
"failed_at": "<string>",
"error_message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
Path Parameters
Body
application/json
Request to update a draft campaign.
Required string length:
1 - 255Maximum string length:
2000Campaign recipient selection mode.
Available options:
all, group, custom Response
Successful Response
Full campaign detail response.