Onfleet
App · 20 actions
Run last-mile deliveries in Onfleet: create, assign, clone and track pickup and drop-off tasks, manage drivers, recipients and destinations, and read teams, hubs and driver analytics.
Actions
| Action | What it does |
|---|---|
| Clone task | Copy a task into a new, unassigned one -- for a repeat delivery -- optionally with different notes, time window, destination or recipient. |
| Complete task | Force-complete a task a driver has started, as successful or failed, with optional notes. |
| Create destination | Save an address as a destination tasks can use. |
| Create driver | Add a driver to one or more teams. |
| Create recipient | Save a person who receives deliveries. |
| Create task | Create a pickup or drop-off at an address (geocoded by Onfleet) or an existing destination, optionally for a recipient, with a time window, notes, quantity and service time. |
| Delete driver | Permanently remove a driver. |
| Delete task | Permanently delete an unassigned or assigned task. |
| Find recipient | Look a recipient up by exact phone number, full name (any letter case) or ID. |
| Get destination | Read a destination's address, coordinates and notes. |
| Get driver | Read one driver: phone, teams, duty state, current and assigned tasks, vehicle and last location. |
| Get organization | Read the Onfleet organization the connection belongs to: its ID, name, contact email, time zone, country (which decides how local phone numbers are read) and connected organizations. |
| Get task | Read a task by its ID or its 8-character short ID: state, driver, destination, recipient, time window, ETA, tracking link and -- once completed -- completion details such as proof-of-delivery photos, signature and notes. |
| List drivers | List the organization's drivers, optionally only those in certain teams, duty states or with certain phone numbers. |
| List hubs | List the organization's hubs (depots), with each one's address, coordinates and the teams that use it. |
| List tasks | List tasks in a time range -- by completion time for completed tasks, creation time for the rest -- optionally only certain states, one driver's, or within a delivery window. |
| List teams | List every team of drivers in the organization, with each team's drivers, dispatchers, hub and unassigned tasks. |
| Update driver | Change a driver's name, display name, teams or vehicle capacity. |
| Update recipient | Change a recipient's name, notes or whether Onfleet texts them. |
| Update task | Change a task that has not started: notes, time window, destination, recipient, pickup or drop-off, quantity, service time, or who it is assigned to. |
Clone task
Copy a task into a new, unassigned one -- for a repeat delivery -- optionally with different notes, time window, destination or recipient. New times must be in the future.
Inputs
- Task ID
task_idtextRequired - The task's 24-character ID, from an earlier step or the task's page in the dashboard.
- Copy metadata
include_metadatatrue/false - Copy the task's metadata to the clone.Default:
false. - Copy dependencies
include_dependenciestrue/false - Copy the tasks it depends on to the clone.Default:
false. - Notes
notestext - Notes for the clone, instead of the original's.
- Complete after
complete_afterdate and time - The clone's earliest time; must be in the future.
- Complete before
complete_beforedate and time - The clone's latest time; must be in the future.
- Destination ID
destination_idtext - A different existing destination for the clone.
- Recipient ID
recipient_idtext - A different existing recipient for the clone.
Outputs
A pickup or delivery task
appearanceobject- How the task shows on the dashboard map
assignmentHistorylist- Every move between containers (only when asked for)
completeAfternumber- Earliest time to complete it, in Unix ms, or null
completeBeforenumber- Latest time to complete it, in Unix ms, or null
completionDetailsobject- How the task was completed (mostly empty until it is)
containerobject- Where the task sits: a driver, a team, or the organization
creatortext- ID of the admin or API key that created it
delayTimenumber- Seconds the task is running late, or null
dependencieslist- IDs of tasks that must be completed first
destinationobject- A delivery or pickup location
didAutoAssigntrue/false- Whether automatic assignment found a driver (only when it was asked for)
estimatedArrivalTimenumber- Expected arrival, in Unix ms, or null
estimatedCompletionTimenumber- Expected completion, in Unix ms, or null
etanumber- Seconds until the driver arrives, or null
executortext- ID of the organization that carries it out
feedbacklist- Ratings and comments the recipient left
idtext- Task ID
merchanttext- ID of the organization shown as the merchant
metadatalist- Custom metadata entries set through the API
notestext- Notes for the driver
organizationtext- ID of the organization that owns the task
overridesobject- Recipient details changed for this task only
pickupTasktrue/false- Whether it is a pickup rather than a drop-off
quantitynumber- Units to carry
recipientslist- The task's recipient (zero or one)
serviceTimenumber- Minutes expected at the destination
shortIdtext- 8-character code shown in the dashboard and to recipients
sourceTaskIdtext- ID of the task it was cloned from (clones only)
statenumber- 0 unassigned, 1 assigned, 2 active, 3 completed
timeCreatednumber- When it was created, in Unix milliseconds
timeLastModifiednumber- When it last changed, in Unix milliseconds
trackingURLtext- Live tracking page for the recipient
trackingViewedtrue/false- Whether the recipient opened the tracking page
workertext- ID of the assigned driver, or null
Example output
{
"completeAfter": 1760590000000,
"completeBefore": 1760600000000,
"completionDetails": {
"events": [],
"time": null
},
"container": {
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"type": "ORGANIZATION"
},
"creator": "yAM*fDkztrT3gUcz9mNDgNOL",
"dependencies": [],
"destination": {
"address": {
"apartment": "",
"city": "San Francisco",
"country": "United States",
"number": "2261",
"postalCode": "94114",
"state": "California",
"street": "Market Street"
},
"id": "zrVXZi5dsXHVtgXdkYQ2SEOA",
"location": [
-122.4325,
37.7644
],
"metadata": [],
"notes": "Ring the bell twice",
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000
},
"executor": "yAM*fDkztrT3gUcz9mNDgNOL",
"feedback": [],
"id": "kc8SS1tzuZ~jqjlebKGrUmpe",
"merchant": "yAM*fDkztrT3gUcz9mNDgNOL",
"metadata": [],
"notes": "Fragile: glassware",
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"overrides": {},
"pickupTask": false,
"quantity": 1,
"recipients": [
{
"id": "VVLx5OdKvw0dRSjT2rGWFSjE",
"metadata": [],
"name": "Blas Silkovich",
"notes": "Leave with the doorman",
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"phone": "+14155550142",
"skipSMSNotifications": false,
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000
}
],
"serviceTime": 5,
"shortId": "e5f0cc28",
"sourceTaskId": "kc8SS1tzuZ~jqjlebKGrUmpe",
"state": 0,
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000,
"trackingURL": "https://onf.lt/e5f0cc28",
"worker": null
}Complete task
Force-complete a task a driver has started, as successful or failed, with optional notes. Onfleet only allows this for active tasks; an unassigned or assigned one cannot be completed this way.
Inputs
- Task ID
task_idtextRequired - The task's 24-character ID, from an earlier step or the task's page in the dashboard.
- Completed successfully
successtrue/false - On to mark the task done; off to mark it failed.Default:
true. - Notes
notestext - Completion notes.
Outputs
completedtrue/false- Always true
successtrue/false- Whether it was marked successful rather than failed
task_idtext- The completed task's ID
Example output
{
"completed": true,
"success": true,
"task_id": "kc8SS1tzuZ~jqjlebKGrUmpe"
}Create destination
Save an address as a destination tasks can use. Give it in one line for Onfleet to geocode, or in parts, optionally with exact coordinates. Returns the geocoded address and coordinates.
Inputs
- Address (one line)
addresstext - The full address in one line, for Onfleet to geocode. Use this or the parts below, not both.
- House number
numbertext - Building number (needed with the parts, unless coordinates are given).
- Street
streettext - Street name (needed with the parts, unless coordinates are given).
- Apartment or unit
apartmenttext - Apartment, suite or unit. Works with either form of address.
- City
citytext - City (needed with the parts).
- State or region
statetext - State, province or region.
- Postal code
postal_codetext - Postal or ZIP code.
- Country
countrytext - Country (needed with the parts).
- Latitude
latitudenumber - Exact latitude, to skip geocoding. Give longitude too, and the address in parts (at least city and country).From -90 to 90.
- Longitude
longitudenumber - Exact longitude, given together with latitude.From -180 to 180.
- Place name
place_nametext - A name for the place, such as a business name.
- Notes
notestext - Notes for the driver, such as a gate code.
Outputs
A delivery or pickup location
addressobject- Street address, as Onfleet geocoded it
googlePlaceIdtext- Google place ID, when Onfleet has one
idtext- Destination ID
locationlist- Where it is, as [longitude, latitude]
metadatalist- Custom metadata entries set through the API
notestext- Notes for the driver, such as a gate code
timeCreatednumber- When it was created, in Unix milliseconds
timeLastModifiednumber- When it last changed, in Unix milliseconds
warningslist- Geocoding warnings, when the address was uncertain
Example output
{
"address": {
"apartment": "",
"city": "San Francisco",
"country": "United States",
"number": "2261",
"postalCode": "94114",
"state": "California",
"street": "Market Street"
},
"id": "zrVXZi5dsXHVtgXdkYQ2SEOA",
"location": [
-122.4325,
37.7644
],
"metadata": [],
"notes": "Ring the bell twice",
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000
}Create driver
Add a driver to one or more teams. Onfleet immediately texts the phone number a temporary password for the Onfleet driver app. The phone number must not belong to another driver.
Inputs
- Full name
nametextRequired - The driver's full name.
- Phone number
phonetextRequired - The driver's mobile number, unique in your organization. Onfleet texts it a temporary password for the driver app straight away.
- Teams
team_idslistRequired - The teams the driver belongs to (at least one).
- Display name
display_nametext - The name recipients see, if different from the full name.
- Vehicle capacity
capacitynumber - How many units the driver's vehicle can carry.From 0 to 100000.
- Vehicle type
vehicle_typetext - The driver's vehicle. Needed if any other vehicle detail is set.One of:
CAR,MOTORCYCLE,BICYCLE,TRUCK. - Vehicle description
vehicle_descriptiontext - Make and model, such as Toyota Prius.
- License plate
vehicle_license_platetext - The vehicle's license plate.
- Vehicle color
vehicle_colortext - The vehicle's color.
Outputs
A driver (Onfleet calls them workers)
accountStatustext- Invitation state, such as INVITED or ACCEPTED
activeTasktext- ID of the task the driver is on now, or null
analyticsobject- Duty, distance and time figures (only when analytics were asked for)
capacitynumber- How many units the vehicle can carry
delayTimenumber- Seconds the driver is running late, or null
displayNametext- Name shown to recipients, or null
idtext- Worker ID
imageUrltext- Profile photo URL, or null
locationlist- Last reported position (missing until reported), as [longitude, latitude]
metadatalist- Custom metadata entries set through the API
nametext- Full name
onDutytrue/false- Whether the driver is on duty
organizationtext- ID of the organization the driver belongs to
phonetext- Phone number in E.164 form, such as +14155550123
taskslist- IDs of the driver's assigned tasks, in route order
teamslist- IDs of the driver's teams
timeCreatednumber- When it was created, in Unix milliseconds
timeLastModifiednumber- When it last changed, in Unix milliseconds
timeLastSeennumber- When the driver app last reported, in Unix ms
userDataobject- The driver app's device
vehicleobject- The driver's vehicle, or null
Example output
{
"accountStatus": "INVITED",
"activeTask": null,
"capacity": 10,
"delayTime": null,
"displayName": null,
"id": "h*wSb*apKlDkUFnuLTtjPke7",
"imageUrl": null,
"metadata": [],
"name": "Andoni Rivera",
"onDuty": false,
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"phone": "+14155550123",
"tasks": [],
"teams": [
"R4P7jhuzaIZ62bOS6JLlEfI1"
],
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000,
"timeLastSeen": 1760500000000,
"vehicle": {
"color": "Blue",
"description": "Toyota Prius",
"id": "tN3Bb5Sx8D3cP1F4oBcDcvSz",
"licensePlate": "7ABC123",
"type": "CAR"
}
}Create recipient
Save a person who receives deliveries. Their phone number is their unique key in the organization, so creating a second recipient with the same number fails; use 'Find recipient' to get the existing one.
Inputs
- Full name
nametextRequired - The recipient's full name.
- Phone number
phonetextRequired - The recipient's phone number, unique in your organization. Local numbers are read in your organization's country.
- Notes
notestext - Notes about the recipient, shown to drivers.
- Don't send text messages
skip_sms_notificationstrue/false - Turn on so Onfleet never texts this recipient about deliveries.Default:
false. - Skip phone validation
skip_phone_number_validationtrue/false - Turn on to accept a number Onfleet cannot verify. It must still start with + and the country code.Default:
false.
Outputs
A person who receives deliveries
idtext- Recipient ID
metadatalist- Custom metadata entries set through the API
nametext- Full name
notestext- Notes about the recipient
organizationtext- ID of the organization that owns the recipient
phonetext- Phone number in E.164 form, unique in the organization
skipSMSNotificationstrue/false- Whether Onfleet skips text messages to this recipient
timeCreatednumber- When it was created, in Unix milliseconds
timeLastModifiednumber- When it last changed, in Unix milliseconds
Example output
{
"id": "VVLx5OdKvw0dRSjT2rGWFSjE",
"metadata": [],
"name": "Blas Silkovich",
"notes": "Leave with the doorman",
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"phone": "+14155550142",
"skipSMSNotifications": false,
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000
}Create task
Create a pickup or drop-off at an address (geocoded by Onfleet) or an existing destination, optionally for a recipient, with a time window, notes, quantity and service time. Leave it unassigned, give it to a team or driver, or let automatic assignment pick the nearest or least busy driver. Returns the task with its short ID and the recipient's tracking link.
Inputs
- Address (one line)
addresstext - Where the task happens, in one line, for Onfleet to geocode. Use this or a destination ID.
- Destination ID
destination_idtext - An existing destination, from 'Create destination'. Use this or an address.
- Address notes
destination_notestext - Notes on the new address for the driver, such as a gate code.
- Recipient ID
recipient_idtext - An existing recipient, from 'Create recipient' or 'Find recipient'. Or describe a new one below.
- New recipient's name
recipient_nametext - Name of a new recipient, given together with their phone.
- New recipient's phone
recipient_phonetext - Phone of a new recipient. It must not belong to an existing recipient; use that one's ID instead.
- Recipient notes
recipient_notestext - Notes about the new recipient.
- Don't text the recipient
skip_sms_notificationstrue/false - Turn on so Onfleet sends the recipient no text messages about this task.Default:
false. - Notes
notestext - Notes for the driver (up to 10,000 characters).
- Complete after
complete_afterdate and time - The earliest the task should be done.
- Complete before
complete_beforedate and time - The latest the task should be done.
- Pickup
pickup_tasktrue/false - Turn on for a pickup; off for a drop-off.Default:
false. - Quantity
quantitynumber - Units to carry, counted against the driver's vehicle capacity.From 0 to 100000.
- Service time (minutes)
service_timenumber - Minutes the driver is expected to spend at the destination.From 0 to 1440.
- Depends on tasks
dependenciestext - IDs of tasks that must be completed first, separated by commas.
- Assign to
assign_totext - Who gets the task. Automatic assignment picks a driver who is on duty; if none can take it, the task stays unassigned.One of:
organization(Leave unassigned),team(A team),worker(A driver),auto(Automatic assignment). Default:organization. - Team
teamtext - The team to give it to. With automatic assignment, limits the choice to this team, but only if team-based assignment is turned on in your Onfleet dashboard settings; otherwise it is ignored.Only when Assign to is A team or Automatic assignment.
- Driver
worker_idtext - The driver to give it to.Only when Assign to is A driver.
- Pick the driver by
auto_assign_modetext - How automatic assignment chooses a driver.Only when Assign to is Automatic assignment. One of:
distance(Nearest driver),load(Driver with the fewest tasks). Default:distance. - Map color
triangle_colortext - The color of the task's marker on the dashboard map.One of:
0(Teal),1(Orange),2(Magenta).
Outputs
A pickup or delivery task
appearanceobject- How the task shows on the dashboard map
assignmentHistorylist- Every move between containers (only when asked for)
completeAfternumber- Earliest time to complete it, in Unix ms, or null
completeBeforenumber- Latest time to complete it, in Unix ms, or null
completionDetailsobject- How the task was completed (mostly empty until it is)
containerobject- Where the task sits: a driver, a team, or the organization
creatortext- ID of the admin or API key that created it
delayTimenumber- Seconds the task is running late, or null
dependencieslist- IDs of tasks that must be completed first
destinationobject- A delivery or pickup location
didAutoAssigntrue/false- Whether automatic assignment found a driver (only when it was asked for)
estimatedArrivalTimenumber- Expected arrival, in Unix ms, or null
estimatedCompletionTimenumber- Expected completion, in Unix ms, or null
etanumber- Seconds until the driver arrives, or null
executortext- ID of the organization that carries it out
feedbacklist- Ratings and comments the recipient left
idtext- Task ID
merchanttext- ID of the organization shown as the merchant
metadatalist- Custom metadata entries set through the API
notestext- Notes for the driver
organizationtext- ID of the organization that owns the task
overridesobject- Recipient details changed for this task only
pickupTasktrue/false- Whether it is a pickup rather than a drop-off
quantitynumber- Units to carry
recipientslist- The task's recipient (zero or one)
serviceTimenumber- Minutes expected at the destination
shortIdtext- 8-character code shown in the dashboard and to recipients
sourceTaskIdtext- ID of the task it was cloned from (clones only)
statenumber- 0 unassigned, 1 assigned, 2 active, 3 completed
timeCreatednumber- When it was created, in Unix milliseconds
timeLastModifiednumber- When it last changed, in Unix milliseconds
trackingURLtext- Live tracking page for the recipient
trackingViewedtrue/false- Whether the recipient opened the tracking page
workertext- ID of the assigned driver, or null
Example output
{
"completeAfter": 1760590000000,
"completeBefore": 1760600000000,
"completionDetails": {
"events": [],
"time": null
},
"container": {
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"type": "ORGANIZATION"
},
"creator": "yAM*fDkztrT3gUcz9mNDgNOL",
"dependencies": [],
"destination": {
"address": {
"apartment": "",
"city": "San Francisco",
"country": "United States",
"number": "2261",
"postalCode": "94114",
"state": "California",
"street": "Market Street"
},
"id": "zrVXZi5dsXHVtgXdkYQ2SEOA",
"location": [
-122.4325,
37.7644
],
"metadata": [],
"notes": "Ring the bell twice",
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000
},
"executor": "yAM*fDkztrT3gUcz9mNDgNOL",
"feedback": [],
"id": "kc8SS1tzuZ~jqjlebKGrUmpe",
"merchant": "yAM*fDkztrT3gUcz9mNDgNOL",
"metadata": [],
"notes": "Fragile: glassware",
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"overrides": {},
"pickupTask": false,
"quantity": 1,
"recipients": [
{
"id": "VVLx5OdKvw0dRSjT2rGWFSjE",
"metadata": [],
"name": "Blas Silkovich",
"notes": "Leave with the doorman",
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"phone": "+14155550142",
"skipSMSNotifications": false,
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000
}
],
"serviceTime": 5,
"shortId": "e5f0cc28",
"state": 0,
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000,
"trackingURL": "https://onf.lt/e5f0cc28",
"worker": null
}Delete driver
Permanently remove a driver. A driver with a task in progress cannot be deleted until that task is completed.
Inputs
- Driver
worker_idtextRequired - The driver to delete.
Outputs
deletedtrue/false- Always true
worker_idtext- The deleted driver's ID
Example output
{
"deleted": true,
"worker_id": "h*wSb*apKlDkUFnuLTtjPke7"
}Delete task
Permanently delete an unassigned or assigned task. Tasks a driver has started or completed cannot be deleted.
Inputs
- Task ID
task_idtextRequired - The task's 24-character ID, from an earlier step or the task's page in the dashboard.
Outputs
deletedtrue/false- Always true
task_idtext- The deleted task's ID
Example output
{
"deleted": true,
"task_id": "kc8SS1tzuZ~jqjlebKGrUmpe"
}Find recipient
Look a recipient up by exact phone number, full name (any letter case) or ID. Returns found: false rather than an error when nobody matches, so a workflow can create one instead.
Inputs
- Find by
find_bytext - What to look the recipient up by. Matches are exact.One of:
phone(Phone number),name,id(Recipient ID). Default:phone. - Phone, name or ID
valuetextRequired - The phone number, the full name (any letter case) or the ID to look up.
- Recipient skipped phone validation
skip_phone_number_validationtrue/false - Turn on to find a recipient that was created without phone validation.Default:
false.
Outputs
foundtrue/false- Whether a recipient matched
recipientobject- The match, or null
Example output
{
"found": true,
"recipient": {
"id": "VVLx5OdKvw0dRSjT2rGWFSjE",
"metadata": [],
"name": "Blas Silkovich",
"notes": "Leave with the doorman",
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"phone": "+14155550142",
"skipSMSNotifications": false,
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000
}
}Get destination
Read a destination's address, coordinates and notes.
Inputs
- Destination ID
destination_idtextRequired - The destination's ID, such as a task's destination.id.
Outputs
A delivery or pickup location
addressobject- Street address, as Onfleet geocoded it
googlePlaceIdtext- Google place ID, when Onfleet has one
idtext- Destination ID
locationlist- Where it is, as [longitude, latitude]
metadatalist- Custom metadata entries set through the API
notestext- Notes for the driver, such as a gate code
timeCreatednumber- When it was created, in Unix milliseconds
timeLastModifiednumber- When it last changed, in Unix milliseconds
warningslist- Geocoding warnings, when the address was uncertain
Example output
{
"address": {
"apartment": "",
"city": "San Francisco",
"country": "United States",
"number": "2261",
"postalCode": "94114",
"state": "California",
"street": "Market Street"
},
"id": "zrVXZi5dsXHVtgXdkYQ2SEOA",
"location": [
-122.4325,
37.7644
],
"metadata": [],
"notes": "Ring the bell twice",
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000
}Get driver
Read one driver: phone, teams, duty state, current and assigned tasks, vehicle and last location. Optionally add analytics -- on/off-duty events, distance and time driven, and tasks completed -- for the last week or a window of up to 24 hours.
Inputs
- Driver
worker_idtextRequired - The driver to read.
- Include analytics
include_analyticstrue/false - Add on/off-duty events, distance and time driven, and tasks completed. Covers the last week unless you set a window below of up to 24 hours.Default:
false. - Analytics from
analytics_fromdate and time - Start of the analytics window (24 hours at most).
- Analytics to
analytics_todate and time - End of the analytics window.
Outputs
A driver (Onfleet calls them workers)
accountStatustext- Invitation state, such as INVITED or ACCEPTED
activeTasktext- ID of the task the driver is on now, or null
analyticsobject- Duty, distance and time figures (only when analytics were asked for)
capacitynumber- How many units the vehicle can carry
delayTimenumber- Seconds the driver is running late, or null
displayNametext- Name shown to recipients, or null
idtext- Worker ID
imageUrltext- Profile photo URL, or null
locationlist- Last reported position (missing until reported), as [longitude, latitude]
metadatalist- Custom metadata entries set through the API
nametext- Full name
onDutytrue/false- Whether the driver is on duty
organizationtext- ID of the organization the driver belongs to
phonetext- Phone number in E.164 form, such as +14155550123
taskslist- IDs of the driver's assigned tasks, in route order
teamslist- IDs of the driver's teams
timeCreatednumber- When it was created, in Unix milliseconds
timeLastModifiednumber- When it last changed, in Unix milliseconds
timeLastSeennumber- When the driver app last reported, in Unix ms
userDataobject- The driver app's device
vehicleobject- The driver's vehicle, or null
Example output
{
"accountStatus": "INVITED",
"activeTask": null,
"capacity": 10,
"delayTime": null,
"displayName": null,
"id": "h*wSb*apKlDkUFnuLTtjPke7",
"imageUrl": null,
"metadata": [],
"name": "Andoni Rivera",
"onDuty": false,
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"phone": "+14155550123",
"tasks": [],
"teams": [
"R4P7jhuzaIZ62bOS6JLlEfI1"
],
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000,
"timeLastSeen": 1760500000000,
"vehicle": {
"color": "Blue",
"description": "Toyota Prius",
"id": "tN3Bb5Sx8D3cP1F4oBcDcvSz",
"licensePlate": "7ABC123",
"type": "CAR"
}
}Get organization
Read the Onfleet organization the connection belongs to: its ID, name, contact email, time zone, country (which decides how local phone numbers are read) and connected organizations.
Inputs
None.
Outputs
The Onfleet organization the API key belongs to
countrytext- Two-letter country code, used to read local phone numbers
delegateeslist- IDs of connected organizations this one can hand tasks to
emailtext- Organization contact email
idtext- Organization ID
imagetext- Logo image ID, or null
nametext- Organization name
timeCreatednumber- When it was created, in Unix milliseconds
timeLastModifiednumber- When it last changed, in Unix milliseconds
timezonetext- Time zone, such as America/Los_Angeles
Example output
{
"country": "US",
"delegatees": [],
"email": "ops@example.com",
"id": "yAM*fDkztrT3gUcz9mNDgNOL",
"image": null,
"name": "Lodol Deliveries",
"timeCreated": 1760000000000,
"timeLastModified": 1760000000000,
"timezone": "America/Los_Angeles"
}Get task
Read a task by its ID or its 8-character short ID: state, driver, destination, recipient, time window, ETA, tracking link and -- once completed -- completion details such as proof-of-delivery photos, signature and notes.
Inputs
- Look up by
lookup_bytext - The task's ID, or its 8-character short ID -- the code shown in the dashboard and on the recipient's tracking page.One of:
id(Task ID),short_id(Short ID). Default:id. - Task ID or short ID
task_idtextRequired - The task's ID or short ID.
- Include assignment history
include_assignment_historytrue/false - Add every move of the task between drivers and teams.Default:
false.
Outputs
A pickup or delivery task
appearanceobject- How the task shows on the dashboard map
assignmentHistorylist- Every move between containers (only when asked for)
completeAfternumber- Earliest time to complete it, in Unix ms, or null
completeBeforenumber- Latest time to complete it, in Unix ms, or null
completionDetailsobject- How the task was completed (mostly empty until it is)
containerobject- Where the task sits: a driver, a team, or the organization
creatortext- ID of the admin or API key that created it
delayTimenumber- Seconds the task is running late, or null
dependencieslist- IDs of tasks that must be completed first
destinationobject- A delivery or pickup location
didAutoAssigntrue/false- Whether automatic assignment found a driver (only when it was asked for)
estimatedArrivalTimenumber- Expected arrival, in Unix ms, or null
estimatedCompletionTimenumber- Expected completion, in Unix ms, or null
etanumber- Seconds until the driver arrives, or null
executortext- ID of the organization that carries it out
feedbacklist- Ratings and comments the recipient left
idtext- Task ID
merchanttext- ID of the organization shown as the merchant
metadatalist- Custom metadata entries set through the API
notestext- Notes for the driver
organizationtext- ID of the organization that owns the task
overridesobject- Recipient details changed for this task only
pickupTasktrue/false- Whether it is a pickup rather than a drop-off
quantitynumber- Units to carry
recipientslist- The task's recipient (zero or one)
serviceTimenumber- Minutes expected at the destination
shortIdtext- 8-character code shown in the dashboard and to recipients
sourceTaskIdtext- ID of the task it was cloned from (clones only)
statenumber- 0 unassigned, 1 assigned, 2 active, 3 completed
timeCreatednumber- When it was created, in Unix milliseconds
timeLastModifiednumber- When it last changed, in Unix milliseconds
trackingURLtext- Live tracking page for the recipient
trackingViewedtrue/false- Whether the recipient opened the tracking page
workertext- ID of the assigned driver, or null
Example output
{
"completeAfter": 1760590000000,
"completeBefore": 1760600000000,
"completionDetails": {
"events": [],
"time": null
},
"container": {
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"type": "ORGANIZATION"
},
"creator": "yAM*fDkztrT3gUcz9mNDgNOL",
"dependencies": [],
"destination": {
"address": {
"apartment": "",
"city": "San Francisco",
"country": "United States",
"number": "2261",
"postalCode": "94114",
"state": "California",
"street": "Market Street"
},
"id": "zrVXZi5dsXHVtgXdkYQ2SEOA",
"location": [
-122.4325,
37.7644
],
"metadata": [],
"notes": "Ring the bell twice",
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000
},
"executor": "yAM*fDkztrT3gUcz9mNDgNOL",
"feedback": [],
"id": "kc8SS1tzuZ~jqjlebKGrUmpe",
"merchant": "yAM*fDkztrT3gUcz9mNDgNOL",
"metadata": [],
"notes": "Fragile: glassware",
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"overrides": {},
"pickupTask": false,
"quantity": 1,
"recipients": [
{
"id": "VVLx5OdKvw0dRSjT2rGWFSjE",
"metadata": [],
"name": "Blas Silkovich",
"notes": "Leave with the doorman",
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"phone": "+14155550142",
"skipSMSNotifications": false,
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000
}
],
"serviceTime": 5,
"shortId": "e5f0cc28",
"state": 0,
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000,
"trackingURL": "https://onf.lt/e5f0cc28",
"worker": null
}List drivers
List the organization's drivers, optionally only those in certain teams, duty states or with certain phone numbers. Each comes with their phone, teams, duty state, current task, assigned tasks in route order, vehicle and last location.
Inputs
- Teams
team_idslist - Only drivers in any of these teams. Leave empty for all.
- Duty states
stateslist - Only drivers in any of these states. Leave empty for all.One or more of:
0(Off duty),1(Idle (on duty, no task in progress)),2(Active (on duty, on a task)). - Phone numbers
phonestext - Only drivers with these phone numbers, separated by commas. Local numbers are read in your organization's country.
Outputs
countnumber- How many workers were returned
workerslist- Matching drivers
Example output
{
"count": 1,
"workers": [
{
"accountStatus": "INVITED",
"activeTask": null,
"capacity": 10,
"delayTime": null,
"displayName": null,
"id": "h*wSb*apKlDkUFnuLTtjPke7",
"imageUrl": null,
"metadata": [],
"name": "Andoni Rivera",
"onDuty": false,
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"phone": "+14155550123",
"tasks": [],
"teams": [
"R4P7jhuzaIZ62bOS6JLlEfI1"
],
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000,
"timeLastSeen": 1760500000000,
"vehicle": {
"color": "Blue",
"description": "Toyota Prius",
"id": "tN3Bb5Sx8D3cP1F4oBcDcvSz",
"licensePlate": "7ABC123",
"type": "CAR"
}
}
]
}List hubs
List the organization's hubs (depots), with each one's address, coordinates and the teams that use it.
Inputs
None.
Outputs
countnumber- How many hubs were returned
hubslist- Every hub
Example output
{
"count": 1,
"hubs": [
{
"address": {
"city": "San Francisco",
"country": "United States",
"number": "3150",
"postalCode": "94110",
"state": "California",
"street": "18th Street"
},
"id": "tKxSfU7psqDQEBVn5e2VQ~*O",
"location": [
-122.4194,
37.7599
],
"name": "Mission Depot",
"teams": [
"R4P7jhuzaIZ62bOS6JLlEfI1"
]
}
]
}List tasks
List tasks in a time range -- by completion time for completed tasks, creation time for the rest -- optionally only certain states, one driver's, or within a delivery window. Pages through the results up to the maximum you set.
Inputs
- From
from_timedate and time - Start of the time range. Completed tasks match on when they were completed, others on when they were created. Defaults to 7 days ago.
- To
to_timedate and time - End of the time range. Defaults to now.
- States
stateslist - Only tasks in any of these states. Leave empty for all.One or more of:
0(Unassigned),1(Assigned),2(Active),3(Completed). - Driver
worker_idtext - Only tasks this driver has now or has completed.
- Earliest 'complete after'
complete_after_afterdate and time - Only tasks whose 'complete after' time is later than this.
- Latest 'complete before'
complete_before_beforedate and time - Only tasks whose 'complete before' time is earlier than this.
- Include assignment history
include_assignment_historytrue/false - Add every move of each task between drivers and teams.Default:
false. - Maximum tasks
max_resultsnumber - Stop after this many tasks, 1-2000. Defaults to 100.From 1 to 2000. Default:
100.
Outputs
countnumber- Tasks returned
has_moretrue/false- Whether more tasks matched than were returned
last_idtext- Where Onfleet would continue, or null at the end
taskslist- Matching tasks
Example output
{
"count": 1,
"has_more": false,
"last_id": null,
"tasks": [
{
"completeAfter": 1760590000000,
"completeBefore": 1760600000000,
"completionDetails": {
"events": [],
"time": null
},
"container": {
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"type": "ORGANIZATION"
},
"creator": "yAM*fDkztrT3gUcz9mNDgNOL",
"dependencies": [],
"destination": {
"address": {
"apartment": "",
"city": "San Francisco",
"country": "United States",
"number": "2261",
"postalCode": "94114",
"state": "California",
"street": "Market Street"
},
"id": "zrVXZi5dsXHVtgXdkYQ2SEOA",
"location": [
-122.4325,
37.7644
],
"metadata": [],
"notes": "Ring the bell twice",
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000
},
"executor": "yAM*fDkztrT3gUcz9mNDgNOL",
"feedback": [],
"id": "kc8SS1tzuZ~jqjlebKGrUmpe",
"merchant": "yAM*fDkztrT3gUcz9mNDgNOL",
"metadata": [],
"notes": "Fragile: glassware",
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"overrides": {},
"pickupTask": false,
"quantity": 1,
"recipients": [
{
"id": "VVLx5OdKvw0dRSjT2rGWFSjE",
"metadata": [],
"name": "Blas Silkovich",
"notes": "Leave with the doorman",
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"phone": "+14155550142",
"skipSMSNotifications": false,
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000
}
],
"serviceTime": 5,
"shortId": "e5f0cc28",
"state": 0,
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000,
"trackingURL": "https://onf.lt/e5f0cc28",
"worker": null
}
]
}List teams
List every team of drivers in the organization, with each team's drivers, dispatchers, hub and unassigned tasks.
Inputs
None.
Outputs
countnumber- How many teams were returned
teamslist- Every team
Example output
{
"count": 1,
"teams": [
{
"hub": "tKxSfU7psqDQEBVn5e2VQ~*O",
"id": "R4P7jhuzaIZ62bOS6JLlEfI1",
"managers": [],
"name": "Downtown Couriers",
"tasks": [],
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000,
"workers": [
"h*wSb*apKlDkUFnuLTtjPke7"
]
}
]
}Update driver
Change a driver's name, display name, teams or vehicle capacity. Teams are replaced, not added to. A driver's phone number cannot be changed through the API.
Inputs
- Driver
worker_idtextRequired - The driver to change.
- Full name
nametext - A new full name. Leave empty to keep it.
- Display name
display_nametext - The name recipients see, if different from the full name.
- Teams
team_idslist - Replaces the driver's teams with exactly these. Leave empty to keep them.
- Vehicle capacity
capacitynumber - How many units the driver's vehicle can carry.From 0 to 100000.
Outputs
A driver (Onfleet calls them workers)
accountStatustext- Invitation state, such as INVITED or ACCEPTED
activeTasktext- ID of the task the driver is on now, or null
analyticsobject- Duty, distance and time figures (only when analytics were asked for)
capacitynumber- How many units the vehicle can carry
delayTimenumber- Seconds the driver is running late, or null
displayNametext- Name shown to recipients, or null
idtext- Worker ID
imageUrltext- Profile photo URL, or null
locationlist- Last reported position (missing until reported), as [longitude, latitude]
metadatalist- Custom metadata entries set through the API
nametext- Full name
onDutytrue/false- Whether the driver is on duty
organizationtext- ID of the organization the driver belongs to
phonetext- Phone number in E.164 form, such as +14155550123
taskslist- IDs of the driver's assigned tasks, in route order
teamslist- IDs of the driver's teams
timeCreatednumber- When it was created, in Unix milliseconds
timeLastModifiednumber- When it last changed, in Unix milliseconds
timeLastSeennumber- When the driver app last reported, in Unix ms
userDataobject- The driver app's device
vehicleobject- The driver's vehicle, or null
Example output
{
"accountStatus": "INVITED",
"activeTask": null,
"capacity": 10,
"delayTime": null,
"displayName": null,
"id": "h*wSb*apKlDkUFnuLTtjPke7",
"imageUrl": null,
"metadata": [],
"name": "Andoni Rivera",
"onDuty": false,
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"phone": "+14155550123",
"tasks": [],
"teams": [
"R4P7jhuzaIZ62bOS6JLlEfI1"
],
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000,
"timeLastSeen": 1760500000000,
"vehicle": {
"color": "Blue",
"description": "Toyota Prius",
"id": "tN3Bb5Sx8D3cP1F4oBcDcvSz",
"licensePlate": "7ABC123",
"type": "CAR"
}
}Update recipient
Change a recipient's name, notes or whether Onfleet texts them. The phone number cannot be changed.
Inputs
- Recipient ID
recipient_idtextRequired - The recipient to change.
- Full name
nametext - A new name. Leave empty to keep it. The phone number cannot change.
- Notes
notestext - New notes. Leave empty to keep them.
- Text messages
sms_notificationstext - Whether Onfleet texts this recipient about deliveries.One of:
keep(Leave as is),send(Send text messages),skip(Don't send text messages). Default:keep.
Outputs
A person who receives deliveries
idtext- Recipient ID
metadatalist- Custom metadata entries set through the API
nametext- Full name
notestext- Notes about the recipient
organizationtext- ID of the organization that owns the recipient
phonetext- Phone number in E.164 form, unique in the organization
skipSMSNotificationstrue/false- Whether Onfleet skips text messages to this recipient
timeCreatednumber- When it was created, in Unix milliseconds
timeLastModifiednumber- When it last changed, in Unix milliseconds
Example output
{
"id": "VVLx5OdKvw0dRSjT2rGWFSjE",
"metadata": [],
"name": "Blas Silkovich",
"notes": "Leave with the doorman",
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"phone": "+14155550142",
"skipSMSNotifications": false,
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000
}Update task
Change a task that has not started: notes, time window, destination, recipient, pickup or drop-off, quantity, service time, or who it is assigned to. Once a driver starts it only the notes can change, and a completed task cannot change.
Inputs
- Task ID
task_idtextRequired - The task's 24-character ID, from an earlier step or the task's page in the dashboard.
- Notes
notestext - New notes for the driver. The only field a started task accepts.
- Complete after
complete_afterdate and time - The earliest the task should be done.
- Complete before
complete_beforedate and time - The latest the task should be done.
- Destination ID
destination_idtext - Move the task to this existing destination.
- Recipient ID
recipient_idtext - Give the task to this existing recipient.
- Pickup or drop-off
task_kindtext - Change whether the task is a pickup or a drop-off.One of:
keep(Leave as is),dropoff(Drop-off),pickup. Default:keep. - Quantity
quantitynumber - Units to carry, counted against the driver's vehicle capacity.From 0 to 100000.
- Service time (minutes)
service_timenumber - Minutes the driver is expected to spend at the destination.From 0 to 1440.
- Assign to
assign_totext - Move the task to a team or driver, or back to unassigned.One of:
keep(Leave as is),organization(Unassign),team(A team),worker(A driver). Default:keep. - Team
teamtext - The team to move it to.Only when Assign to is A team.
- Driver
worker_idtext - The driver to move it to.Only when Assign to is A driver.
Outputs
A pickup or delivery task
appearanceobject- How the task shows on the dashboard map
assignmentHistorylist- Every move between containers (only when asked for)
completeAfternumber- Earliest time to complete it, in Unix ms, or null
completeBeforenumber- Latest time to complete it, in Unix ms, or null
completionDetailsobject- How the task was completed (mostly empty until it is)
containerobject- Where the task sits: a driver, a team, or the organization
creatortext- ID of the admin or API key that created it
delayTimenumber- Seconds the task is running late, or null
dependencieslist- IDs of tasks that must be completed first
destinationobject- A delivery or pickup location
didAutoAssigntrue/false- Whether automatic assignment found a driver (only when it was asked for)
estimatedArrivalTimenumber- Expected arrival, in Unix ms, or null
estimatedCompletionTimenumber- Expected completion, in Unix ms, or null
etanumber- Seconds until the driver arrives, or null
executortext- ID of the organization that carries it out
feedbacklist- Ratings and comments the recipient left
idtext- Task ID
merchanttext- ID of the organization shown as the merchant
metadatalist- Custom metadata entries set through the API
notestext- Notes for the driver
organizationtext- ID of the organization that owns the task
overridesobject- Recipient details changed for this task only
pickupTasktrue/false- Whether it is a pickup rather than a drop-off
quantitynumber- Units to carry
recipientslist- The task's recipient (zero or one)
serviceTimenumber- Minutes expected at the destination
shortIdtext- 8-character code shown in the dashboard and to recipients
sourceTaskIdtext- ID of the task it was cloned from (clones only)
statenumber- 0 unassigned, 1 assigned, 2 active, 3 completed
timeCreatednumber- When it was created, in Unix milliseconds
timeLastModifiednumber- When it last changed, in Unix milliseconds
trackingURLtext- Live tracking page for the recipient
trackingViewedtrue/false- Whether the recipient opened the tracking page
workertext- ID of the assigned driver, or null
Example output
{
"completeAfter": 1760590000000,
"completeBefore": 1760600000000,
"completionDetails": {
"events": [],
"time": null
},
"container": {
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"type": "ORGANIZATION"
},
"creator": "yAM*fDkztrT3gUcz9mNDgNOL",
"dependencies": [],
"destination": {
"address": {
"apartment": "",
"city": "San Francisco",
"country": "United States",
"number": "2261",
"postalCode": "94114",
"state": "California",
"street": "Market Street"
},
"id": "zrVXZi5dsXHVtgXdkYQ2SEOA",
"location": [
-122.4325,
37.7644
],
"metadata": [],
"notes": "Ring the bell twice",
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000
},
"executor": "yAM*fDkztrT3gUcz9mNDgNOL",
"feedback": [],
"id": "kc8SS1tzuZ~jqjlebKGrUmpe",
"merchant": "yAM*fDkztrT3gUcz9mNDgNOL",
"metadata": [],
"notes": "Fragile: glassware",
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"overrides": {},
"pickupTask": false,
"quantity": 1,
"recipients": [
{
"id": "VVLx5OdKvw0dRSjT2rGWFSjE",
"metadata": [],
"name": "Blas Silkovich",
"notes": "Leave with the doorman",
"organization": "yAM*fDkztrT3gUcz9mNDgNOL",
"phone": "+14155550142",
"skipSMSNotifications": false,
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000
}
],
"serviceTime": 5,
"shortId": "e5f0cc28",
"state": 0,
"timeCreated": 1760500000000,
"timeLastModified": 1760500000000,
"trackingURL": "https://onf.lt/e5f0cc28",
"worker": null
}