---
title: Onfleet API Integration on Truto
slug: onfleet
category: Logistics
canonical: "https://truto.one/integrations/detail/onfleet/"
---

# Onfleet API Integration on Truto



**Category:** Logistics  
**Status:** Generally available

## MCP-ready AI tools

Truto exposes 78 tools for Onfleet that AI agents can call directly.

- **create_a_onfleet_task** — Create a task in Onfleet, passing either existing destination/recipient IDs or inline objects that are auto-created during task creation. Returns the created task including id, shortId, state, destination, recipients, and trackingURL. Required: destination and recipients. Timestamps must be Unix time in milliseconds.
- **list_all_onfleet_tasks** — List all tasks in the Onfleet organization, sorted by creation time and filtered by a from/to Unix-millisecond range. Returns tasks including id, shortId, state, worker, destination, recipients, and notes. Required: from. Up to 64 tasks per page; pass lastId to continue paginating.
- **get_single_onfleet_task_by_id** — Get a single Onfleet task by id, including completion details, feedback, and the live tracking URL. Returns: id, code, message. Required: id. Set assignmentHistory=true to include container assignment history.
- **update_a_onfleet_task_by_id** — Update an Onfleet task by id, sending only the fields to change. Returns the updated task including id, shortId, state, notes, container, destination, and recipients. Required: id. For active tasks only notes and metadata can be updated; for completed tasks only metadata and customFields.
- **delete_a_onfleet_task_by_id** — Delete an Onfleet task by id. Returns an empty 204 response on success. Active or completed tasks cannot be deleted.
- **onfleet_tasks_clone** — Clone an Onfleet task by id. Returns the cloned task object including id, shortId, trackingURL, state, sourceTaskId, container, recipients, and destination. Required: task_id.
- **onfleet_tasks_auto_assign** — Automatically assign a list of existing Onfleet tasks to available on-duty drivers. Returns: destination. Required: tasks (array of task ids) and options.mode (distance or load).
- **onfleet_tasks_batch_job_status** — Check the status of an Onfleet asynchronous batch task-creation job. Returns: code, message. Required: batch_id.
- **onfleet_tasks_batch_status** — Check the status of an Onfleet asynchronous batch task-creation job using the job id returned when the batch was submitted. Returns: code, message. Required: batch_async_id.
- **onfleet_tasks_bulk_create** — Create multiple Onfleet tasks in a single synchronous batch request. Returns: destination. Required: tasks (an array of task objects). Batches over 25 tasks may hit a 70-second internal timeout; use the async batch endpoint for larger batches.
- **onfleet_tasks_bulk_create_async** — Create up to 500 Onfleet tasks in bulk asynchronously. Returns: destination. Required: tasks. Processing is asynchronous — pass the jobId to the batch job status endpoint to retrieve the created tasks.
- **onfleet_tasks_complete** — Force complete an active Onfleet task by id. Returns the full task object including id, state, completionDetails, destination, and recipients. Required: task_id. Pass completionDetails to record success and notes; only active tasks can be force completed.
- **onfleet_tasks_get_shortid** — Get a single Onfleet task by its shortId. Returns the full task object including id, shortId, state, trackingURL, destination, and recipients. Required: short_id. Usage is the same as the get single task endpoint.
- **create_a_onfleet_worker** — Create a worker in Onfleet. A temporary password is sent to the worker's phone by SMS along with mobile app download details. Returns the created worker including id, name, phone, teams, onDuty, accountStatus, and vehicle. Required: name, phone, teams.
- **list_all_onfleet_workers** — List all workers in your Onfleet organization. Returns worker records including id, name, phone, onDuty, teams, location, and vehicle. All filters are optional; narrow them to avoid the 70-second internal timeout on large organizations.
- **get_single_onfleet_worker_by_id** — Get a single Onfleet worker by id. Returns the worker record including id, name, phone, onDuty, teams, tasks, location, and vehicle. Set analytics=true to include duty events, distance, and time analytics, optionally scoped with from/to (max 24 hours). Required: id.
- **update_a_onfleet_worker_by_id** — Update an Onfleet worker by id. Returns the updated worker including id, name, phone, teams, onDuty, delayTime, and vehicle. Required: id. Note that phone cannot be updated programmatically; the request will not trigger an error.
- **delete_a_onfleet_worker_by_id** — Delete an Onfleet worker by id. Workers with an active task cannot be deleted until the task has been completed. Returns an empty 204 response on success. Required: id.
- **create_a_onfleet_destination** — Create an Onfleet destination from a parsed address (number, street, city, country) or a single unparsed string, optionally with [longitude, latitude] coordinates. Returns the destination with id, timeCreated, timeLastModified, location, address, notes, and metadata. Required: address. address.unparsed cannot be combined with location; location requires at least address.city and address.country.
- **get_single_onfleet_destination_by_id** — Get a single Onfleet destination by id. Returns the destination object with id, timeCreated, timeLastModified, geocoded location, full address details, notes, and metadata. Required: id.
- **create_a_onfleet_recipient** — Create a recipient in Onfleet. The phone number is the unique identifier and cannot be changed later. Returns: id, organization, timeCreated, timeLastModified, name, phone, notes, skipSMSNotifications, metadata, code, message. Required: phone.
- **update_a_onfleet_recipient_by_id** — Update an existing recipient in Onfleet by id. The phone number is a unique identifier and cannot be changed. Returns: id, organization, timeCreated, timeLastModified, name, phone, notes, skipSMSNotifications, metadata, code, message. Required: id.
- **onfleet_recipients_get_by_phone** — Look up a single recipient in Onfleet by phone number. Returns: id, organization, timeCreated, timeLastModified, name, phone, notes, skipSMSNotifications, metadata, code, message. Required: phone.
- **create_a_onfleet_team** — Create a new Onfleet team with assigned workers, managers, and an optional hub. Returns the created team object including id, name, timeCreated, workers, managers, hub, and enableSelfAssignment. Required: name, workers, managers. Team names must be unique within the organization.
- **list_all_onfleet_teams** — List all Onfleet teams in the organization. Returns an array of team objects including id, name, workers, managers, hub, tasks, timeCreated, and timeLastModified.
- **get_single_onfleet_team_by_id** — Get a single Onfleet team by id. Returns the team object including id, name, workers, managers, hub, tasks, timeCreated, and timeLastModified. Required: id.
- **update_a_onfleet_team_by_id** — Update an Onfleet team by id, such as reassigning its workers, managers, or hub. Returns the updated team object including id, name, timeCreated, workers, managers, and hub. Required: id. Workers and managers must exist within your organization.
- **delete_a_onfleet_team_by_id** — Delete an Onfleet team by id. Returns an empty response on success (the API responds 200 OK with no body). Required: id.
- **create_a_onfleet_webhook** — Create an Onfleet webhook that fires a request to your URL whenever the trigger condition is met. Returns: id, count, url, trigger, isEnabled, scopeId, canReceiveConnectionEvents. Requires url, name, and trigger; the URL must be HTTPS with a valid certificate and must answer Onfleet's validation check.
- **list_all_onfleet_webhooks** — List all webhooks configured in Onfleet. Returns each webhook's id, name, url, trigger, count, isEnabled, scopeId, and canReceiveConnectionEvents; isEnabled flips to false after 300 consecutive failed deliveries.
- **delete_a_onfleet_webhook_by_id** — Delete an Onfleet webhook by id. Returns an empty 204 response on success. Required: id.
- **update_a_onfleet_webhook_by_id** — Update an Onfleet webhook by id, changing its url, trigger, or connection-event settings. Returns: id, name, count, url, trigger, isEnabled, scopeId, canReceiveConnectionEvents. Required: id. Submit null for scopedApiKeyId unless assigning a scoped API key.
- **update_a_onfleet_container_by_id** — Update an Onfleet container — the ordered task-assignment list for an organization, team, or worker — to set or insert its assigned tasks. Newly included tasks are removed from other containers. Returns: type, organization, destination. Required: container_type, id. Containers hold a hard limit of 10,000 assigned tasks; concurrent mutations may return 412 responses.
- **create_a_onfleet_admin** — Create an Onfleet administrator in your organization with a name, email, phone, team assignments, and a type of super or standard. Returns the created admin record including id, name, email, type, isReadOnly, and timeCreated.
- **list_all_onfleet_admins** — List all administrators in your Onfleet organization, including super admins and standard dispatchers. Returns each admin with id, name, email, type, isActive, phone, teams, and metadata.
- **update_a_onfleet_admin_by_id** — Update an Onfleet administrator's details by id. Returns the updated admin including id, name, email, type, and timeLastModified. Required: id. The type (super or standard) cannot be changed — delete and recreate the administrator instead.
- **delete_a_onfleet_admin_by_id** — Delete a standard Onfleet administrator by id. Returns an empty 204 response on success. Required: id. The super administrator account cannot be deleted.
- **create_a_onfleet_hub** — Create a hub in Onfleet: the depot location from which a team's workers start and end deliveries for route optimization. Returns the created hub object with its id, name, address, phone, teams, and timeCreated/timeLastModified timestamps.
- **list_all_onfleet_hubs** — List the hubs in your Onfleet organization — depot locations from which teams' deliveries start for route optimization. Returns hub objects with id, name, address, phone, teams, and timeCreated/timeLastModified timestamps.
- **list_all_onfleet_organizations** — Get the details of your own Onfleet organization — the top-most entity that owns administrators, teams, workers and tasks. Returns: id, name, email, timeCreated, timeLastModified, metadata.
- **update_a_onfleet_organization_by_id** — Update an Onfleet organization's details by id. Returns the updated organization record including id, name, email, timeCreated, timeLastModified, and metadata. Required: id.
- **get_single_onfleet_organization_by_id** — Get a single Onfleet organization by id, including linked organizations whose ids can act as Merchants or Executors on tasks. Returns: id, code, message. Required: id.
- **create_a_onfleet_order** — Create an Onfleet order as a one-to-one pickup/dropoff task pair routed to the courier for delivery assignment. Returns the full order object including id, shortId, pickupTask, dropoffTask, status, and timeCreated. Requires pickupTask and dropoffTask (each with a destination and optional recipients); deliveryServiceId is required only when a Service/Rate exists for the client, and client is…
- **get_single_onfleet_order_by_id** — Get a single Onfleet order by its order shortId. Returns the full order including id, shortId, status, pickupTask and dropoffTask (each with trackingURL, destination, and requirements). Required: id — use the Order shortId, not the individual Task IDs.
- **update_a_onfleet_order_by_id** — Update an Onfleet order by id. The request body must include both pickupTask and dropoffTask; only requirements, recipients, destination, completeAfter, completeBefore, and notes can be updated, and only until the order is active. Returns the updated order including id, shortId, pickupTask, dropoffTask, status, and timeLastModified. Required: id, pickupTask, dropoffTask. When updating…
- **onfleet_orders_cancel** — Cancel one or more Onfleet orders before they start or complete; completed orders cannot be cancelled. Returns: status, totalOrdersRemoved. Required: orderIds — an array of order IDs, wrapped in an array even for a single ID. Couriers cancelling on behalf of a client must also supply client.
- **onfleet_orders_clone** — Clone an existing Onfleet order as a direct copy of its pickup/dropoff pair; only clients can clone, using the original order id, and only when no rates/services are set up for them. Returns the new order with fresh id, shortId, pickupTask, dropoffTask, and timeCreated; completeAfter, completeBefore, price, currency, priceBreakdown, and deliveryService are not carried over. Required: order_id.
- **onfleet_orders_reject** — Reject a client's order in Onfleet (Couriers only). Returns the rejected order record with its id, shortId, organization, and the full pickupTask/dropoffTask pair. Required: order_short_id (the order's dashboard short id) and reason.
- **create_a_onfleet_route_plan** — Create a route plan in Onfleet to group tasks together and schedule them as a unit. Returns the created plan including id, name, state, tasks, worker, team, vehicleType, and startTime. Requires name and startTime.
- **list_all_onfleet_route_plans** — List Onfleet route plans, scoped by filters such as workerId, startTimeFrom/startTimeTo, createdTimeFrom/createdTimeTo, and hasTasks. Returns an array of plans with id, name, state, tasks, worker, status, and isOverdue. Max 500 per page.
- **get_single_onfleet_route_plan_by_id** — Get a single Onfleet route plan by id, for when you already have the route plan's id. Returns the full plan including id, name, state, tasks, worker, vehicleType, startTime, status, and isOverdue. Required: id.
- **update_a_onfleet_route_plan_by_id** — Update an Onfleet route plan at any time — change name, color, vehicleType, worker, team, startAt/endAt, planned start/end times, or timezone. Returns the updated plan including id, name, state, tasks, worker, and timeLastModified. Required: id.
- **delete_a_onfleet_route_plan_by_id** — Delete an Onfleet route plan by id. A route plan cannot be deleted if it is in progress, completed, or contains tasks — it must be empty. Returns an empty 204 response on success.
- **onfleet_optimizations_start** — Start a previously initialized Onfleet route optimization after its results have been thoroughly reviewed, using the optimization id from initialization. Required: optimization_id. Returns no response body on success.
- **onfleet_optimizations_apply_results** — Apply an Onfleet optimization's results, assigning the optimized tasks to workers. Required: optimization_id. No body parameters. Returns no response body on success; a 412 is returned if the assignment fails.
- **create_a_onfleet_optimization** — Initialize a standard Onfleet route optimization that plans routes for workers, appending new routes after any existing ones. Returns the optimization id, shortId, validation issues, and a summary of workers, tasks, and routeZones. Requires tasks, teams, date, timezone, mode, serviceTime, maxViolationTime, maxTasksPerRoute, schedulingMethod, defaultSchedule, and at least one of routeStart or…
- **get_single_onfleet_optimization_by_id** — Check the status of an Onfleet route optimization using the id returned by the Initialize Route Optimization call. Returns: status, progress, summary, optimizationId. Required: id.
- **onfleet_optimizations_cancel** — Cancel an Onfleet route optimization job while it is processing or if the results are not desirable. Returns: success. Required: optimization_id. No body parameters.
- **list_all_onfleet_task_templates** — List all task templates and their custom fields in Onfleet. Returns: id, deletedAt, code, message. The default Task formats are always included.
- **create_a_onfleet_task_template** — Create a custom task template in Onfleet from a set of custom fields. Returns the created template: id, name, contextSaveConditions, fields, deletedAt, isDefault. Required: name, contextSaveConditions, fields. Fields must match the template's task-type designation (pickup, dropoff, or both).
- **update_a_onfleet_task_template_by_id** — Update an existing task template by id in Onfleet. Returns the updated template: id, name, contextSaveConditions, fields, deletedAt, isDefault. Required: id, fields. The fields array must be sent even when updating only the name, to preserve its existing values.
- **delete_a_onfleet_task_template_by_id** — Delete a task template by id in Onfleet. Returns an empty 204 response on success. Required: id.
- **onfleet_task_templates_search** — Search Onfleet for custom fields eligible for a task template's conditions, e.g. when scoping a template to pickup-only or dropoff-only tasks. Returns matching custom fields: key, name, type, editability, visibility, contexts. Required: contextSaveConditions.
- **onfleet_manifests_generate_manifest** — Generate a driver delivery manifest in Onfleet with the driver's route tasks in sequential order, plus driver, vehicle, and ETA details. Returns: manifestDate, departureTime, driver, vehicle, hubAddress, lastId, turnByTurn, totalDistance, tasks. Required: hubId, workerId. Routes with more than 64 tasks return a lastId to pass back for the next page; turnByTurn and totalDistance are only included…
- **list_all_onfleet_search_admins** — Search Onfleet administrators by custom metadata. The request body is an array of metadata query entries, each with name, type, and value; entries are combined with AND, and object-type entries must match exactly. Returns matching administrator records with id, name, email, type, isActive, phone, teams, and metadata. Required: name, type, and value on each body entry.
- **list_all_onfleet_search_destinations** — Search Onfleet destinations by metadata. Accepts a JSON array of metadata query objects and returns every destination whose metadata matches all entries (AND logic), including id, address, location, notes, and metadata. Required: a JSON array of metadata queries, each with name, type, and value. Object-typed values must match the entity's metadata exactly.
- **list_all_onfleet_search_recipients** — Search Onfleet recipients whose metadata matches one or more metadata entries. Returns matching recipients including id, name, phone, notes, organization, skipSMSNotifications, timeCreated, timeLastModified, and metadata. Required: body — a bare JSON array of metadata query entries, each with name, type, and value; entries are combined with AND, and array-typed values must match element order.
- **list_all_onfleet_search_tasks** — Search Onfleet tasks by metadata. Accepts a JSON array of metadata query entries (each with name, type, and value) and returns every matching task object including id, shortId, state, destination, recipients, and metadata. Multiple entries are combined with AND; complex types like object must match exactly.
- **list_all_onfleet_search_teams** — Search Onfleet teams by metadata. Accepts a JSON array of metadata query entries, each with name, type, and value, combined with AND; object-typed values must match the stored entry exactly. Returns matching team objects including id, name, workers, managers, tasks, hub, enableSelfAssignment, timeCreated, timeLastModified, and metadata. Required: name, type, and value in each metadata query entry.
- **list_all_onfleet_search_workers** — Search OnFleet workers by their metadata. Accepts an array of metadata query entries (name, type, value) that are combined with a logical AND, and returns every matching worker object including id, name, phone, onDuty, teams, tasks, and metadata entries. Required: name, type, and value on each metadata entry; object-typed values must match the worker's stored metadata exactly.
- **create_a_onfleet_delivery_service_quote** — Get price quotes from Onfleet delivery services for a potential order. Send readyBy (and optionally dueBy) as Unix milliseconds, the piece quantity, a weight (value plus units kg or lbs), and pickup and dropoff address objects. Only clients configured with services receive quotes. Returns an array of quotes, each with id (use as deliveryServiceId when creating the order), rateId, displayName, dueBy, estimatedCost, currency and an estimatedCostBreakdown. Couriers quoting on behalf of a client pass clientId. Required: readyBy, quantity, weight, pickup, dropoff.
- **onfleet_route_plan_tasks_bulk_update** — Add new tasks to, or reorder, the tasks within an Onfleet route plan by supplying the complete ordered array of task IDs. Returns: destination. Required: route_plan_id, tasks. The tasks array must include every existing task ID plus any new ones — sending only the new IDs removes existing tasks from the route plan; to remove a task, reassign it to a new container via the task container endpoint.
- **list_all_onfleet_task_custom_fields** — Find Onfleet tasks whose custom fields match given key/value pairs. The body is a JSON array of {key, value} objects; a task must match every pair supplied. Omit pairs whose value is empty. Returns the matching task objects with id, shortId, state, worker, destination, recipients, metadata and completionDetails. Required: body array with at least one key/value pair.
- **list_all_onfleet_team_tasks** — List the unassigned tasks currently in an Onfleet team (tasks assigned to a worker or already completed are excluded), sorted by creation time. Optional filters: from and to (Unix milliseconds, default last 7 days), isPickupTask. Returns up to 64 tasks per page under tasks, plus a lastId cursor to pass back for the next page while present. Each task includes id, shortId, state, pickupTask, destination, recipients, metadata, container and completionDetails. Required: team_id.
- **list_all_onfleet_worker_locations** — List workers' last known locations in Onfleet. Returns a collection of worker location records including each worker's id, location coordinates (longitude, latitude), and timeLastSeen.
- **get_single_onfleet_worker_schedule_by_id** — Get a worker's schedule in Onfleet. Returns the worker record including id, name, phone, onDuty, teams, vehicle, and analytics. Required: id.
- **update_a_onfleet_worker_schedule_by_id** — Set a worker's schedule in Onfleet. Returns the updated worker record including id, name, phone, onDuty, teams, and vehicle. Required: id.
- **list_all_onfleet_worker_tasks** — List the tasks currently assigned to an Onfleet worker, sorted by creation time (historical tasks are excluded). Returns tasks — each with id, shortId, state, pickupTask, destination, recipients, completionDetails, and metadata — plus a lastId pagination marker when more pages remain. Required: worker_id. Up to 64 tasks per page.

