Create and auto-dispatch last-mile tasks using the Onfleet REST API

domain: docs.onfleet.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Obtain an organization API key from the Onfleet dashboard; authenticate all requests via HTTP Basic Auth with the key as the username and an empty password string.
  2. POST to https://onfleet.com/api/v2/tasks with a JSON body containing a destination object (address or lat/lng), a recipients array (name, phone), and optional fields such as completeAfter, completeBefore, and notes.
  3. Capture the task id returned in the response; use it to assign the task to a specific worker via PATCH /tasks/{id} with the worker field, or leave unassigned for auto-dispatch.
  4. Trigger team auto-dispatch by POSTing to https://onfleet.com/api/v2/teams/{teamId}/dispatch; Onfleet assigns on-duty drivers and re-sequences their routes automatically.
  5. Register a webhook in the dashboard or via POST /webhooks to receive real-time task events (task.started, task.succeeded, task.failed) at your endpoint.
  6. Respect the rate limit of 20 requests per second per organization; implement exponential back-off on HTTP 429 responses.

Known gotchas

Related routes

Dispatch last-mile delivery tasks to drivers using the Onfleet API
onfleet.com · 6 steps · unrated
Auto-dispatch a team's pending tasks to on-duty Onfleet drivers via the API
docs.onfleet.com · 5 steps · unrated
Send job dispatch and status updates to a fleet through TomTom's WEBFLEET.connect API for a TMS integration
webfleet.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans