customers.winBack
Win-back list: customers with no visit in months (default 18; imported visits count), leaving out anyone with an open job or a visit coming up. Filter by job type words, a tag, or whether they have a maintenance plan. Each row has the last visit day, the last job, lifetime paid and whether they can be emailed or texted. Also counts who can't be contacted and shows the email they would get. Owner or office. Read only; customers.winBackQueue sends.
| |
|---|
| Who | Agents can call this |
| REST | GET /v1/customers/win-back |
| MCP tool | customers_winBack |
| Writes | no |
| Area | Shop |
When to use it
Lead rules (requests.setLeadSettings, owner or office) decide what happens to a new request. With auto_reply on, Doing Work sends one first reply within a minute: a text only where the customer already agreed to texts or texted the shop, and the shop's own number is approved for business texting; otherwise an email; otherwise nothing.
What to tell the owner
Tell them what you found in plain words. Don't read back raw fields.
| Field | Type | Required |
|---|
shop_id | string (uuid) | yes |
months | integer | no |
job_type | string | no |
tag | string | no |
has_plan | boolean | no |
title | string | no |
limit | integer | no |
after | string (uuid) | no |
Example
GET https://doingwork.work/v1/customers/win-back?shop_id=00000000-0000-4000-8000-000000000000
Output
| Field | Type | Always there |
|---|
months | integer | yes |
customers | array | yes |
customers[].customer_id | string (uuid) | yes |
customers[].name | string | yes |
customers[].last_visit_on | string | yes |
customers[].last_job | ['string', 'null'] | yes |
customers[].lifetime_paid_minor | integer | yes |
customers[].on_plan | boolean | yes |
customers[].can_email | boolean | yes |
customers[].can_text | boolean | yes |
customers[].why_not | ['string', 'null'] | yes |
next_cursor | ['string', 'null', ' ', '(', 'u', 'u', 'i', 'd', ')'] | yes |
can_email | integer | yes |
cannot_contact | integer | yes |
preview | object | yes |
preview.subject | string | yes |
preview.body | string | yes |
emails_on | boolean | yes |
next_actions | array | yes |
next_actions[].say | string | yes |
next_actions[].op | ['string', 'null'] | yes |
{
"months": 1,
"customers": [
{
"customer_id": "00000000-0000-4000-8000-000000000000",
"name": "Ruiz Plumbing",
"last_visit_on": "...",
"last_job": "...",
"lifetime_paid_minor": 50000,
"on_plan": true,
"can_email": true,
"can_text": true,
"why_not": "..."
}
],
"next_cursor": "00000000-0000-4000-8000-000000000000",
"can_email": 1,
"cannot_contact": 1,
"preview": {
"subject": "...",
"body": "..."
},
"emails_on": true,
"next_actions": [
{
"say": "...",
"op": "..."
}
]
}
Errors
| Code | Status | What to do |
|---|
invalid_input, invalid_token, rate_limited | | Can happen on any call. See errors. |