Onfleet Tasks API

Create, list, fetch, update, clone, force-complete, and delete pickup/dropoff tasks. Tasks are the atomic unit of work in Onfleet — each has a destination, recipient, completion window, optional dependencies, and a state lifecycle (Unassigned → Assigned → Active → Completed). Supports batch creation (up to 100 per request) and assignment to workers via the containers endpoint.

GitHub OpenAPI
Business capability
Last-Mile Delivery Operations Management BC-2420.40

Operations 10

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /tasks Create a pickup or dropoff task · Create Task #
Ask an LLM
“How do I create a delivery task with a destination and recipient?”
“Can I set a completion window and quantity when creating a task?”
Tell an agent
Create a task to {destination} for {recipients}.
Create a {quantity} item task to {destination} with completion between {completeAfter} and {completeBefore}.
POST /tasks/batch Create up to 100 tasks in one request · Create Tasks In Batch #
Ask an LLM
“Can I create many tasks in a single request?”
“What happens to the results of a bulk task creation?”
Tell an agent
Create these tasks in one batch: {tasks}.
Bulk create {tasks} and notify me when done.
GET /tasks/all List tasks · List Tasks #
Ask an LLM
“Which tasks were created between two dates?”
“Can I filter tasks by state or worker?”
Tell an agent
List tasks created between {from} and {to}.
Show {state} tasks for worker {worker}.
GET /tasks/{taskId} Get a task · Get Single Task #
Ask an LLM
“What is the status of a specific task?”
“Can I look up one task by its ID?”
Tell an agent
Get task {taskId}.
Show the details of task {taskId}.
PUT /tasks/{taskId} Update a task · Update Task #
Ask an LLM
“Can I change the completion window of an existing task?”
“Is it possible to add notes to a task after it's created?”
Tell an agent
Update task {taskId} to complete between {completeAfter} and {completeBefore}.
Add notes {notes} to task {taskId}.
DELETE /tasks/{taskId} Delete a task · Delete Task #
Ask an LLM
“Can I remove a task I no longer need?”
“What happens to a task when I delete it?”
Tell an agent destructive · confirm first
Delete task {taskId}.
Remove the task {taskId} from the schedule.
GET /tasks/shortId/{shortId} Get a task by its short ID · Get Task By Short ID #
Ask an LLM
“Can I find a task using its short ID?”
“What does the short ID lookup return?”
Tell an agent
Get the task with short ID {shortId}.
Look up task {shortId} by its short ID.
POST /tasks/{taskId}/clone Clone a task · Clone Task #
Ask an LLM
“Can I duplicate a task to create a similar one?”
“Is there a way to copy a task's destination and recipient?”
Tell an agent
Clone task {taskId}.
Duplicate the task {taskId} with its destination and recipients.
POST /tasks/{taskId}/complete Mark a task as completed · Force-Complete Task #
Ask an LLM
“Can I force a task to complete without a worker?”
“What details can I include when force-completing a task?”
Tell an agent
Force-complete task {taskId}.
Mark task {taskId} as completed with {completionDetails}.
PUT /containers/workers/{workerId} Assign tasks to a worker · Assign Tasks To Worker #
Ask an LLM
“How do I assign a list of tasks to a worker?”
“Can I replace a worker's existing task list?”
Tell an agent
Assign tasks {tasks} to worker {workerId}.
Replace worker {workerId}'s task list with {tasks}.

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/onfleet:onfleet-tasks-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

onfleet-tasks-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Onfleet Destinations Tasks API
  description: 'The Destinations API manages physical addresses associated with tasks.

    Destinations include parsed address fields and a GeoJSON location, and can

    be reused across tasks. Onfleet geocodes addresses on creation; you can

    also supply an `unparsed` address.'
  version: '2.7'
  contact:
    name: Onfleet Support
    email: support@onfleet.com
  license:
    name: Onfleet Terms of Service
    url: https://onfleet.com/legal
servers:
- url: https://onfleet.com/api/v2
  description: Production
security:
- basicAuth: []
tags:
- name: Tasks
paths:
  /tasks:
    post:
      tags:
      - Tasks
      summary: Create Task
      description: Create a new pickup or dropoff task with a destination, recipient, and completion window.
      operationId: createTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskCreate'
      responses:
        '200':
          description: Task created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
  /tasks/batch:
    post:
      tags:
      - Tasks
      summary: Create Tasks In Batch
      description: Asynchronously create up to 100 tasks per request; results are returned via the taskBatchCreateJobCompleted webhook.
      operationId: createTaskBatch
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                tasks:
                  type: array
                  items:
                    $ref: '#/components/schemas/TaskCreate'
      responses:
        '200':
          description: Batch accepted
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  jobId:
                    type: string
  /tasks/all:
    get:
      tags:
      - Tasks
      summary: List Tasks
      description: Return a paginated collection of tasks; uses lastId-based pagination with up to 64 tasks per page.
      operationId: listTasks
      parameters:
      - name: from
        in: query
        required: true
        schema:
          type: integer
          format: int64
        description: Start of the search range in Unix milliseconds.
      - name: to
        in: query
        schema:
          type: integer
          format: int64
        description: End of the search range in Unix milliseconds.
      - name: lastId
        in: query
        schema:
          type: string
        description: Cursor returned from a previous call to walk pagination.
      - name: state
        in: query
        schema:
          type: string
        description: Comma-separated list of task state values (0=Unassigned, 1=Assigned, 2=Active, 3=Completed).
      - name: worker
        in: query
        schema:
          type: string
      - name: completeBeforeBefore
        in: query
        schema:
          type: integer
          format: int64
      - name: completeAfterAfter
        in: query
        schema:
          type: integer
          format: int64
      - name: dependencies
        in: query
        schema:
          type: string
      - name: containers
        in: query
        schema:
          type: string
      responses:
        '200':
          description: Paginated tasks
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskList'
  /tasks/{taskId}:
    parameters:
    - name: taskId
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Tasks
      summary: Get Single Task
      operationId: getTask
      responses:
        '200':
          description: Task
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
    put:
      tags:
      - Tasks
      summary: Update Task
      operationId: updateTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskUpdate'
      responses:
        '200':
          description: Updated task
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
    delete:
      tags:
      - Tasks
      summary: Delete Task
      operationId: deleteTask
      responses:
        '200':
          description: Task deleted
  /tasks/shortId/{shortId}:
    parameters:
    - name: shortId
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Tasks
      summary: Get Task By Short ID
      operationId: getTaskByShortId
      responses:
        '200':
          description: Task
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
  /tasks/{taskId}/clone:
    post:
      tags:
      - Tasks
      summary: Clone Task
      operationId: cloneTask
      parameters:
      - name: taskId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Cloned task
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
  /tasks/{taskId}/complete:
    post:
      tags:
      - Tasks
      summary: Force-Complete Task
      operationId: forceCompleteTask
      parameters:
      - name: taskId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                completionDetails:
                  type: object
                  properties:
                    success:
                      type: boolean
                    notes:
                      type: string
      responses:
        '200':
          description: Task completed
  /containers/workers/{workerId}:
    put:
      tags:
      - Tasks
      summary: Assign Tasks To Worker
      description: Set the ordered list of task IDs assigned to a worker (replaces existing assignments unless type=APPEND).
      operationId: assignTasksToWorker
      parameters:
      - name: workerId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - tasks
              properties:
                tasks:
                  type: array
                  items:
                    type: string
                considerDependencies:
                  type: boolean
      responses:
        '200':
          description: Worker container updated
