routes.day
One day's stops for planning a route, per worker in visit time order: each worker's start point (their own, else the shop yard), and for each stop the address, map point (null until you save one with routes.setLocation; source says where it came from), time, length, arrival window, priority, and locked when the worker is already on the way, there, or done. Visits with no worker come back in unassigned. Owner and office see everyone; a field worker sees only their own day. Plan the order with your own tools, then write it back with routes.apply.
| |
|---|
| Who | Agents can call this |
| REST | GET /v1/routes/day |
| MCP tool | routes_day |
| Writes | no |
| Area | Shop |
When to use it
One day's stops for planning a route, per worker in visit time order: each worker's start point (their own, else the shop yard), and for each stop the address, map point (null until you save one with routes.setLocation; source says where it came from), time, length, arrival window, priority, and locked when the worker is already on the way, there, or done. Visits with no worker come back in unassigned.
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 |
date | string (date) | yes |
person_ids | array | no |
Example
GET https://doingwork.work/v1/routes/day?shop_id=00000000-0000-4000-8000-000000000000&date=...
Output
| Field | Type | Always there |
|---|
shop_id | string (uuid) | yes |
date | string | yes |
time_zone | string | yes |
yard | ['object', 'null'] | yes |
workers | array | yes |
workers[].person_id | string (uuid) | yes |
workers[].name | string | yes |
workers[].start | ['object', 'null'] | yes |
workers[].stops | array | yes |
workers[].stops[].visit_id | string (uuid) | yes |
workers[].stops[].job_id | string (uuid) | yes |
workers[].stops[].title | ['string', 'null'] | yes |
workers[].stops[].customer | ['string', 'null'] | yes |
workers[].stops[].address | ['string', 'null'] | yes |
workers[].stops[].location | ['object', 'null'] | yes |
workers[].stops[].starts_at | string (date-time) | yes |
workers[].stops[].ends_at | string (date-time) | yes |
workers[].stops[].duration_minutes | integer | yes |
workers[].stops[].arrival_window_minutes | ['integer', 'null'] | yes |
workers[].stops[].arrive_by | string (date-time) | yes |
workers[].stops[].priority | string | yes |
workers[].stops[].status | string | yes |
workers[].stops[].locked | boolean | yes |
workers[].stops[].assignee_ids | array | yes |
unassigned | array | yes |
unassigned[].visit_id | string (uuid) | yes |
unassigned[].job_id | string (uuid) | yes |
unassigned[].title | ['string', 'null'] | yes |
unassigned[].customer | ['string', 'null'] | yes |
unassigned[].address | ['string', 'null'] | yes |
unassigned[].location | ['object', 'null'] | yes |
unassigned[].starts_at | string (date-time) | yes |
unassigned[].ends_at | string (date-time) | yes |
unassigned[].duration_minutes | integer | yes |
unassigned[].arrival_window_minutes | ['integer', 'null'] | yes |
unassigned[].arrive_by | string (date-time) | yes |
unassigned[].priority | string | yes |
unassigned[].status | string | yes |
unassigned[].locked | boolean | yes |
unassigned[].assignee_ids | array | yes |
missing_locations | integer | yes |
{
"shop_id": "00000000-0000-4000-8000-000000000000",
"date": "...",
"time_zone": "...",
"yard": "...",
"workers": [
{
"person_id": "00000000-0000-4000-8000-000000000000",
"name": "Ruiz Plumbing",
"start": "...",
"stops": [
{
"visit_id": "00000000-0000-4000-8000-000000000000",
"job_id": "00000000-0000-4000-8000-000000000000",
"title": "...",
"customer": "...",
"address": "...",
"location": "...",
"starts_at": "...",
"ends_at": "...",
"duration_minutes": 1,
"arrival_window_minutes": "...",
"arrive_by": "...",
"priority": "...",
"status": "...",
"locked": true,
"assignee_ids": [
"00000000-0000-4000-8000-000000000000"
]
}
]
}
],
"unassigned": [
{
"visit_id": "00000000-0000-4000-8000-000000000000",
"job_id": "00000000-0000-4000-8000-000000000000",
"title": "...",
"customer": "...",
"address": "...",
"location": "...",
"starts_at": "...",
"ends_at": "...",
"duration_minutes": 1,
"arrival_window_minutes": "...",
"arrive_by": "...",
"priority": "...",
"status": "...",
"locked": true,
"assignee_ids": [
"00000000-0000-4000-8000-000000000000"
]
}
],
"missing_locations": 1
}
Errors
| Code | Status | What to do |
|---|
invalid_input, invalid_token, rate_limited | | Can happen on any call. See errors. |