## How it works

1. **Link your customer's Onfleet account.** Use Truto's frontend SDK; we handle every OAuth and API key flow so you don't need to create the OAuth app.
2. **Authentication is automatic.** Truto refreshes tokens, stores credentials securely, and injects them into every API request.
3. **Call Truto's API to reach Onfleet.** The Proxy API is a 1-to-1 mapping of the Onfleet API.
4. **Get a unified response format.** Every response uses a single shape, with cursor-based pagination and data in the `result` field.

## Use cases

- **Embed last-mile delivery in your e-commerce or OMS** — Let your merchants offer local same-day delivery alongside standard shipping by auto-creating Onfleet tasks or pickup/dropoff orders the moment an order is marked ready. Status webhooks keep order state in sync without manual intervention.
- **Add route optimization to your WMS or dispatch tool** — Give operations teams a one-click 'optimize today's routes' button inside your product. Push the day's tasks to Onfleet, trigger optimization, and pull back route plans and manifests to drive loading sequences and driver assignments.
- **Surface live delivery status inside support and CX tools** — Help agents answer 'where's my order?' tickets without leaving your UI by searching Onfleet tasks via recipient phone number and displaying the assigned worker's live location and ETA directly in the ticket view.
- **Automate proof-of-delivery capture for compliance workflows** — For pharmacy, cannabis, and regulated verticals, pull completion details (signatures, photos, ID scans) from completed tasks and archive them in your POS or compliance system to maintain audit trails.
- **Offer a managed fleet and dispatcher experience inside vertical SaaS** — Let your users provision workers, teams, hubs, and admins from inside your product, so they can run their delivery operation without ever logging into Onfleet directly.

