{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Campaigns
Re-execute Campaign
Re-execute a completed or failed campaign with new contact selection and scheduling. Preserves all execution history while allowing a fresh run with customizable parameters.
POST
/
api
/
v1
/
campaigns
/
{campaign_id}
/
re-execute
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Re-execute a completed, cancelled, or failed campaign with flexible contact selection and scheduling options.
Retry only failed contacts:
Retry specific contacts:
Path Parameters
campaign_id(integer, required): The unique identifier of the campaign
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
contact_selection | string or array | Yes | Which contacts to include |
schedule_settings | object | No | Scheduling configuration |
Contact Selection Options
| Value | Description |
|---|---|
"all" | Reset and re-contact all contacts |
"failed_only" | Only retry failed, no_answer, busy, voicemail contacts |
[1, 2, 3] | Array of specific contact IDs to retry |
Schedule Settings
{
"schedule_settings": {
"schedule_type": "immediate",
"scheduled_at": "2024-02-15T09:00:00Z",
"timezone": "America/New_York"
}
}
| Field | Type | Description |
|---|---|---|
schedule_type | string | immediate, scheduled, or recurring |
scheduled_at | string | ISO 8601 datetime for scheduled type |
timezone | string | Timezone for scheduling |
Example Requests
Re-execute all contacts immediately:{
"contact_selection": "all",
"schedule_settings": {
"schedule_type": "immediate"
}
}
{
"contact_selection": "failed_only",
"schedule_settings": {
"schedule_type": "scheduled",
"scheduled_at": "2024-02-15T09:00:00",
"timezone": "America/New_York"
}
}
{
"contact_selection": [101, 102, 103],
"schedule_settings": {
"schedule_type": "immediate"
}
}
Response
Response (Immediate)
{
"success": true,
"message": "Campaign ready for re-execution with 150 contacts",
"campaign_id": 42,
"contacts_reset": 150,
"schedule_type": "immediate",
"status": "draft"
}
Response (Scheduled)
{
"success": true,
"message": "Campaign scheduled for re-execution at 2024-02-15 09:00:00 UTC with 50 contacts",
"campaign_id": 42,
"contacts_reset": 50,
"schedule_type": "once",
"status": "scheduled",
"scheduled_time": "2024-02-15T09:00:00Z"
}
Example Code
cURL
curl -X POST "https://api.burki.dev/api/v1/campaigns/42/re-execute" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact_selection": "failed_only",
"schedule_settings": {
"schedule_type": "immediate"
}
}'
Python
import requests
response = requests.post(
"https://api.burki.dev/api/v1/campaigns/42/re-execute",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"contact_selection": "failed_only",
"schedule_settings": {
"schedule_type": "immediate"
}
}
)
result = response.json()
print(f"Reset {result['contacts_reset']} contacts for re-execution")
JavaScript
const response = await fetch("https://api.burki.dev/api/v1/campaigns/42/re-execute", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
contact_selection: "failed_only",
schedule_settings: {
schedule_type: "immediate"
}
})
});
const result = await response.json();
console.log(`Reset ${result.contacts_reset} contacts for re-execution`);
Behavior
When re-executing a campaign:- Selected contacts are reset to
pendingstatus - Non-selected contacts are marked as
skipped - Campaign counters are reset to 0
- Metrics are cleared for fresh tracking
- Execution history is preserved for audit
- Campaign status becomes
draft(immediate) orscheduled
Error Responses
| Status Code | Description |
|---|---|
| 400 | Campaign status doesn’t allow re-execution |
| 400 | No contacts match the selection criteria |
| 400 | Scheduled time is in the past |
| 404 | Campaign not found |
Valid Starting Statuses
Re-execution is only available for:completed- All contacts processedcancelled- Campaign was stoppedfailed- Campaign encountered an error
⌘I