Campaigns
Send one template to a contact list, with the audience counted and explained before anything goes out.
Create a campaign
A campaign points at a list and a template. It is created as a DRAFT — creating it sends nothing.
cURL
curl -X POST https://api.qsendyx.com/api/v1/campaigns \
-H "Authorization: Bearer $QUATHOS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "March newsletter",
"channel": "email",
"list_id": "0195f0b2-...",
"template_id": "0195f0c4-...",
"sender": "news@yourcompany.com"
}'Campaigns are marketing, and marketing is separated from transactional down at the schema level. Mixing the two shares a sending reputation between a newsletter and your password resets, and there is no undoing that.
Count the audience first
POST /campaigns/{id}/validate resolves who will actually receive it, and returns the arithmetic that got there.
cURL
curl -X POST https://api.qsendyx.com/api/v1/campaigns/$ID/validate \
-H "Authorization: Bearer $QUATHOS_TOKEN"
{
"audience_size": 62143,
"breakdown": {
"total_in_list": 100000,
"eligible": 62143,
"removed_total": 37857,
"removed_no_address": 1204,
"removed_inactive": 12030,
"removed_suppressed": 3891,
"removed_no_consent": 20732
}
}The breakdown is the point. "62k out of 100k" with no explanation reads as though we lost your list; the same number with four lines under it reads as what it is — contacts with no address, inactive ones, people on your suppression list, and people who never consented.
Start, pause, resume, cancel
cURL
curl -X POST https://api.qsendyx.com/api/v1/campaigns/$ID/start \
-H "Authorization: Bearer $QUATHOS_TOKEN"
# em andamento: pausa, retoma ou cancela
curl -X POST https://api.qsendyx.com/api/v1/campaigns/$ID/pause -H "Authorization: Bearer $QUATHOS_TOKEN"
curl -X POST https://api.qsendyx.com/api/v1/campaigns/$ID/resume -H "Authorization: Bearer $QUATHOS_TOKEN"
curl -X POST https://api.qsendyx.com/api/v1/campaigns/$ID/cancel -H "Authorization: Bearer $QUATHOS_TOKEN"| Status | What it means |
|---|---|
| DRAFT | Created, audience not resolved yet. |
| VALIDATING | Resolving the audience. |
| READY | Audience counted, waiting for you to start it. |
| SCHEDULED | Start time set, waiting for the clock. |
| PROCESSING | Going out in batches. |
| PAUSED | Stopped mid-flight. Resume picks up where it left off. |
| COMPLETED | Every batch dispatched. |
| CANCELLED | Stopped for good. What already went out stays out. |
Pause stops the batches that have not been dispatched yet. It cannot recall a message a provider already accepted — nothing can.