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.
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.
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.
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.
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.
Respect the rate limit of 20 requests per second per organization; implement exponential back-off on HTTP 429 responses.
Known gotchas
The API key grants organization-wide access — rotate keys immediately if exposed and scope access by creating separate keys per integration.
Auto-dispatch only considers workers who are on-duty and have the Onfleet Driver app running; tasks will remain unassigned if no eligible driver is available.
completeBefore and completeAfter accept Unix epoch milliseconds, not ISO 8601 strings — a mismatch silently creates tasks with no time window.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp