dispatch.suggest

Read only: for an urgent or emergency visit, the shop's field workers and owners ranked by who is free (no overlapping visit, not on time off, inside their hours) and then by the fewest visits that day. Suggestions only; assign with visits.assign.

WhoAgents can call this
RESTGET /v1/dispatch/suggest
MCP tooldispatch_suggest
Writesno
AreaShop

When to use it

Read only: for an urgent or emergency visit, the shop's field workers and owners ranked by who is free (no overlapping visit, not on time off, inside their hours) and then by the fewest visits that day. Suggestions only; assign with visits.assign.

What to tell the owner

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

Input

FieldTypeRequired
visit_idstring (uuid)yes
limitintegerno

Example

GET https://doingwork.work/v1/dispatch/suggest?visit_id=00000000-0000-4000-8000-000000000000

Output

FieldTypeAlways there
visit_idstring (uuid)yes
prioritystringyes
starts_atstring (date-time)yes
ends_atstring (date-time)yes
assignee_idsarrayyes
candidatesarrayyes
candidates[].person_idstring (uuid)yes
candidates[].display_name['string', 'null']yes
candidates[].rolestringyes
candidates[].freebooleanyes
candidates[].conflictsintegeryes
candidates[].time_offbooleanyes
candidates[].outside_hoursbooleanyes
candidates[].visits_that_dayintegeryes
candidates[].already_assignedbooleanyes
{
  "visit_id": "00000000-0000-4000-8000-000000000000",
  "priority": "...",
  "starts_at": "...",
  "ends_at": "...",
  "assignee_ids": [
    "00000000-0000-4000-8000-000000000000"
  ],
  "candidates": [
    {
      "person_id": "00000000-0000-4000-8000-000000000000",
      "display_name": "...",
      "role": "...",
      "free": true,
      "conflicts": 1,
      "time_off": true,
      "outside_hours": true,
      "visits_that_day": 1,
      "already_assigned": true
    }
  ]
}

Errors

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