Skip to main content
Retrieve a paginated list of execution records for a campaign. Each execution represents a single contact attempt (call or SMS).

Path Parameters

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

Query Parameters

  • page (integer, optional, default: 1): Page number for pagination
  • per_page (integer, optional, default: 50, max: 1000): Results per page

Response

Response
{
  "executions": [
    {
      "id": 1001,
      "execution_id": 1001,
      "contact_id": 101,
      "contact_name": "John Smith",
      "contact_phone": "+15551234567",
      "status": "completed",
      "call_id": "CA123abc456def789ghi",
      "sms_id": null,
      "executed_at": "2024-02-15T14:29:30Z",
      "execution_data": {
        "from_number": "+15550001234",
        "to_number": "+15551234567",
        "personalized_welcome_message": "Hi John, this is Sarah from Acme Healthcare.",
        "template_variables_used": {
          "name": "John Smith",
          "appointment_date": "February 15th"
        },
        "duration_seconds": 45,
        "voice_analytics": {
          "sentiment_score": 0.85
        }
      }
    },
    {
      "id": 1000,
      "execution_id": 1000,
      "contact_id": 102,
      "contact_name": "Jane Doe",
      "contact_phone": "+15559876543",
      "status": "no_answer",
      "call_id": "CA789ghi012jkl345mno",
      "sms_id": null,
      "executed_at": "2024-02-15T14:28:45Z",
      "execution_data": {
        "from_number": "+15550001234",
        "to_number": "+15559876543",
        "error_details": "No answer after 30 seconds",
        "retry_reason": "Will retry in 30 minutes"
      }
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 50,
    "total_items": 350,
    "total_pages": 7,
    "has_next": true,
    "has_prev": false
  }
}

Response Fields

Execution Object

FieldDescription
idExecution record ID
execution_idSame as id (for compatibility)
contact_idAssociated contact ID
contact_nameContact’s name
contact_phoneContact’s phone number
statusExecution status
call_idTwilio/Telnyx Call SID (for calls)
sms_idSMS message ID (for SMS)
executed_atExecution timestamp
execution_dataDetailed execution information

Execution Data Object

FieldDescription
from_numberOutbound caller ID
to_numberRecipient phone number
personalized_welcome_messageRendered welcome message
personalized_agendaRendered agenda (if set)
template_variables_usedVariables and values used
duration_secondsCall duration
error_detailsError description (if failed)
retry_reasonRetry information
voice_analyticsVoice analysis results

Execution Statuses

StatusDescription
pendingQueued for execution
in_progressCurrently executing
completedSuccessfully completed
failedExecution failed
no_answerCall not answered
busyLine was busy
voicemailReached voicemail
skippedSkipped execution

Example Code

cURL
curl -X GET "https://api.burki.dev/api/v1/campaigns/42/executions?page=1&per_page=100" \
  -H "Authorization: Bearer YOUR_API_KEY"
Python
import requests

def get_all_executions(campaign_id, api_key):
    """Fetch all executions with pagination."""
    executions = []
    page = 1
    
    while True:
        response = requests.get(
            f"https://api.burki.dev/api/v1/campaigns/{campaign_id}/executions",
            params={"page": page, "per_page": 100},
            headers={"Authorization": f"Bearer {api_key}"}
        )
        
        data = response.json()
        executions.extend(data["executions"])
        
        if not data["pagination"]["has_next"]:
            break
        page += 1
    
    return executions

# Get all executions
all_executions = get_all_executions(42, "YOUR_API_KEY")

# Analyze results
completed = [e for e in all_executions if e["status"] == "completed"]
failed = [e for e in all_executions if e["status"] in ["failed", "no_answer"]]

print(f"Total executions: {len(all_executions)}")
print(f"Completed: {len(completed)}")
print(f"Failed/No Answer: {len(failed)}")
JavaScript
async function getAllExecutions(campaignId, apiKey) {
  const executions = [];
  let page = 1;
  
  while (true) {
    const response = await fetch(
      `https://api.burki.dev/api/v1/campaigns/${campaignId}/executions?page=${page}&per_page=100`,
      {
        headers: { "Authorization": `Bearer ${apiKey}` }
      }
    );
    
    const data = await response.json();
    executions.push(...data.executions);
    
    if (!data.pagination.has_next) break;
    page++;
  }
  
  return executions;
}

// Get and analyze
const executions = await getAllExecutions(42, "YOUR_API_KEY");
const completed = executions.filter(e => e.status === "completed");
console.log(`Success rate: ${(completed.length / executions.length * 100).toFixed(1)}%`);

Use Cases

  • Audit trail: Review all contact attempts
  • Analytics: Calculate custom metrics
  • Debugging: Investigate failed calls
  • Export: Extract data for external analysis
  • Compliance: Track contact history

Error Responses

Status CodeDescription
404Campaign not found
401Unauthorized