Messaging

Audiences

Saved contact lists you can reuse across broadcast batches. Static by design: create the list, target it with audience_id, and keep campaign automation out of the messaging API.

Create an audience

POST/v1/audiences
curl https://api.tyxter.com/v1/audiences \
  -H "authorization: Bearer $TYXTER_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "name": "April launch",
    "description": "Customers who opted in during March",
    "contact_ids": ["ct_...", "ct_..."]
  }'

Every contact id must belong to the same environment as the API key. Cross-environment ids are reported as missing.

Send to an audience

POST/v1/batches
curl https://api.tyxter.com/v1/batches \
  -H "authorization: Bearer $TYXTER_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "name": "April promo",
    "from": "pn_...",
    "template": { "name": "promo_april", "language": "pt_BR" },
    "audience_id": "aud_..."
  }'

Tyxter snapshots the audience's contact ids when the batch is created. Later audience edits do not change already-created batches.

Audiences store contact ids only. Contact phone numbers and consent state stay owned by the Contacts module, and outbound sends still check opt-out status at enqueue time.