Skip to main content
POST
/
v1
/
campaigns
/
:id
/
start
Start Campaign
curl --request POST \
  --url https://api.example.com/v1/campaigns/:id/start
{
  "data": {
    "campaign_id": "<string>",
    "status": "<string>",
    "task_id": "<string>"
  }
}

Request

Path Parameters

id
string
required
Campaign UUID

Headers

Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json

Response

data
object
curl -X POST \
  https://nbkxaqxwvkgbddekwsma.supabase.co/functions/v1/api-gateway/v1/campaigns/campaign-uuid/start \
  -H "Authorization: Bearer wbk_your_api_key_here" \
  -H "Content-Type: application/json"

Example Response (Approval Required)

{
  "data": {
    "campaign_id": "campaign-uuid",
    "status": "pending_approval",
    "task_id": "lexi-task-uuid"
  }
}

Example Response (Auto-Started)

{
  "data": {
    "campaign_id": "campaign-uuid",
    "status": "active",
    "task_id": null
  }
}

Approval Workflow

When a campaign requires approval:
  1. Start the campaign → status becomes pending_approval
  2. Lexi reviews the campaign (template, target list, timing)
  3. You approve or dismiss via the Lexi tasks endpoints
  4. Campaign launches after approval

Check Approval Status

# Poll for task status
tasks_response = requests.get(
    f"{BASE_URL}/v1/lexi/tasks",
    headers=headers,
    params={"status": "pending"}
)
tasks = tasks_response.json()["data"]["tasks"]

for task in tasks:
    if task["type"] == "campaign_start":
        print(f"Campaign {task['metadata']['campaign_id']} awaiting approval")

Approve the Campaign

# Approve the task to launch the campaign
task_id = "lexi-task-uuid"
requests.post(
    f"{BASE_URL}/v1/lexi/tasks/{task_id}/approve",
    headers=headers
)
print("Campaign approved and launching!")

Auto-Start vs Manual Approval

Whether a campaign requires Lexi approval depends on your workspace settings. By default, campaigns with >100 recipients require approval.

Errors

StatusCodeDescription
400validation_errorCampaign is empty or already running
401invalid_keyInvalid API key
403insufficient_permissionsMissing write permission
404not_foundCampaign not found
429rate_limitedRate limit exceeded

Example Error (Campaign Already Running)

{
  "error": {
    "code": "validation_error",
    "message": "Campaign is already active"
  }
}