Skip to content
Browse documentation
On this page

Audiences API

Read, count and list saved audiences, create and edit them, and make call lists from them through the Dialstitch API.

Read your saved audiences, count who matches, list the matching contacts and make call lists from them through the Dialstitch API. An audience here is the same as in the app: a saved, live question about your contacts. Reading and counting needs audiences:read. Listing the matching contacts also needs contacts:read, since it returns contact details. Creating, editing, archiving and making call lists needs audiences:write, and making a call list also needs call_lists:write.

Who a key acts as

A key acts as the person who created it, with their role in the team today. Only owners and admins can create keys, so a key normally has an admin's access: it can create, edit and archive audiences, and count rules that aren't saved.

  • If that person is now a member, the key has a member's access. It can read saved audiences, and count them, list their contacts and make call lists from them, always with the saved rules. Call history, text, callback and account health rules only count what that person can see in the app.
  • If that person has left the team, or their account is suspended or deleted, the key can't use audiences: every audience request gets 403 with the code key_owner_not_member, before anything else in the request is checked. Create a new key.
  • If the key doesn't record who created it, every audience request gets 403 with the code key_owner_unknown. Create a new key.

The audience object

{
  "id": "3f6d2c1a-8b7e-4c5d-9a0b-1c2d3e4f5a6b",
  "name": "Prospects not called in 14 days",
  "description": "Tagged prospect, never reached",
  "summary": "Tags is any of prospect and ever reached is no and Last call is not in the last 14 days",
  "definition": {
    "v": 1,
    "logic": "all",
    "conditions": [
      {
        "field": "tag",
        "op": "in",
        "values": [
          "prospect"
        ]
      },
      {
        "field": "ever_reached",
        "op": "is_false"
      },
      {
        "field": "last_call",
        "op": "not_in_last_days",
        "value": 14
      }
    ]
  },
  "created_by": {
    "id": 12,
    "name": "Sam Rivera"
  },
  "created_at": "2026-11-10T16:20:00.000Z",
  "updated_at": "2026-11-11T09:05:00.000Z",
  "archived_at": null
}
  • summary: the rules in plain English, as the Audiences page shows them.
  • definition: the rules themselves. See Rules below.
  • archived_at: set once it is archived. Archived audiences still open by id, so lists made from them keep their link.

List audiences

GET /audiences

Your team's audiences, newest first.

  • limit and cursor: pagination, as in the API overview.
  • archived: true lists archived audiences instead. The default is false.

Get an audience

GET /audiences/{id}

One audience, archived or not, with its rules and summary.

Create an audience

POST /audiences
{
  "name": "Prospects not called in 14 days",
  "description": "Tagged prospect, never reached",
  "definition": {
    "v": 1,
    "logic": "all",
    "conditions": [
      {
        "field": "tag",
        "op": "in",
        "values": [
          "prospect"
        ]
      },
      {
        "field": "ever_reached",
        "op": "is_false"
      },
      {
        "field": "last_call",
        "op": "not_in_last_days",
        "value": 14
      }
    ]
  }
}

Owners' and admins' keys only. name (up to 200 characters, unique among your live audiences) and definition are required; description is up to 500 characters. The rules are checked exactly as the builder checks them. Returns 201 with the audience.

  • Send an Idempotency-Key header (1 to 100 letters, digits, or . _ : -) to retry safely: a retry with the same key and the same name, description and rules returns the audience the first request created, with 200. Two copies sent at once still make one audience. The same key with a different name, description or rules gets 422 idempotency_key_reused. Each key has its own Idempotency-Keys.
  • Rules that aren't complete or can't be run get 400 with the code invalid_definition, and an errors list saying where (path, message, kind). Nothing is saved.
  • A name another live audience has gets 409 duplicate_name. A member's key gets 403 forbidden.
{
  "error": {
    "code": "invalid_definition",
    "message": "\"Company\" needs a value."
  },
  "errors": [
    {
      "path": "conditions[1]",
      "message": "\"Company\" needs a value.",
      "kind": "incomplete"
    }
  ]
}

