Skip to main content
POST
/
v1
/
campaigns
Create Campaign
curl --request POST \
  --url https://api.example.com/v1/campaigns \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "list_id": "<string>",
  "template": "<string>"
}
'
{
  "data": {
    "id": "<string>",
    "name": "<string>",
    "status": "<string>",
    "list_id": "<string>",
    "created_at": "<string>"
  }
}

Request

Headers

Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json

Body Parameters

name
string
required
Campaign name
list_id
string
required
UUID of the target contact list
template
string
required
Email template text (supports variables: {{name}}, {{company}}, {{title}})

Response

data
object
The created campaign object
curl -X POST \
  https://nbkxaqxwvkgbddekwsma.supabase.co/functions/v1/api-gateway/v1/campaigns \
  -H "Authorization: Bearer wbk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Q2 Outreach",
    "list_id": "list-uuid-here",
    "template": "Hi {{name}}, I noticed your work at {{company}}..."
  }'

Example Response

{
  "data": {
    "id": "new-campaign-uuid",
    "name": "Q2 Outreach",
    "status": "draft",
    "list_id": "list-uuid-here",
    "created_at": "2026-02-24T16:00:00Z"
  }
}

Template Variables

Use these variables in your template to personalize emails:
VariableDescriptionExample
{{name}}Contact’s first nameJohn
{{full_name}}Contact’s full nameJohn Smith
{{company}}Company nameAcme Corp
{{title}}Job titleCEO

Example Template

Hi {{name}},

I noticed you're the {{title}} at {{company}}. I wanted to reach out because...

Best regards,
Your Name

Next Steps

After creating a campaign:
  1. Review the draft in your dashboard
  2. Use the Start Campaign endpoint to launch it
  3. Or send it to Lexi AI for automated optimization

Errors

StatusCodeDescription
400validation_errorMissing required fields or invalid list ID
401invalid_keyInvalid API key
403insufficient_permissionsMissing write permission
404not_foundList not found
429rate_limitedRate limit exceeded