Private preview of the new site. Not live.

customers.audience

Pick a customer audience by filters (tags, last job dates, kind of work, open quotes, money owed, maintenance plans, city or postal code, has email or phone) and get the counts and a page of matching customers. Read only: it sends nothing and changes nothing. Owner or office only; money filters need see_prices.

WhoAgents can call this
RESTPOST /v1/customers/audience
MCP toolcustomers_audience
Writesno
AreaShop

When to use it

Find the customers a message, campaign or call list is for: customers.audience takes filters (tags, when their last job was, kind of work done, an open quote, money owed, maintenance plan status and renewal dates, city or postal code, has an email or phone) and returns the counts and a page of matching customers. All filters must match.

What to tell the owner

Tell them what you found in plain words. Don't read back raw fields.

Input

FieldTypeRequired
shop_idstring (uuid)yes
tags_anyarrayno
tags_allarrayno
tags_nonearrayno
lead_sourcesarrayno
kindstring (one of person, company)no
autopaybooleanno
created_fromstringno
created_tostringno
has_jobsbooleanno
last_job_fromstringno
last_job_tostringno
job_kindsarrayno
job_tags_anyarrayno
job_summary_containsstringno
jobs_fromstringno
jobs_tostringno
has_open_quotebooleanno
plan_statusstring (one of active, cancelled, none, any)no
plan_term_ends_fromstringno
plan_term_ends_tostringno
citiesarrayno
postal_codesarrayno
has_emailbooleanno
has_phonebooleanno
owes_moneybooleanno
overduebooleanno
min_owed_minorintegerno
min_spent_minorintegerno
max_spent_minorintegerno
include_archivedbooleanno
sortstring (one of name, last_job_oldest, last_job_newest, created_newest)no
limitintegerno
cursorstringno

Example

POST https://doingwork.work/v1/customers/audience
content-type: application/json
Idempotency-Key: 3f1c...

{
  "shop_id": "00000000-0000-4000-8000-000000000000"
}

Output

FieldTypeAlways there
shop_idstring (uuid)yes
time_zonestringyes
currencystringyes
sortstringyes
countsobjectyes
counts.totalintegeryes
counts.with_emailintegeryes
counts.with_phoneintegeryes
counts.owing['integer', 'null']yes
counts.owed_minor['integer', 'null']yes
prices_hiddenbooleanyes
dataarrayyes
data[].customer_idstring (uuid)yes
data[].namestringyes
data[].company_name['string', 'null']yes
data[].kindstringyes
data[].email['string', 'null']yes
data[].phone['string', 'null']yes
data[].tagsarrayyes
data[].lead_source['string', 'null']yes
data[].city['string', 'null']yes
data[].postal_code['string', 'null']yes
data[].jobsintegeryes
data[].last_job_at['string', 'null', ' ', '(', 'd', 'a', 't', 'e', '-', 't', 'i', 'm', 'e', ')']yes
data[].open_quotesintegeryes
data[].plan_statusstringyes
data[].owed_minor['integer', 'null']yes
data[].spent_minor['integer', 'null']yes
data[].archivedbooleanyes
data[].created_atstring (date-time)yes
next_cursor['string', 'null']yes
{
  "shop_id": "00000000-0000-4000-8000-000000000000",
  "time_zone": "...",
  "currency": "...",
  "sort": "...",
  "counts": {
    "total": 1,
    "with_email": 1,
    "with_phone": 1,
    "owing": "...",
    "owed_minor": "..."
  },
  "prices_hidden": true,
  "data": [
    {
      "customer_id": "00000000-0000-4000-8000-000000000000",
      "name": "Ruiz Plumbing",
      "company_name": "...",
      "kind": "...",
      "email": "owner@example.com",
      "phone": "...",
      "tags": [
        "..."
      ],
      "lead_source": "...",
      "city": "...",
      "postal_code": "83814",
      "jobs": 1,
      "last_job_at": "...",
      "open_quotes": 1,
      "plan_status": "...",
      "owed_minor": "...",
      "spent_minor": "...",
      "archived": true,
      "created_at": "..."
    }
  ],
  "next_cursor": "..."
}

Errors

CodeStatusWhat to do
invalid_input, invalid_token, rate_limitedCan happen on any call. See errors.