Update an audience

PATCH /audiences/{id}

Owners' and admins' keys only. Send any of name, description (null clears it) and definition; what you leave out stays. The same checks as creating apply. An archived audience can't be changed (409 archived).

Archive an audience

DELETE /audiences/{id}

Owners' and admins' keys only. Archives it and returns 204. Call lists made from it stay as they are. Archiving an audience that's already archived also returns 204.

Count an audience

POST /audiences/count
{
  "id": "3f6d2c1a-8b7e-4c5d-9a0b-1c2d3e4f5a6b"
}

How many contacts match right now. Send id for a saved audience, or definition to try rules without saving them (owners' and admins' keys only; a member's key gets 403). It is the same count as the badge in the app: numbers on your do-not-call list are left out, so a contact counts only if they have a number you can call.

{
  "data": {
    "count": 214,
    "failed_closed": false
  }
}

Rules that can't be run, such as an unknown field or a missing value, match no one. They return a count of 0 with failed_closed: true and reasons saying why, never a bare 0. If the count takes too long you get 503 too_slow: narrow the rules and try again. If the audience can't be run right now you get 500 audience_failed: try again in a moment.

Each count and each page of matching contacts runs the whole audience, so a key can make at most 10 of them a minute, together. Past that you get 429 rate_limited with a Retry-After header (seconds). This is on top of the API's own limit per key.

{
  "data": {
    "count": 0,
    "failed_closed": true,
    "reasons": [
      "conditions[0]: \"lead_score\" isn't something an audience can filter on (it may have been removed)."
    ]
  }
}

List the matching contacts

GET /audiences/{id}/contacts

The contacts a saved audience matches, in name order, with the same columns as the preview: name, company, the numbers that aren't on your do-not-call list, tags, last call and last disposition, plus a value for each field the rules use. It uses the same rules as the count, so the pages together hold exactly count contacts. limit (1 to 100, default 25) and cursor page through them. Needs contacts:read as well as audiences:read. Pages count toward the 10 a minute shared with counts. Reading the first page is recorded in your team's activity log as an export of the audience, like downloading its CSV in the app.

{
  "data": [
    {
      "id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
      "name": "Ana Lopez",
      "company": "Lopez Roofing",
      "phones": [
        "+16045550123"
      ],
      "tags": [
        "prospect"
      ],
      "last_call_at": "2026-10-21T18:02:11.000Z",
      "last_disposition": "No answer",
      "fields": {
        "ever_reached": "No"
      }
    }
  ],
  "next_cursor": "WyJhbmEgbG9wZXoiLCI5YThiN2M2ZCJd",
  "columns": [
    {
      "key": "ever_reached",
      "label": "Ever reached",
      "type": "bool"
    }
  ],
  "failed_closed": false
}

Make a call list from an audience

POST /audiences/{id}/call-list
{
  "name": "Prospects – 2026-11-11",
  "number_choice": "mobile_first"
}

Makes a new call list from the saved audience: a snapshot of who matches now, one entry per contact. Every number goes through the same do-not-call, outbound number and duplicate checks as any other add. Needs audiences:write and call_lists:write. Members' keys can do this too, with the saved rules and their own visibility.

  • name: up to 100 characters. The default is the audience's name and today's date.
  • description: optional, up to 1,000 characters.
  • number_choice: which number to dial for each contact. mobile_first (the default), main_first, primary (their primary number), first_added, or all (one entry per number).

mode: snapshot (the default) or live. A live list also adds the audience's new matches every 15 minutes and never removes anyone. It stops when the list or the audience is archived, or when it's turned off in the app. GET /audiences/{id}/call-list shows live: true for a list that is still adding.

Up to 1,000 matches are added during the request, and you get 201 with the counts:

{
  "data": {
    "call_list_id": "7b1e2c3d-4f5a-4b6c-8d7e-9f0a1b2c3d4e",
    "name": "Prospects – 2026-11-11",
    "audience_id": "3f6d2c1a-8b7e-4c5d-9a0b-1c2d3e4f5a6b",
    "status": "ready",
    "matched": 214,
    "added": 209,
    "left_out": 5
  }
}

left_out counts contacts that matched but whose numbers are all on the do-not-call list or can't be dialled. Larger audiences are built in the background: you get 202 with status: "building" and a job_id. The list shows up in GET /call-lists once it's finished, and whoever the key acts as gets a notification. Rules that can't be run, a count that takes too long, an archived audience, or no matches make nothing and return 422 with the code not_created.

Send an Idempotency-Key header (1 to 100 letters, digits, or . _ : -) to retry safely. A retry with the same key makes nothing new and answers the way the first request did, from the list as it is now: 201 with its counts once it's built, or 202 with its job_id while it's still being built (status: "failed" if the build gave up). Two copies sent at once still make one list. The same key on a different audience gets 422 idempotency_key_reused. Each key has its own Idempotency-Keys, separate from the ones for POST /call-lists.

GET /audiences/{id}/call-list

The call lists made from an audience, newest first (up to limit, default 25), each with its status: building, failed, ready or archived, and how many entries it has.

Rules

A definition is { "v": 1, "logic": "all" | "any", "conditions": [...] }. Each condition is a rule, { "field", "op", "value" } (or "values" for in and not_in), or a group, { "group": true, "logic", "conditions" }. Groups nest up to 3 levels, with at most 40 rules and groups in all and at most 10 call history, text and AI match rules. Rules with no value (is_empty, is_true, ...) leave value out.

  • Text: value is the text to compare, up to 200 characters, matched without regard to case.
  • Numbers: value is a number.
  • Dates: before and after take a date as YYYY-MM-DD (midnight in your team's time zone); in_last_days and not_in_last_days take a number of days.
  • Choices: value for is and is_not, values (up to 100) for in and not_in.
  • ai_matches (Notes and Call summaries): value is a question. It only reads answers saved by Run AI check in the app; the API never runs the AI check.

The simplest way to get a definition right is to build the audience in the app, then read it with GET /audiences/{id}. The fields and the operators each one takes:

Contact

  • name (Name, text): is, is_not, contains, not_contains, starts_with, is_empty, is_not_empty.
  • company (Company, text): is, is_not, contains, not_contains, starts_with, is_empty, is_not_empty.
  • notes (Notes, text): is, is_not, contains, not_contains, starts_with, is_empty, is_not_empty, ai_matches.
  • created (Created, date): before, after, in_last_days, not_in_last_days.
  • owner (Owner, choice): is, is_not, in, not_in, is_empty, is_not_empty. Values are user ids (GET /users).
  • favorite (Favorite, bool): is_true, is_false.
  • phone_label (Phone type, choice: primary, company, mobile, alternate): is, is_not, in, not_in.
  • phone_number (Phone number, text): contains, not_contains.
  • phone_count (Phone numbers, number): eq, neq, gt, gte, lt, lte.

Tags

  • tag (Tags, choice): is, is_not, in, not_in, is_empty, is_not_empty. Values are tag names (any capitals; a name a tag had before a rename or merge still matches) or tag ids (GET /tags).
  • conversation_tag (Conversation tag, choice): in, not_in. Values are tag names or ids, like tag.

Call history

  • last_call (Last call, date): before, after, in_last_days, not_in_last_days, is_empty, is_not_empty.
  • last_inbound (Last inbound call, date): before, after, in_last_days, not_in_last_days, is_empty, is_not_empty.
  • last_outbound (Last outbound call, date): before, after, in_last_days, not_in_last_days, is_empty, is_not_empty.
  • call_count (Calls, number): eq, neq, gt, gte, lt, lte.
  • call_count_30d (Calls in the last 30 days, number): eq, neq, gt, gte, lt, lte.
  • ever_reached (Ever reached, bool): is_true, is_false.
  • ever_reached_ai (Ever reached (counting the AI receptionist), bool): is_true, is_false.
  • last_reached (Last reached, date): before, after, in_last_days, not_in_last_days, is_empty, is_not_empty.
  • last_missed (Last missed call, date): before, after, in_last_days, not_in_last_days, is_empty, is_not_empty.
  • needs_callback (Needs a callback, bool): is_true, is_false.
  • last_disposition (Last disposition, choice): is, is_not, in, not_in, is_empty, is_not_empty. Values are disposition ids: copy them from an audience saved in the app.
  • ever_disposition (Ever had disposition, choice): in, not_in. Values are disposition ids: copy them from an audience saved in the app.
  • last_handled_by (Last handled by, choice): is, is_not, in, not_in, is_empty, is_not_empty. Values are user ids (GET /users).
  • ever_handled_by (Ever handled by, choice): is, is_not, in, not_in. Values are user ids (GET /users).
  • last_csat (Last call CSAT (AI, 1-5), number): eq, neq, gt, gte, lt, lte, is_empty, is_not_empty.
  • call_summaries (Call summaries, text): ai_matches.

Texts

  • last_text (Last text, date): before, after, in_last_days, not_in_last_days, is_empty, is_not_empty.
  • last_text_in (Last text from them, date): before, after, in_last_days, not_in_last_days, is_empty, is_not_empty.
  • replied (Ever texted us, bool): is_true, is_false.
  • sms_opted_out (Opted out of texts, bool): is_true, is_false.

Call lists

  • call_list (Call list, choice): is, is_not, in, not_in, is_empty, is_not_empty. Values are call list ids (GET /call-lists).
  • call_list_status (Status on call list, choice): is, is_not, in, not_in. Values: pending, in_progress, completed, skipped.
  • call_list_outcome (Outcome on call list, choice): is, is_not, in, not_in.
  • call_list_attempts (Attempts on call list, number): eq, neq, gt, gte, lt, lte.
  • call_list_tag (Call list tag, choice): in, not_in. Values are tag names or ids. In the same group as other call list fields, they apply to the same list.

Callbacks

  • open_callback (Has an open callback, bool): is_true, is_false.
  • callback_due (Next callback due, date): before, after, is_empty, is_not_empty.

Leads

  • is_lead (Is a lead, bool): is_true, is_false.
  • lead_source (Lead source, choice): is, is_not, in, not_in, is_empty, is_not_empty.
  • lead_status (Lead status, choice): is, is_not, in, not_in, is_empty, is_not_empty. Values: received, calling, waiting, connected, callback, skipped, failed.
  • lead_received (Lead received, date): before, after, in_last_days, not_in_last_days, is_empty, is_not_empty.

CRM

  • crm_linked (Linked to CRM, choice): in, not_in, is_empty, is_not_empty. Values: hubspot, salesforce, zendesk.
  • deal_stage (Deal stage, choice): in, not_in.
  • deal_open (Has an open deal, bool): is_true, is_false.
  • deal_won (Has a won deal, bool): is_true, is_false.
  • deal_amount (Largest deal amount, number): eq, neq, gt, gte, lt, lte, is_empty, is_not_empty.

Account health

  • health_band (Account health, choice): is, is_not, in, not_in, is_empty, is_not_empty. Values: healthy, watch, at_risk.
  • health_score (Account health score, number): eq, neq, gt, gte, lt, lte, is_empty, is_not_empty.

Meetings

  • upcoming_meeting (Has an upcoming meeting, bool): is_true, is_false.
  • last_meeting (Last meeting, date): before, after, in_last_days, not_in_last_days, is_empty, is_not_empty.
  • meeting_booked (Meeting booked, date): before, after, in_last_days, not_in_last_days, is_empty, is_not_empty.

Operators: is is; is_not is not (also matches empty); contains contains; not_contains doesn't contain; starts_with starts with; is_empty is empty; is_not_empty isn't empty; in any of (values); not_in none of (values); eq =; neq ≠; gt >; gte ≥; lt <; lte ≤; before before a date; after after a date; in_last_days in the last N days; not_in_last_days not in the last N days (or never); is_true yes; is_false no; ai_matches AI match (a question).