components:
  schemas:
    Task:
      type: object
      properties:
        id:
          type: string
          description: 24-character resource identifier.
        shortId:
          type: string
        organization:
          type: string
        timeCreated:
          type: integer
          format: int64
        timeLastModified:
          type: integer
          format: int64
        executor:
          type: string
        merchant:
          type: string
        creator:
          type: string
        worker:
          type:
          - string
          - 'null'
        destination:
          $ref: '#/components/schemas/Destination'
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/Recipient'
        completeAfter:
          type:
          - integer
          - 'null'
          format: int64
        completeBefore:
          type:
          - integer
          - 'null'
          format: int64
        pickupTask:
          type: boolean
        dependencies:
          type: array
          items:
            type: string
        notes:
          type: string
        quantity:
          type: integer
        serviceTime:
          type: integer
        state:
          type: integer
          enum:
          - 0
          - 1
          - 2
          - 3
        completionDetails:
          $ref: '#/components/schemas/CompletionDetails'
        feedback:
          type: array
          items:
            $ref: '#/components/schemas/Feedback'
        metadata:
          type: array
          items:
            $ref: '#/components/schemas/Metadata'
        trackingURL:
          type: string
          format: uri
        trackingViewed:
          type: boolean
        eta:
          type:
          - integer
          - 'null'
          format: int64
        delayTime:
          type:
          - integer
          - 'null'
        appearance:
          type: object
          properties:
            triangleColor:
              type:
              - string
              - 'null'
        container:
          type: object
          properties:
            type:
              type: string
              enum:
              - ORGANIZATION
              - TEAM
              - WORKER
            organization:
              type: string
    CompletionDetails:
      type: object
      properties:
        success:
          type: boolean
        time:
          type:
          - integer
          - 'null'
          format: int64
        notes:
          type: string
        photoUploadIds:
          type: array
          items:
            type: string
        signatureUploadId:
          type:
          - string
          - 'null'
        events:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              time:
                type: integer
                format: int64
    AutoAssign:
      type: object
      properties:
        mode:
          type: string
          enum:
          - distance
          - load
        team:
          type: string
        considerDependencies:
          type: boolean
        excludedWorkerIds:
          type: array
          items:
            type: string
        maxAssignedTaskCount:
          type: integer
    Metadata:
      type: object
      required:
      - name
      - type
      - value
      properties:
        name:
          type: string
        type:
          type: string
          enum:
          - boolean
          - number
          - string
          - object
          - array
        value: {}
        visibility:
          type: array
          items:
            type: string
            enum:
            - api
            - dashboard
            - worker
    TaskList:
      type: object
      properties:
        lastId:
          type:
          - string
          - 'null'
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/Task'
    Recipient:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        phone:
          type: string
          description: E.164 phone number.
        notes:
          type: string
        skipSMSNotifications:
          type: boolean
        organization:
          type: string
    Feedback:
      type: object
      properties:
        time:
          type: integer
          format: int64
        rating:
          type: integer
          minimum: 1
          maximum: 5
        comments:
          type: string
    TaskUpdate:
      type: object
      properties:
        notes:
          type: string
        completeAfter:
          type: integer
          format: int64
        completeBefore:
          type: integer
          format: int64
        pickupTask:
          type: boolean
        quantity:
          type: integer
        serviceTime:
          type: integer
        metadata:
          type: array
          items:
            $ref: '#/components/schemas/Metadata'
    Destination:
      type: object
      properties:
        id:
          type: string
        address:
          type: object
          properties:
            unparsed:
              type: string
            number:
              type: string
            street:
              type: string
            city:
              type: string
            state:
              type: string
            postalCode:
              type: string
            country:
              type: string
            apartment:
              type: string
        location:
          type: array
          minItems: 2
          maxItems: 2
          items:
            type: number
          description: GeoJSON [longitude, latitude].
        notes:
          type: string
        warnings:
          type: array
          items:
            type: string
    TaskCreate:
      type: object
      properties:
        merchant:
          type: string
        executor:
          type: string
        destination:
          oneOf:
          - type: string
          - $ref: '#/components/schemas/Destination'
        recipients:
          type: array
          items:
            oneOf:
            - type: string
            - $ref: '#/components/schemas/Recipient'
        completeAfter:
          type: integer
          format: int64
        completeBefore:
          type: integer
          format: int64
        pickupTask:
          type: boolean
        dependencies:
          type: array
          items:
            type: string
        notes:
          type: string
          maxLength: 10000
        quantity:
          type: integer
        serviceTime:
          type: integer
        autoAssign:
          $ref: '#/components/schemas/AutoAssign'
        container:
          type: object
        metadata:
          type: array
          items:
            $ref: '#/components/schemas/Metadata'
        appearance:
          type: object
          properties:
            triangleColor:
              type: string
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic