Skip to main content
POST
/
api
/
v1
/
campaigns
/
{campaign_id}
/
playground
/
generate
Playground Generate
curl --request POST \
  --url https://api.example.com/api/v1/campaigns/{campaign_id}/playground/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "step_index": 16,
  "n_leads": 50,
  "custom_prompt": "<string>"
}
'
{
  "campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "step_index": 123,
  "batch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "enqueued_lead_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "prompt_version_hash": "<string>",
  "total": 123
}

Documentation Index

Fetch the complete documentation index at: https://bavlio.mintlify.app/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.

Path Parameters

campaign_id
string<uuid>
required

Body

application/json

POST /campaigns/{id}/playground/generate body.

Enqueues one ARQ task per target lead. Each call creates a fresh batch_id server-side — V1 does not coalesce spam-clicks; the client should debounce the button. The canonical idempotency tuple (campaign_id, campaign_lead_id, prompt_version_hash, batch_id) keeps duplicate workers no-op via the DB-authoritative cancel/batch check.

step_index
integer
required

Campaign step to generate drafts for.

Required range: 1 <= x <= 32
n_leads
integer
default:50

Number of PERSONALIZATION-assigned leads to enqueue.

Required range: 1 <= x <= 200
custom_prompt
string | null

Optional override prompt; else server resolves via campaign.system_prompt -> sender.custom_prompt -> DEFAULT.

Maximum string length: 32000

Response

Successful Response

Response from the batch-enqueue endpoint.

campaign_id
string<uuid>
required
step_index
integer
required
batch_id
string<uuid>
required
enqueued_lead_ids
string<uuid>[]
required
prompt_version_hash
string
required
total
integer
required