Skip to main content
POST
/
api
/
v1
/
campaigns
Create Campaign
curl --request POST \
  --url https://api.example.com/api/v1/campaigns/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "steps": [
    {
      "step": 2,
      "delay_days": 1,
      "channel": "email",
      "variants": [
        {
          "label": "<string>",
          "weight": 50,
          "type": "TEMPLATE",
          "template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "sender_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
        }
      ],
      "ai_personalization_enabled": true,
      "track_clicks": false,
      "action_type": "connection_request",
      "message_template": "<string>"
    }
  ],
  "description": "<string>",
  "type": "email",
  "alias_ids": [
    "<string>"
  ],
  "connected_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "launch_type": "immediate",
  "start_date": "2023-11-07T05:31:56Z",
  "daily_limit": 500,
  "sending_window_start": "09:00:00",
  "sending_window_end": "17:00:00",
  "min_interval_seconds": 300,
  "timezone": "UTC",
  "send_days": [
    "<string>"
  ],
  "system_prompt": "<string>",
  "unreviewed_launch_policy": "launch_default"
}
'
{
  "campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "type": "<string>",
  "status": "draft",
  "launch_type": "immediate",
  "daily_limit": 123,
  "sending_window_start": "<string>",
  "sending_window_end": "<string>",
  "min_interval_seconds": 123,
  "timezone": "<string>",
  "steps_config": [
    {
      "step": 2,
      "delay_days": 1,
      "channel": "email",
      "variants": [
        {
          "label": "<string>",
          "weight": 50,
          "type": "TEMPLATE",
          "template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "sender_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
        }
      ],
      "ai_personalization_enabled": true,
      "track_clicks": false,
      "action_type": "connection_request",
      "message_template": "<string>"
    }
  ],
  "send_days": [
    "<string>"
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "description": "<string>",
  "start_date": "2023-11-07T05:31:56Z",
  "alias_ids": [
    "<string>"
  ],
  "connected_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "total_leads": 123,
  "processed_leads": 0,
  "launch_job_id": "<string>",
  "launch_requested_at": "2023-11-07T05:31:56Z",
  "launch_error": "<string>",
  "system_prompt": "<string>",
  "unreviewed_launch_policy": "launch_default",
  "paused_reason": "<string>",
  "playground_discovery_dismissed_at": "2023-11-07T05:31:56Z"
}

Documentation Index

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

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

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request model for creating a campaign.

name
string
required

Campaign name

Required string length: 1 - 255
dataset_id
string<uuid>
required

Dataset containing leads

steps
CampaignStepConfig · object[]
required

Campaign steps configuration

Required array length: 1 - 10 elements
description
string | null

Campaign description

Maximum string length: 1000
type
enum<string>
default:email

Campaign type (email, linkedin, or mixed)

Available options:
email,
linkedin,
mixed
alias_ids
string[] | null

Bavimail alias IDs for sending (required for email campaigns)

connected_account_id
string<uuid> | null

Connected account ID (required for linkedin campaigns)

launch_type
enum<string>
default:immediate

Launch type (immediate or scheduled)

Available options:
immediate,
scheduled
start_date
string<date-time> | null

Scheduled start date (required if launch_type=scheduled)

daily_limit
integer
default:500

Max actions per day

Required range: 1 <= x <= 10000
sending_window_start
string<time>
default:09:00:00

Daily sending window start (UTC)

sending_window_end
string<time>
default:17:00:00

Daily sending window end (UTC)

min_interval_seconds
integer
default:300

Minimum seconds between actions

Required range: 60 <= x <= 3600
timezone
string
default:UTC

Timezone for sending window interpretation

send_days
string[]

Days of week to send (3-letter lowercase abbreviations)

system_prompt
string | null

Campaign-level personalization prompt override. When set, the email pipeline resolver uses this in preference to sender_data.custom_prompt. NULL = fall through to sender-level custom_prompt or DEFAULT.

Required string length: 100 - 5000
unreviewed_launch_policy
enum<string>
default:launch_default

Policy applied at scheduled launch time when the campaign uses AI personalization and the user never reviewed drafts in the playground. launch_default = regenerate at send; hold = pause + notify; cancel = revert to draft + notify.

Available options:
launch_default,
hold,
cancel

Response

Successful Response

Response model for campaign.

campaign_id
string<uuid>
required

Unique campaign identifier

user_id
string<uuid>
required

Owner user ID

dataset_id
string<uuid>
required

Associated dataset ID

name
string
required

Campaign name

type
string
required

Campaign type (email, linkedin, mixed)

status
enum<string>
required

Current campaign status

Available options:
draft,
launching,
scheduled,
active,
draining,
paused,
completed,
failed
launch_type
enum<string>
required

Launch type

Available options:
immediate,
scheduled
daily_limit
integer
required

Max actions per day

sending_window_start
string<time>
required

Daily sending window start

sending_window_end
string<time>
required

Daily sending window end

min_interval_seconds
integer
required

Min seconds between actions

timezone
string
required

Timezone for sending window

steps_config
CampaignStepConfig · object[]
required

Steps configuration

send_days
string[]
required

Days of week to send

created_at
string<date-time>
required

Creation timestamp

updated_at
string<date-time>
required

Last update timestamp

description
string | null

Campaign description

start_date
string<date-time> | null

Scheduled start date

alias_ids
string[] | null

Bavimail alias IDs

connected_account_id
string<uuid> | null

Connected account for LinkedIn

total_leads
integer | null

Total leads in campaign

processed_leads
integer
default:0

Leads not in pending/active status

launch_job_id
string | null

ARQ job ID for background launch

launch_requested_at
string<date-time> | null

When launch was requested

launch_error
string | null

Error message if launch failed

system_prompt
string | null

Campaign-level personalization prompt override (migration 108).

unreviewed_launch_policy
enum<string>
default:launch_default

Policy for scheduled launch without playground review (migration 108).

Available options:
launch_default,
hold,
cancel
paused_reason
string | null

Reason the campaign is paused, e.g. 'pending_personalization_review' (migration 108).

playground_discovery_dismissed_at
string<date-time> | null

When the owner dismissed the playground discovery banner (migration 108).