Update a campaign contact
curl --request PUT \
--url https://voice-api.onclarity.com/v1/projects/{projectId}/campaigns/{id}/items/{itemId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_number": "+447700900456",
"custom_vars": {
"plan": "Premium"
}
}
'import requests
url = "https://voice-api.onclarity.com/v1/projects/{projectId}/campaigns/{id}/items/{itemId}"
payload = {
"phone_number": "+447700900456",
"custom_vars": { "plan": "Premium" }
}
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({phone_number: '+447700900456', custom_vars: {plan: 'Premium'}})
};
fetch('https://voice-api.onclarity.com/v1/projects/{projectId}/campaigns/{id}/items/{itemId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"item": {
"id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"campaign_id": "3f1c2a8e-6b0d-4f6e-9a51-0d2b7c9e4a10",
"name": "John Smith",
"phone_number": "+447700900456",
"channel": "voice",
"country": "GB",
"agent_id": null,
"callback": false,
"custom_vars": {
"plan": "Premium"
},
"status": "scheduled",
"failed_reason": null,
"attempt_count": 0,
"conversation_id": null,
"start_time": null,
"next_attempt_at": null,
"callback_requested": false,
"callback_origin_item_id": null,
"callback_target_item_id": null,
"created_at": "2026-02-28T10:05:00.000Z",
"updated_at": "2026-02-28T10:07:30.000Z"
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "Invalid or revoked token"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "Campaign item not found"
}{
"error": "Agent \"Billing bot\" is not published yet — publish it before it can take calls",
"code": "AGENT_NOT_PUBLISHED",
"agent_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": [
"<unknown>"
]
}Campaigns
Update a campaign contact
Changes one contact on a draft or scheduled campaign. Send only the fields to change; at least one is required. custom_vars, when sent, replaces the contact’s variables. Changing the phone number re-checks it: an unparseable number marks the contact invalid.
PUT
/
v1
/
projects
/
{projectId}
/
campaigns
/
{id}
/
items
/
{itemId}
Update a campaign contact
curl --request PUT \
--url https://voice-api.onclarity.com/v1/projects/{projectId}/campaigns/{id}/items/{itemId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_number": "+447700900456",
"custom_vars": {
"plan": "Premium"
}
}
'import requests
url = "https://voice-api.onclarity.com/v1/projects/{projectId}/campaigns/{id}/items/{itemId}"
payload = {
"phone_number": "+447700900456",
"custom_vars": { "plan": "Premium" }
}
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({phone_number: '+447700900456', custom_vars: {plan: 'Premium'}})
};
fetch('https://voice-api.onclarity.com/v1/projects/{projectId}/campaigns/{id}/items/{itemId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"item": {
"id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"campaign_id": "3f1c2a8e-6b0d-4f6e-9a51-0d2b7c9e4a10",
"name": "John Smith",
"phone_number": "+447700900456",
"channel": "voice",
"country": "GB",
"agent_id": null,
"callback": false,
"custom_vars": {
"plan": "Premium"
},
"status": "scheduled",
"failed_reason": null,
"attempt_count": 0,
"conversation_id": null,
"start_time": null,
"next_attempt_at": null,
"callback_requested": false,
"callback_origin_item_id": null,
"callback_target_item_id": null,
"created_at": "2026-02-28T10:05:00.000Z",
"updated_at": "2026-02-28T10:07:30.000Z"
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "Invalid or revoked token"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "Campaign item not found"
}{
"error": "Agent \"Billing bot\" is not published yet — publish it before it can take calls",
"code": "AGENT_NOT_PUBLISHED",
"agent_id": "<string>"
}{
"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.
Path Parameters
Project id
Campaign id
Contact (campaign item) id
Body
application/json
Response
The updated contact
One contact on a campaign and the state of its call.
Show child attributes
Show child attributes