## What you can build

- **Auto-task creation from checkout** — Convert incoming orders into Onfleet tasks or pickup/dropoff orders in bulk using async bulk create, with your internal order ID stored in task metadata for later lookup.
- **One-click route optimization** — Trigger Onfleet's optimization engine from your UI, poll until complete, apply the results, and surface the generated route plans back to your users.
- **Real-time delivery tracking widget** — Query worker locations and task state to render a live map and ETA inside your product's order detail, customer portal, or support ticket view.
- **Two-way status sync via webhooks** — Register Onfleet webhooks for task started, completed, and failed events so your platform can update order state, release inventory, or trigger billing automatically.
- **Driver and team management console** — Create, update, and delete workers, teams, and hubs from inside your app so dispatchers can onboard drivers and reorganize fleets without context-switching.
- **Proof-of-delivery archiver** — On task completion, fetch the task by ID to pull signatures, photos, and completion notes, then store them in your CRM, EHR, or compliance vault.

## FAQs

### How does authentication to Onfleet work through Truto?

Onfleet uses API key authentication. Your end users provide their Onfleet API key through Truto's connection flow, and Truto securely stores and injects it on every request — you never handle credentials directly.

### Can I link Onfleet tasks back to records in my own system?

Yes. Onfleet tasks support a metadata array where you can store your internal IDs (e.g., order ID, ticket ID). You can later retrieve tasks via the search endpoint to filter by metadata, avoiding the need to persist Onfleet task IDs on your side.

### How do I receive real-time delivery updates?

Use the webhook endpoints to register your own callback URL against events like task started, completed, or failed. Truto manages the webhook registration lifecycle so your backend receives normalized event payloads for each connected account.

### Does Truto support bulk task creation for high-volume dispatch?

Yes. Both synchronous bulk create and the async bulk create endpoints are available, along with batch status endpoints so you can poll long-running jobs until completion.

### Can I trigger route optimization programmatically?

Yes. You can start an optimization, fetch its status, apply the results to generate route plans, or cancel it mid-run. Auto-assign is also exposed for simpler distance- or load-based dispatching without full optimization.

### How fresh is driver location data?

Worker locations are fetched live from Onfleet on each request to the worker locations endpoint. Freshness depends on the driver app's last reported ping, typically every few seconds while on an active route.
