Skip to main content
Re-execute a completed, cancelled, or failed campaign with flexible contact selection and scheduling options.

Path Parameters

  • campaign_id (integer, required): The unique identifier of the campaign

Request Body

FieldTypeRequiredDescription
contact_selectionstring or arrayYesWhich contacts to include
schedule_settingsobjectNoScheduling configuration

Contact Selection Options

ValueDescription
"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"
  }
}
FieldTypeDescription
schedule_typestringimmediate, scheduled, or recurring
scheduled_atstringISO 8601 datetime for scheduled type
timezonestringTimezone for scheduling

Example Requests

Re-execute all contacts immediately:
{
  "contact_selection": "all",
  "schedule_settings": {
    "schedule_type": "immediate"
  }
}
Retry only failed contacts:
{
  "contact_selection": "failed_only",
  "schedule_settings": {
    "schedule_type": "scheduled",
    "scheduled_at": "2024-02-15T09:00:00",
    "timezone": "America/New_York"
  }
}
Retry specific contacts:
{
  "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:
  1. Selected contacts are reset to pending status
  2. Non-selected contacts are marked as skipped
  3. Campaign counters are reset to 0
  4. Metrics are cleared for fresh tracking
  5. Execution history is preserved for audit
  6. Campaign status becomes draft (immediate) or scheduled

Error Responses

Status CodeDescription
400Campaign status doesn’t allow re-execution
400No contacts match the selection criteria
400Scheduled time is in the past
404Campaign not found

Valid Starting Statuses

Re-execution is only available for:
  • completed - All contacts processed
  • cancelled - Campaign was stopped
  • failed - Campaign encountered an error