---
updatedAt: 2026-09-22T16:00:59.000Z
agentTools:
  projectIndex: https://docs.onfleet.com/llms.txt
---

# Get single task

## Get single task

If a task has been completed (`state` is `3`) and details were provided by the worker at completion, these will be available in `completionDetails`. They include start, arrival, departure and completion times, first location, last location, and whether the task was successfully completed or if it was considered to have failed by the worker.

Tasks also include a `delayTime` , which you should leverage if you want to build custom logic around actions to be taken when a task is delayed.

Any recipient feedback (rating and comments) provided will appear in `feedback`.

If you would like to load the live tracking page for a task within your app, use the `trackingURL` value returned in the body of this request.

A Task will return a `routePlan` field if it is a part of a [Route Plan](https://docs.onfleet.com/reference/routeplan). The field will be absent if the task is not in a Route Plan.

Adding `?assignmentHistory=true` will include an `assignmentHistory` object detailing the various containers that the task was included in.

```shell Request
curl -X GET "https://onfleet.com/api/v2/tasks/qNMz6CKwQ*26FOslywsiQxhY" \
       -u "<your_api_key>:"
```
```python
onfleet.tasks.get(id="qNMz6CKwQ*26FOslywsiQxhY")
```
```javascript
onfleet.tasks.get("qNMz6CKwQ*26FOslywsiQxhY");
```
```php
$onfleet->tasks->get("qNMz6CKwQ*26FOslywsiQxhY")
```
```curl Request with assignmentHistory
curl -X GET "https://onfleet.com/api/v2/tasks/qNMz6CKwQ*26FOslywsiQxhY?assignmentHistory=true" \
       -u "<your_api_key>:"
```

```json Response
{
  "id": "qNMz6CKwQ*26FOslywsiQxhY",
  "timeCreated": 1455072004000,
  "timeLastModified": 1455152824153,
  "organization": "yAM*fDkztrT3gUcz9mNDgNOL",
  "shortId": "5f8b5c65",
  "orderShortId": null,
  "trackingURL": "https://onf.lt/5f8b5c65f9",
  "worker": "h*wSb*apKlDkUFnuLTtjPke7",
  "merchant": "yAM*fDkztrT3gUcz9mNDgNOL",
  "executor": "yAM*fDkztrT3gUcz9mNDgNOL",
  "creator": "EJmsbJgHiRLPjNVE7GEIPs7*",
  "dependencies": [],
  "state": 3,
  "completeAfter": null,
  "completeBefore": null,
  "pickupTask": false,
  "notes": "",
  "completionDetails": {
    "events": [
      {
        "name": "start",
        "time": 1455072035445
      },
      {
        "name": "arrival",
        "time": 1455152532564,
        "location": [
          -122.401521416785,
          37.7762999215933
        ]
      },
      {
        "name": "departure",
        "time": 1455072096121,
        "location": [
          -122.401357311869,
          37.776509919239
        ]
      }
    ],
    "failureReason": "NONE",
    "time": 1455152532732,
    "photoUploadId": "1cf9c8d5d00a763865729825",
    "notes": "All went great, customer loves us.",
    "success": true,
    "signatureUploadId": "a49846b937eeab3cea248301",
    "photoUploadIds": [],
    "firstLocation": [
      -122.401520936125,
      37.7762955408506
    ],
    "lastLocation": [
      -122.401521416785,
      37.7762999215933
    ],
    "distance": 7847.92014273528
  },
  "feedback": [],
  "metadata": [],
  "overrides": {},
  "quantity": 0,
  "serviceTime": 0,
  "trackingViewed": false,
  "estimatedCompletionTime": null,
  "delayTime": null,
  "destination": {
    "id": "Nml*Tdh1EMIk1RE46maqOLEQ",
    "timeCreated": 1455072004000,
    "timeLastModified": 1455072004352,
    "location": [
      -122.40522369999996,
      37.7718827
    ],
    "address": {
      "apartment": "",
      "state": "California",
      "postalCode": "94103",
      "country": "United States",
      "city": "San Francisco",
      "street": "Brannan Street",
      "number": "888"
    },
    "notes": "",
    "metadata": []
  },
  "eta": null,
  "recipients": [
    {
      "id": "xX87G1gSkeLvGXlHn2tn0~iB",
      "organization": "yAM*fDkztrT3gUcz9mNDgNOL",
      "timeCreated": 1455072004000,
      "timeLastModified": 1455072025272,
      "name": "Mikel",
      "phone": "+16502837547",
      "notes": "",
      "skipSMSNotifications": false,
      "metadata": []
    }
  ]
}
```
```json Error - Invalid Permission
{
  "code": "InvalidCredentials",
  "message": {
    "error": 1103,
    "message": "The resource requested is outside of the authenticated user's permissions scope.",
    "request": "f25e5ee9-cd6d-498a-8616-26c3bd205eba"
  }
}
```
```json Response when a Task is in a Route Plan
{
    "id": "M~NgEWdvKl4naQcNz29zDN8v",
    "timeCreated": 1721148688000,
    "timeLastModified": 1721148691872,
    "organization": "IkslFemIdKalRKmVYY3pWCW~",
    "shortId": "02cf3365",
    "orderShortId": null,
    "trackingURL": "https://onf.lt/02cf3365",
    "worker": null,
    "merchant": "IkslFemIdKalRKmVYY3pWCW~",
    "executor": "IkslFemIdKalRKmVYY3pWCW~",
    "creator": "lyEgBv9h12D6KjO~Wd~3K~qp",
    "dependencies": [],
    "state": 0,
    "completeAfter": null,
    "completeBefore": null,
    "pickupTask": false,
    "notes": "",
    "completionDetails": {
        "failureNotes": "",
        "successNotes": "",
        "failureReason": "NONE",
        "events": [],
        "actions": [],
        "time": null,
        "signatureUploadId": null,
        "photoUploadId": null,
        "photoUploadIds": null,
        "firstLocation": [],
        "lastLocation": [],
        "unavailableAttachments": []
    },
    "feedback": [],
    "metadata": [],
    "overrides": {},
    "quantity": 0,
    "additionalQuantities": {
        "quantityA": 0,
        "quantityB": 0,
        "quantityC": 0
    },
    "serviceTime": 0,
    "identity": {
        "failedScanCount": 0,
        "checksum": null
    },
    "appearance": {
        "triangleColor": null
    },
    "scanOnlyRequiredBarcodes": false,
    "customFields": [
        {
            "description": "",
            "asArray": false,
            "visibility": [
                "admin",
                "api",
                "worker"
            ],
            "editability": [
                "admin",
                "api"
            ],
            "key": "boolTest2",
            "name": "deleted no req bool test",
            "type": "boolean",
            "contexts": [
                {
                    "isRequired": false,
                    "conditions": [],
                    "name": "save"
                }
            ],
            "value": false
        },
        {
            "description": "",
            "asArray": false,
            "visibility": [
                "admin",
                "api",
                "worker"
            ],
            "editability": [
                "admin",
                "api"
            ],
            "key": "boolTest2",
            "name": "no req bool test",
            "type": "boolean",
            "contexts": [
                {
                    "isRequired": false,
                    "conditions": [],
                    "name": "save"
                }
            ],
            "value": false
        },
        {
            "description": "testing field order",
            "asArray": false,
            "visibility": [
                "admin",
                "api",
                "worker"
            ],
            "editability": [
                "admin",
                "api"
            ],
            "key": "newfield",
            "name": "new field!",
            "type": "boolean",
            "contexts": [
                {
                    "isRequired": false,
                    "conditions": [],
                    "name": "save"
                }
            ],
            "value": false
        }
    ],
    "routePlan": "d4q6sSH1WBbZsP0z4tsAh9Ir",
    "container": {
        "type": "ORGANIZATION",
        "organization": "IkslFemIdKalRKmVYY3pWCW~"
    },
    "trackingViewed": false,
    "recipients": [],
    "estimatedCompletionTime": null,
    "estimatedArrivalTime": null,
    "delayTime": null,
    "eta": null,
    "destination": {
        "id": "2jHSBD7~SktinmoEdS2FqwZK",
        "timeCreated": 1721148688000,
        "timeLastModified": 1721148688629,
        "location": [
            -117.8862833,
            33.9156138
        ],
        "address": {
            "apartment": "",
            "state": "California",
            "postalCode": "92821",
            "number": "1065",
            "street": "Brea Mall",
            "city": "Brea",
            "country": "United States",
            "name": "Brea Mall"
        },
        "notes": "",
        "metadata": [],
        "googlePlaceId": "ChIJwS0hgwbV3IARL4oucH0V6P8",
        "warnings": [],
        "useGPS": false
    }
}
```
```json Response with assignmentHistory
{
  "id": "qNMz6CKwQ*26FOslywsiQxhY",
  "timeCreated": 1455072004000,
  "timeLastModified": 1455152824153,
  "organization": "yAM*fDkztrT3gUcz9mNDgNOL",
  "shortId": "5f8b5c65",
  "orderShortId": null,
  "trackingURL": "https://onf.lt/5f8b5c65f9",
  "worker": "h*wSb*apKlDkUFnuLTtjPke7",
  "merchant": "yAM*fDkztrT3gUcz9mNDgNOL",
  "executor": "yAM*fDkztrT3gUcz9mNDgNOL",
  "creator": "EJmsbJgHiRLPjNVE7GEIPs7*",
  "dependencies": [],
  "state": 3,
  "completeAfter": null,
  "completeBefore": null,
  "pickupTask": false,
  "notes": "",
  "assignmentHistory": [
    {
        "actionContext": {
            "type": "WORKER",
            "id": "COwfwH~Zogm1LXIZYbPlLAyw"
        },
        "containerDescription": {
            "type": "WORKER",
            "organization": "nYrkNP6jZMSKgBwG9qG7ci3J",
            "worker": "COwfwH~Zogm1LXIZYbPlLAyw"
        },
        "time": 1606933294810
    }
  ],
  "completionDetails": {
    "events": [
      {
        "name": "start",
        "time": 1455072035445
      },
      {
        "name": "arrival",
        "time": 1455152532564,
        "location": [
          -122.401521416785,
          37.7762999215933
        ]
      },
      {
        "name": "departure",
        "time": 1455072096121,
        "location": [
          -122.401357311869,
          37.776509919239
        ]
      }
    ],
    "failureReason": "NONE",
    "time": 1455152532732,
    "photoUploadId": "1cf9c8d5d00a763865729825",
    "notes": "All went great, customer loves us.",
    "success": true,
    "signatureUploadId": "a49846b937eeab3cea248301",
    "photoUploadIds": [],
    "firstLocation": [
      -122.401520936125,
      37.7762955408506
    ],
    "lastLocation": [
      -122.401521416785,
      37.7762999215933
    ],
    "distance": 7847.92014273528
  },
  "feedback": [],
  "metadata": [],
  "overrides": {},
  "quantity": 0,
  "serviceTime": 0,
  "trackingViewed": false,
  "estimatedCompletionTime": null,
  "delayTime": null,
  "destination": {
    "id": "Nml*Tdh1EMIk1RE46maqOLEQ",
    "timeCreated": 1455072004000,
    "timeLastModified": 1455072004352,
    "location": [
      -122.40522369999996,
      37.7718827
    ],
    "address": {
      "apartment": "",
      "state": "California",
      "postalCode": "94103",
      "country": "United States",
      "city": "San Francisco",
      "street": "Brannan Street",
      "number": "888"
    },
    "notes": "",
    "metadata": []
  },
  "eta": null,
  "recipients": [
    {
      "id": "xX87G1gSkeLvGXlHn2tn0~iB",
      "organization": "yAM*fDkztrT3gUcz9mNDgNOL",
      "timeCreated": 1455072004000,
      "timeLastModified": 1455072025272,
      "name": "Mikel",
      "phone": "+16502837547",
      "notes": "",
      "skipSMSNotifications": false,
      "metadata": []
    }
  ]
}
```

When attempting to access a task endpoint that does not belong to your organization, an error message will be thrown stating that the request is outside of your permission scope.

<Callout icon="📘" theme="info">
  ### Estimated Completion Time and ETA

  Tasks that have been assigned and are not yet started include an `estimatedCompletionTime`.

  The ECT includes transit (travel time from the departure point to the destination) and service time as provided during task creation. If a `serviceTime` has been provided, this will be a constant value added to the transit estimate. If the task has been route optimized, we will use the service time from the route optimization solution. Finally, if a service time is not provided, we will always use the value  based on your organization's past performance.

  An `eta` property is also available for active tasks which you can use to access the number of seconds from worker’s position to reach the destination. This field is calculated by considering the worker's current GPS location plus the transit time to reach the destination coordinates which may vary by vehicle type and location.
</Callout>

<Callout icon="📘" theme="info">
  ### Data Types and Response Formats

  For more information on datatype and formats, please see [Data Types and Response Formats](https://docs.onfleet.com/reference/data-types-and-response-formats) or free conversion tool online [here](https://unixtime.org/).
</Callout>

<Callout icon="📘" theme="info">
  ### Geofence

  Geofence is a Scale and Enterprise level feature, please contact support or your CSM for more information on how to obtain this feature.&#x20;

  This will show if the Driver is trying to complete outside of the geofence area set by the organization setting. Two new fields will be attached to any tasks with geofence enabled:

  - `geofenceAttempts` - Type `1` is an warning, and Type `2` is a block
  - `completedWithGeofenceWarning` - `True` if warned, `False` if not

  ```json Example
          "geofenceAttempts": [
              {
                  "type": 1,
                  "location": [
                      -122.288615,
                      37.8986409
                  ],
                  "timestamp": 1786564299913
              },
              {
                  "type": 2,
                  "location": [
                      -122.288615,
                      37.8986409
                  ],
                  "timestamp": 1786564303545
              }
          ],
          "completedWithGeofenceWarning": true,
          "location": [
              -122.288615,
              37.8986409
  ```
</Callout>