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.mailer.quathos.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.mailer.quathos.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.mailer.quathos.com/api/v1/campaigns/$ID/start \
  -H "Authorization: Bearer $QUATHOS_TOKEN"

# em andamento: pausa, retoma ou cancela
curl -X POST https://api.mailer.quathos.com/api/v1/campaigns/$ID/pause  -H "Authorization: Bearer $QUATHOS_TOKEN"
curl -X POST https://api.mailer.quathos.com/api/v1/campaigns/$ID/resume -H "Authorization: Bearer $QUATHOS_TOKEN"
curl -X POST https://api.mailer.quathos.com/api/v1/campaigns/$ID/cancel -H "Authorization: Bearer $QUATHOS_TOKEN"
The status is what the API returns. validate, start, pause, resume and cancel are your calls; everything else happens on its own. What already went out stays out.validatestartbatchesvalidate againstart · scheduled_attime reachedpauseresumeerrorcancel, from any state that has not finishedDRAFTVALIDATINGREADYPROCESSINGCOMPLETEDSCHEDULEDPAUSEDFAILEDCANCELLED
The status is what the API returns. validate, start, pause, resume and cancel are your calls; everything else happens on its own. What already went out stays out.
StatusWhat it means
DRAFTCreated, audience not resolved yet.
VALIDATINGResolving the audience.
READYAudience counted, waiting for you to start it.
SCHEDULEDStart time set, waiting for the clock.
PROCESSINGGoing out in batches.
PAUSEDStopped mid-flight. Resume picks up where it left off.
COMPLETEDEvery batch dispatched.
CANCELLEDStopped for good. What already went out stays out.
FAILEDThe run could not continue because the template it was pinned to no longer exists. 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.