Guides

Audiences

Static contact lists — create one, manage membership in bulk, and feed it to a broadcast or an automation trigger.

An audience is a static list of contacts you maintain explicitly. That is the difference from a segment, which is a filter evaluated on demand: an audience holds exactly whoever you put in it.

Create one

curl https://api.emitd.com/v1/audiences \
  -H "Authorization: Bearer $EMITD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Beta testers", "description": "Early access cohort" }'

A blank name is rejected with 422.

The create response is narrower than the read

POST /v1/audiences omits created_at and updated_at from its 201 body. Fetch the audience with GET /v1/audiences/{id} if you need them — don't expect them on the create.

Membership

ActionEndpoint
Add one contactPOST /v1/audiences/{id}/members
Add many at oncePOST /v1/audiences/{id}/members/bulk
List membersGET /v1/audiences/{id}/members
Remove a contactDELETE /v1/audiences/{id}/members/{contact_id}

Adding one contact takes { "contact_id": "con_8Qd21k" }. Like automation enrollment, it is idempotent: a contact already in the audience returns 200 rather than erroring, so the call is safe to retry.

Prefer the bulk endpoint whenever you are adding more than a couple of contacts — one request instead of N, up to 100 ids per call:

curl https://api.emitd.com/v1/audiences/$ID/members/bulk \
  -H "Authorization: Bearer $EMITD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "contact_ids": ["con_8Qd21k", "con_3Jf90x", "con_1Zb44m"] }'

Chunk anything larger than 100 client-side.

Pagination

GET /v1/audiences is a newest-first keyset page over (created_at, id). The next_cursor is a "{created_at}:{id}" string — pass it back as cursor to get the next page, and stop when it comes back null.

curl "https://api.emitd.com/v1/audiences?limit=50&cursor=1759881600000:aud_7Kp2" \
  -H "Authorization: Bearer $EMITD_API_KEY"

Note this cursor is a composite string, unlike the bare epoch-millisecond cursor used by inbound. Treat every next_cursor as an opaque token you pass back verbatim rather than something you build.

What an audience feeds

  • Broadcasts — send one message to the whole list.
  • Automations — an audience_added trigger enrolls a contact the moment it joins the audience. Pass the audience id as trigger_config.audience_id.

Full schemas: Audiences API.

On this page