Skip to main content
POST
Playground Generate

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