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.

WhoAgents can call this
RESTGET /v1/routes/day
MCP toolroutes_day
Writesno
AreaShop

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.

Input

FieldTypeRequired
shop_idstring (uuid)yes
datestring (date)yes
person_idsarrayno

Example

GET https://doingwork.work/v1/routes/day?shop_id=00000000-0000-4000-8000-000000000000&date=...

Output

FieldTypeAlways there
shop_idstring (uuid)yes
datestringyes
time_zonestringyes
yard['object', 'null']yes
workersarrayyes
workers[].person_idstring (uuid)yes
workers[].namestringyes
workers[].start['object', 'null']yes
workers[].stopsarrayyes
workers[].stops[].visit_idstring (uuid)yes
workers[].stops[].job_idstring (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_atstring (date-time)yes
workers[].stops[].ends_atstring (date-time)yes
workers[].stops[].duration_minutesintegeryes
workers[].stops[].arrival_window_minutes['integer', 'null']yes
workers[].stops[].arrive_bystring (date-time)yes
workers[].stops[].prioritystringyes
workers[].stops[].statusstringyes
workers[].stops[].lockedbooleanyes
workers[].stops[].assignee_idsarrayyes
unassignedarrayyes
unassigned[].visit_idstring (uuid)yes
unassigned[].job_idstring (uuid)yes
unassigned[].title['string', 'null']yes
unassigned[].customer['string', 'null']yes
unassigned[].address['string', 'null']yes
unassigned[].location['object', 'null']yes
unassigned[].starts_atstring (date-time)yes
unassigned[].ends_atstring (date-time)yes
unassigned[].duration_minutesintegeryes
unassigned[].arrival_window_minutes['integer', 'null']yes
unassigned[].arrive_bystring (date-time)yes
unassigned[].prioritystringyes
unassigned[].statusstringyes
unassigned[].lockedbooleanyes
unassigned[].assignee_idsarrayyes
missing_locationsintegeryes
{
  "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

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