List Unassigned Tasks in a Team

Returns a paginated collection of all tasks currently in a Team given the Team Id that are not assigned to a worker. This does not include historical Tasks that were assigned to that Team.

The returned tasks are always sorted by creation time. Each request will return up to 64 tasks but may return fewer and still include a lastId. lastId will be missing from the response once the last page of the results has been reached, so if the lastId is present, you should continue to paginate through the results.

Query Parameters:

Name

Type

Description

isPickupTask

boolean

Optional. True or False to determine the result should only list Pick-up tasks or Drop-off tasks

to

number

Optional. If missing, defaults to the current time. The ending time of the range. Tasks created before this time will be included.

from

number

The starting time of the time range in unix. Tasks created at or after this time will be included. Default is 7 days before the current time.

lastId

string

Optional. Used to walk the paginated response, if there is one. Tasks created after this ID will be returned.

🚧

502 Internal Timed out

Onfleet has an internal system timeout of 70 seconds, which can be encountered when listing tasks. If the 502 error comes up, try narrowing your search parameters so that query can be executed more quickly.

curl -X GET "https://onfleet.com/api/v2/teams/K3FXFtJj2FtaO2~H60evRrDc/tasks" \
       -u "cd3b3de84cc1ee040bf06512d233719c:"
onfleet.teams.getTasks(id='yKpCnWprM1Rvp3NGGlVa5TMa', queryParams={"from":1455072025000, "lastId": "tPMO~h03sOIqFbnhqaOXgUsd"})
onfleet.teams.getTasks('h*wSb*apKlDkUFnuLTtjPke7',{"from":1455072025000, "lastId": "tPMO~h03sOIqFbnhqaOXgUsd"})
{
    "tasks": [
        {
            "id": "3VtEMGudjwjjM60j7deSIY3j",
            "timeCreated": 1643317843000,
            "timeLastModified": 1643413337768,
            "organization": "nYrkNP6jZMSKgBwG9qG7ci3J",
            "shortId": "c77ff497",
            "trackingURL": "https://onf.lt/c77ff497",
            "worker": null,
            "merchant": "nYrkNP6jZMSKgBwG9qG7ci3J",
            "executor": "nYrkNP6jZMSKgBwG9qG7ci3J",
            "creator": "vjw*RDMKDljKVDve1Vtcplgu",
            "dependencies": [],
            "state": 0,
            "completeAfter": null,
            "completeBefore": null,
            "pickupTask": false,
            "notes": "",
            "completionDetails": {
                "failureNotes": "",
                "failureReason": "NONE",
                "events": [],
                "actions": [],
                "time": 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,
            "container": {
                "type": "TEAM",
                "team": "K3FXFtJj2FtaO2~H60evRrDc"
            },
            "trackingViewed": false,
            "recipients": [],
            "delayTime": null,
            "estimatedCompletionTime": null,
            "estimatedArrivalTime": null,
            "eta": null,
            "destination": {
                "id": "nk5xGuf1eQguYXg1*mIVl0Ut",
                "timeCreated": 1643317843000,
                "timeLastModified": 1643317843121,
                "location": [
                    -117.8764687,
                    33.8078476
                ],
                "address": {
                    "apartment": "",
                    "state": "California",
                    "postalCode": "92806",
                    "number": "2695",
                    "street": "East Katella Avenue",
                    "city": "Anaheim",
                    "country": "United States",
                    "name": "Honda Center"
                },
                "notes": "",
                "metadata": [],
                "googlePlaceId": "ChIJXyczhHXX3IARFVUqyhMqiqg",
                "warnings": []
            }
        }
    ]
}