Run a manual bulk send
Goal: send one message to every lead matching a filter (an operator-driven blast, distinct from agent outreach).
# 1) Create the campaign — returns 202 with a queued artifact
curl -s https://api.sance.ai/v1/manual-sending-campaigns/ \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{
"product_id": 42,
"name": "June promo blast",
"source": { "text": "Hi {name}, our June promo is live!" },
"filter": { "product_id": 42, "stage_ids": [7], "is_active": true }
}'
# 2) Poll status + stats
curl -s "https://api.sance.ai/v1/manual-sending-campaigns/" -H "Authorization: Bearer $TOKEN"
What happens next: the API only creates a queued campaign. A background worker then
snapshots the leads matching filter and schedules the messages, so target_leads_count
stays 0 until the worker picks it up. The source is a message source (raw text, or a
prompt_id / prepared_message_id). Cancel a queued/running campaign with
POST /v1/manual-sending-campaigns/{id}/cancel (returns 409 if already finished);
already-scheduled, not-yet-sent messages are left to send.
See: POST /v1/manual-sending-campaigns/, GET /v1/manual-sending-campaigns/,
POST /v1/manual-sending-campaigns/{id}/cancel.