Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.getsmartalex.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The Campaigns API allows you to create, populate, and start outbound calling campaigns programmatically.

List Campaigns

Get all campaigns in your account.
curl -X GET "https://api.getsmartalex.com/v1/campaigns" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "data": [
    {
      "id": "campaign_abc123",
      "name": "January Outreach",
      "agent_id": "agent_def456",
      "status": "active",
      "objective": "Schedule appointments",
      "created_at": "2026-01-15T10:30:00Z"
    }
  ]
}

Get Campaign

Retrieve a single campaign.
curl -X GET "https://api.getsmartalex.com/v1/campaigns/campaign_abc123" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "data": {
    "id": "campaign_abc123",
    "name": "January Outreach",
    "description": "Q1 lead generation campaign",
    "objective": "Schedule appointments with qualified leads",
    "agent_id": "agent_def456",
    "phone_number_id": "phone_xyz789",
    "campaign_mode": "outbound",
    "status": "active",
    "timezone": "America/New_York",
    "business_hours": {
      "monday":    { "enabled": true, "start": "09:00", "end": "17:00" },
      "tuesday":   { "enabled": true, "start": "09:00", "end": "17:00" },
      "wednesday": { "enabled": true, "start": "09:00", "end": "17:00" },
      "thursday":  { "enabled": true, "start": "09:00", "end": "17:00" },
      "friday":    { "enabled": true, "start": "09:00", "end": "17:00" },
      "saturday":  { "enabled": false },
      "sunday":    { "enabled": false }
    },
    "created_at": "2026-01-15T10:30:00Z",
    "started_at": "2026-01-15T11:00:00Z"
  }
}

Create Campaign

Create a new outbound calling campaign.
curl -X POST "https://api.getsmartalex.com/v1/campaigns" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "February Outreach",
    "description": "Follow-up campaign",
    "objective": "Confirm appointments for next week",
    "agent_id": "agent_def456",
    "phone_number_id": "phone_xyz789",
    "timezone": "America/New_York",
    "business_hours": {
      "monday":    { "enabled": true, "start": "10:00", "end": "16:00" },
      "tuesday":   { "enabled": true, "start": "10:00", "end": "16:00" },
      "wednesday": { "enabled": true, "start": "10:00", "end": "16:00" },
      "thursday":  { "enabled": true, "start": "10:00", "end": "16:00" },
      "friday":    { "enabled": true, "start": "10:00", "end": "16:00" }
    }
  }'

Parameters

ParameterTypeRequiredDescription
namestringYesCampaign name
campaign_modestringNoCampaign mode (e.g. outbound)
agent_idUUIDNoAgent that will make the calls
objectivestringNoWhat the agent should accomplish
descriptionstringNoInternal description
phone_number_idUUIDNoPhone number to dial from
timezonestringNoIANA timezone for business hours (e.g. America/New_York)
business_hoursobjectNoDay-by-day calling windows (see below)

Business hours object

Each weekday key (monday through sunday) takes:
FieldTypeDescription
enabledbooleanWhether to dial on this day
startstringEarliest call time, HH:MM 24-hour
endstringLatest call time, HH:MM 24-hour

Add Contacts to Campaign

Add existing contacts to a campaign by their IDs. Up to 100 contacts per request.
curl -X POST "https://api.getsmartalex.com/v1/campaigns/campaign_abc123/contacts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contact_ids": [
      "contact_abc123",
      "contact_def456"
    ]
  }'

Parameters

ParameterTypeRequiredDescription
contact_idsarray of UUIDsYesContact IDs to add (1 to 100 per call)
Create contacts first via the Contacts API and then add them to a campaign by their id.

Start Campaign

Start a campaign to begin making calls.
curl -X POST "https://api.getsmartalex.com/v1/campaigns/campaign_abc123/start" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "data": {
    "id": "campaign_abc123",
    "status": "active",
    "started_at": "2026-04-28T10:00:00Z"
  }
}

Pausing, resuming, and cancelling

To change a campaign’s state after it has started, use the dashboard’s campaign detail page. Programmatic pause/resume/cancel endpoints are not currently exposed in the public API — contact support if you need them.

Campaign Status

StatusDescription
draftCreated but not started
scheduledConfigured to start at a future time
activeCurrently making calls
pausedTemporarily stopped (e.g. insufficient wallet balance)
completedAll contacts processed
cancelledManually stopped

Error Codes

CodeDescription
campaign_not_foundCampaign ID doesn’t exist
agent_not_foundSpecified agent doesn’t exist
no_contactsCampaign has no contacts to call