routes.apply

Write a planned route back: new times, and optionally new workers, for up to 100 visits at once (owner or office). All or nothing: if any visit is not scheduled (already on the way, there, started, done or cancelled), not this shop's, or the plan leaves a worker with overlapping visits, nothing changes and the problems come back in conflicts. Pass allow_overlaps true to save overlaps anyway, or dry_run true to check without saving. Each moved visit gets its appointment reminder planned again once.

WhoAgents can call this
RESTPOST /v1/routes/apply
MCP toolroutes_apply
Writesyes, send an Idempotency-Key
AreaShop

When to use it

Write a planned route back: new times, and optionally new workers, for up to 100 visits at once (owner or office). All or nothing: if any visit is not scheduled (already on the way, there, started, done or cancelled), not this shop's, or the plan leaves a worker with overlapping visits, nothing changes and the problems come back in conflicts.

What to tell the owner

Say what you did in plain words and what happens next.

Input

FieldTypeRequired
shop_idstring (uuid)yes
changesarrayyes
changes[].visit_idstring (uuid)yes
changes[].starts_atstring (date-time)yes
changes[].ends_atstring (date-time)yes
changes[].person_idsarrayno
allow_overlapsbooleanno
dry_runbooleanno

Example

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

{
  "shop_id": "00000000-0000-4000-8000-000000000000",
  "changes": [
    {
      "visit_id": "00000000-0000-4000-8000-000000000000",
      "starts_at": "...",
      "ends_at": "..."
    }
  ]
}

Output

JSON. The response shape isn't published yet; read the fields you need and ignore the rest. Errors are {code, message, status}.

Errors

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