curl --request PUT \
--url https://voice-api.onclarity.com/v1/projects/{projectId}/campaigns/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"max_concurrency": 10,
"calling_window": {
"start": "10:00",
"end": "17:00",
"timezone": "Europe/London"
}
}
'import requests
url = "https://voice-api.onclarity.com/v1/projects/{projectId}/campaigns/{id}"
payload = {
"max_concurrency": 10,
"calling_window": {
"start": "10:00",
"end": "17:00",
"timezone": "Europe/London"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
max_concurrency: 10,
calling_window: {start: '10:00', end: '17:00', timezone: 'Europe/London'}
})
};
fetch('https://voice-api.onclarity.com/v1/projects/{projectId}/campaigns/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"campaign": {
"id": "3f1c2a8e-6b0d-4f6e-9a51-0d2b7c9e4a10",
"project_id": "8d2e4b1a-1c3f-4e5a-9b7d-6f0a2c4e8b13",
"name": "March renewals",
"agent_id": "5b7e9c1d-2a4f-4c6e-8d0b-1f3a5c7e9b24",
"from_number": "+14155550100",
"start_time": null,
"callback": false,
"retries": 2,
"retry_delay_seconds": 3600,
"max_concurrency": 10,
"calling_window": {
"start": "10:00",
"end": "17:00",
"timezone": "Europe/London"
},
"status": "draft",
"started_at": null,
"canceled_at": null,
"ended_at": null,
"created_at": "2026-02-27T15:12:40.000Z",
"updated_at": "2026-02-28T10:01:12.000Z"
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "Invalid or revoked token"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "Cannot edit a running campaign"
}{
"error": "<string>",
"message": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": [
"<unknown>"
]
}Update a campaign
Changes a campaign’s settings. Send only the fields to change; at least one is required. Only draft and scheduled campaigns can be edited: cancel a running campaign to stop it.
Setting start_time schedules the campaign; setting it to null returns it to draft. Changing callback also applies the new value to every contact already on the campaign.
curl --request PUT \
--url https://voice-api.onclarity.com/v1/projects/{projectId}/campaigns/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"max_concurrency": 10,
"calling_window": {
"start": "10:00",
"end": "17:00",
"timezone": "Europe/London"
}
}
'import requests
url = "https://voice-api.onclarity.com/v1/projects/{projectId}/campaigns/{id}"
payload = {
"max_concurrency": 10,
"calling_window": {
"start": "10:00",
"end": "17:00",
"timezone": "Europe/London"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
max_concurrency: 10,
calling_window: {start: '10:00', end: '17:00', timezone: 'Europe/London'}
})
};
fetch('https://voice-api.onclarity.com/v1/projects/{projectId}/campaigns/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"campaign": {
"id": "3f1c2a8e-6b0d-4f6e-9a51-0d2b7c9e4a10",
"project_id": "8d2e4b1a-1c3f-4e5a-9b7d-6f0a2c4e8b13",
"name": "March renewals",
"agent_id": "5b7e9c1d-2a4f-4c6e-8d0b-1f3a5c7e9b24",
"from_number": "+14155550100",
"start_time": null,
"callback": false,
"retries": 2,
"retry_delay_seconds": 3600,
"max_concurrency": 10,
"calling_window": {
"start": "10:00",
"end": "17:00",
"timezone": "Europe/London"
},
"status": "draft",
"started_at": null,
"canceled_at": null,
"ended_at": null,
"created_at": "2026-02-27T15:12:40.000Z",
"updated_at": "2026-02-28T10:01:12.000Z"
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "Invalid or revoked token"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "Cannot edit a running campaign"
}{
"error": "<string>",
"message": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": [
"<unknown>"
]
}Authorizations
Your organization API key (it starts with anek_org_). The same key works on the Voice API and the Support API. See Authentication.
Body
Send only the fields to change.
111Set to schedule the campaign; null returns it to draft.
Changing it applies the new value to every existing contact.
x >= 0x >= 05 <= x <= 20A recurring window in which the campaign may dial. Outside it, contacts wait for the next window. When end is not after start the window runs past midnight (for example 22:00 to 02:00).
Show child attributes
Show child attributes
Response
The updated campaign
An outbound calling campaign.
Show child attributes
Show child attributes