State

State

In addition to the parameters detailed for each endpoint in this section, tasks also have a special property state to help you understand the task's most recent status. The following integer values are valid task states:

ValueDescription
0Unassigned: task has not yet been assigned to a worker.
1Assigned: task has been assigned to a worker.
2Active: task has been started by its assigned worker.
3Completed: task has been completed by its assigned worker. Includes both successful and failed completions.

A Task's state cannot be modified directly with the exception of Complete task

{
            "id": "qivLq4myATuyWwmxVO9x7KaF",
            "timeCreated": 1769102993000,
            "timeLastModified": 1769183034233,
            "organization": "TKBGuPjHkYOd4ggOyAIBDQfE",
            "shortId": "51f5dae0",
            "orderShortId": "bb3b3ab2",
            "trackingURL": "https://onf.lt/51f5dae0",
            "worker": null,
            "merchant": "TKBGuPjHkYOd4ggOyAIBDQfE",
            "executor": "gz6~YVrx7HVI34ecvWOG1LfB",
            "creator": "r9UlWdZWMW1PiEyW7QboYSsf",
            "dependencies": [],
            "state": 0,
            "completeAfter": 1769102989489,
            "completeBefore": 1769185789000,
            "pickupTask": true,
            "type": 0,
            "notes": "",
            "completionDetails": {
                "failureNotes": "",
                "successNotes": "",
                "failureReason": "NONE",
                "events": [],
                "actions": [],
                "time": null,
                "signatureUploadId": null,
                "photoUploadId": null,
                "photoUploadIds": null,
                "firstLocation": [],
                "lastLocation": [],
                "unavailableAttachments": []
            },
            "feedback": [],
            "metadata": [],
            "overrides": {},
            "quantity": 7,
            "additionalQuantities": {
                "quantityA": 0,
                "quantityB": 0,
                "quantityC": 0
            },
            "serviceTime": 0,
            "identity": {
                "failedScanCount": 0,
                "checksum": null
            },
            "appearance": {
                "triangleColor": null
            },
            "scanOnlyRequiredBarcodes": false,
            "customFieldGroup": null,
            "customRequirements": [],
            "customFields": [],
            "container": {
                "type": "ORGANIZATION",
                "organization": "gz6~YVrx7HVI34ecvWOG1LfB"
            },
            "trackingViewed": false,
            "packages": [],
            "delayTime": 3369816.002,
            "estimatedCompletionTime": null,
            "estimatedArrivalTime": null,
            "eta": null,
            "recipients": [],
            "order": {
                "id": "wv1*gOnoyFCLTXsu68Mi6XSa",
                "shortId": "bb3b3ab2",
                "timeCreated": 1769102993000,
                "timeLastModified": 1769102993821,
                "source": "courier-dashboard",
                "events": [],
                "pickupTask": "qivLq4myATuyWwmxVO9x7KaF",
                "dropoffTask": "YpKFvBi9vw89WR3nByLU8OOz",
                "organization": "TKBGuPjHkYOd4ggOyAIBDQfE",
                "deliveryService": "sSPEBJuut~kIc4qQHhY6ZrH6",
                "orchestrationDetails": null,
                "price": 40.9,
                "priceBreakdown": [
                    {
                        "name": "Distance cost",
                        "ratingType": "distance",
                        "isBaseRate": true,
                        "cost": 25,
                        "id": "*vWwuwhXH07x*r*TxZSpD4Ka"
                    },
                    {
                        "name": "Weight cost",
                        "ratingType": "weight",
                        "isBaseRate": false,
                        "cost": 15.9,
                        "id": "fnQdOZGCn1AI8lUJU~b2Ajd2"
                    }
                ],
                "currency": "CAD",
                "deliveryServiceInvoice": null,
                "status": "unassigned"
            },
            "destination": {
                "id": "Z~2~SHrdYTMQYzaELMqccnqC",
                "timeCreated": 1769102993000,
                "timeLastModified": 1769102993536,
                "location": [
                    -80.40443309999999,
                    43.3896445
                ],
                "address": {
                    "name": "Conestoga College Kitchener - Doon Campus",
                    "number": "299",
                    "street": "Doon Valley Drive",
                    "apartment": "",
                    "city": "Kitchener",
                    "state": "Ontario",
                    "postalCode": "N2G 4M4",
                    "country": "Canada"
                },
                "notes": "",
                "metadata": [],
                "googlePlaceId": "ChIJ35ro6RiQK4gRfuDtaUPCQyA",
                "warnings": [],
                "useGPS": false
            }
        }
{
            "id": "nLwecz9NTTdlCXtEUztn6l42",
            "timeCreated": 1772135205000,
            "timeLastModified": 1772225230235,
            "organization": "gz6~YVrx7HVI34ecvWOG1LfB",
            "shortId": "2e8f34b0",
            "orderShortId": null,
            "trackingURL": "https://onf.lt/2e8f34b0",
            "worker": "mQpa~QD~LYcG89bPdig8sREj",
            "merchant": "gz6~YVrx7HVI34ecvWOG1LfB",
            "executor": "gz6~YVrx7HVI34ecvWOG1LfB",
            "creator": "r9UlWdZWMW1PiEyW7QboYSsf",
            "dependencies": [],
            "state": 1,
            "completeAfter": 1772125200000,
            "completeBefore": 1772154000000,
            "pickupTask": false,
            "type": 1,
            "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,
            "barcodes": {
                "required": [
                    {
                        "data": "MDAwMDA5MDYw",
                        "blockCompletion": true,
                        "id": "porGTOTBD0ZPeX~zrtb2iwCk"
                    },
                    {
                        "data": "MDAwMDA5MDYw",
                        "blockCompletion": true,
                        "id": "hQlHqMSwIVB~7b7P~gDCzz9g"
                    }
                ],
                "captured": []
            },
            "identity": {
                "failedScanCount": 0,
                "checksum": null
            },
            "appearance": {
                "triangleColor": null
            },
            "scanOnlyRequiredBarcodes": false,
            "routePlan": "Tc7X86NXFNheCNT6VgR6y6fP",
            "customFieldGroup": null,
            "customRequirements": [
                {
                    "key": "numberofPackages",
                    "name": "Number of Packages",
                    "description": "count of packages",
                    "type": "integer",
                    "asArray": false,
                    "contexts": [
                        {
                            "name": "save",
                            "isRequired": false,
                            "conditions": [
                                {
                                    "fieldName": "completionDetails.success",
                                    "comparison": "equal_to",
                                    "targetValue": true
                                },
                                {
                                    "fieldName": "completionDetails.events.$.name",
                                    "comparison": "equal_to",
                                    "targetValue": "adminCompletion"
                                }
                            ]
                        }
                    ],
                    "visibility": [
                        "admin",
                        "api",
                        "worker"
                    ],
                    "editability": [
                        "admin",
                        "api"
                    ],
                    "fieldRules": {
                        "taskCompletionField": true
                    },
                    "requiredOnSuccess": false
                },
                {
                    "key": "numberofpackages",
                    "name": "Number of packages2",
                    "description": "",
                    "type": "integer",
                    "asArray": false,
                    "contexts": [
                        {
                            "name": "save",
                            "isRequired": false,
                            "conditions": [
                                {
                                    "fieldName": "completionDetails.success",
                                    "comparison": "equal_to",
                                    "targetValue": true
                                },
                                {
                                    "fieldName": "completionDetails.events.$.name",
                                    "comparison": "equal_to",
                                    "targetValue": "adminCompletion"
                                }
                            ]
                        }
                    ],
                    "visibility": [
                        "admin",
                        "api",
                        "worker"
                    ],
                    "editability": [
                        "admin",
                        "api"
                    ],
                    "fieldRules": {
                        "taskCompletionField": true
                    },
                    "requiredOnSuccess": false
                },
                {
                    "key": "numberofitems",
                    "name": "Numberofitems",
                    "description": "",
                    "type": "decimal",
                    "asArray": false,
                    "contexts": [
                        {
                            "name": "save",
                            "isRequired": true,
                            "conditions": [
                                {
                                    "fieldName": "completionDetails.success",
                                    "comparison": "equal_to",
                                    "targetValue": true
                                },
                                {
                                    "fieldName": "completionDetails.events.$.name",
                                    "comparison": "equal_to",
                                    "targetValue": "adminCompletion"
                                }
                            ]
                        }
                    ],
                    "visibility": [
                        "admin",
                        "api",
                        "worker"
                    ],
                    "editability": [
                        "admin",
                        "api"
                    ],
                    "fieldRules": {
                        "taskCompletionField": true
                    },
                    "requiredOnSuccess": true
                }
            ],
            "customFields": [],
            "container": {
                "type": "WORKER",
                "worker": "mQpa~QD~LYcG89bPdig8sREj"
            },
            "trackingViewed": false,
            "packages": [],
            "recipients": [],
            "eta": null,
            "delayTime": 403861.346,
            "estimatedCompletionTime": 1772557861346,
            "estimatedArrivalTime": 1772556961346,
            "destination": {
                "id": "bZpKEtz6lEM4Oz~aLO57mz2u",
                "timeCreated": 1772135205000,
                "timeLastModified": 1772135205943,
                "location": [
                    -80.4558552,
                    43.2901082
                ],
                "address": {
                    "name": "ABE ERB - Ayr Village",
                    "number": "143",
                    "street": "Northumberland Street",
                    "city": "North Dumfries",
                    "state": "Ontario",
                    "postalCode": "N0B 1E0",
                    "country": "Canada",
                    "apartment": ""
                },
                "notes": "",
                "metadata": [],
                "googlePlaceId": "ChIJ_T1wnvwNLIgRGMCQS4phbe4",
                "warnings": [],
                "useGPS": false
            }
}
{
            "id": "ZDhwdkwkQKo67iFyvMpF7r2V",
            "timeCreated": 1772487789000,
            "timeLastModified": 1772555500114,
            "organization": "gz6~YVrx7HVI34ecvWOG1LfB",
            "shortId": "4b011d39",
            "orderShortId": null,
            "trackingURL": "https://onf.lt/4b011d39",
            "worker": "mQpa~QD~LYcG89bPdig8sREj",
            "merchant": "gz6~YVrx7HVI34ecvWOG1LfB",
            "executor": "gz6~YVrx7HVI34ecvWOG1LfB",
            "creator": "r9UlWdZWMW1PiEyW7QboYSsf",
            "dependencies": [],
            "state": 2,
            "completeAfter": null,
            "completeBefore": null,
            "pickupTask": false,
            "type": 1,
            "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,
            "customFieldGroup": null,
            "customRequirements": [],
            "customFields": [],
            "container": {
                "type": "WORKER",
                "worker": "mQpa~QD~LYcG89bPdig8sREj"
            },
            "trackingViewed": false,
            "packages": [],
            "recipients": [],
            "destination": {
                "id": "Ee5RqibGyFJYa2GsKcWVqtW9",
                "timeCreated": 1772487789000,
                "timeLastModified": 1772487789426,
                "location": [
                    -80.48568279999999,
                    43.44855
                ],
                "address": {
                    "name": "SMK African Foods Inc",
                    "number": "206-C",
                    "street": "King Street East",
                    "city": "Kitchener",
                    "state": "Ontario",
                    "postalCode": "N2G 2L1",
                    "country": "Canada",
                    "apartment": ""
                },
                "notes": "",
                "metadata": [],
                "googlePlaceId": "ChIJVVV5tO30K4gR_utDUrrlPq8",
                "warnings": [],
                "useGPS": false
            },
            "eta": 374
        }
    ]
}
{
    "id": "NYAQNZ6~bjh2ZQ5WirynS4bc",
            "timeCreated": 1749674099000,
            "timeLastModified": 1767723748166,
            "organization": "gz6~YVrx7HVI34ecvWOG1LfB",
            "shortId": "5486598d",
            "orderShortId": null,
            "trackingURL": "https://onf.lt/5486598d",
            "worker": "mQpa~QD~LYcG89bPdig8sREj",
            "merchant": "gz6~YVrx7HVI34ecvWOG1LfB",
            "executor": "gz6~YVrx7HVI34ecvWOG1LfB",
            "creator": "r9UlWdZWMW1PiEyW7QboYSsf",
            "dependencies": [],
            "state": 3,
            "completeAfter": null,
            "completeBefore": null,
            "pickupTask": false,
            "type": 1,
            "notes": "",
            "completionDetails": {
                "time": 1767723687618,
                "success": true,
                "notes": "Htdxd",
                "events": [
                    {
                        "name": "start",
                        "time": 1767723668617
                    },
                    {
                        "name": "arrival",
                        "time": 1767723683846,
                        "location": [
                            -80.500990638,
                            43.450479373
                        ]
                    },
                    {
                        "name": "departure",
                        "time": 1767723678851,
                        "location": [
                            -80.500990638,
                            43.450479373
                        ]
                    }
                ],
                "signatureText": "Ghh",
                "actions": [],
                "failureNotes": "",
                "failureReason": "NONE",
                "successNotes": "",
                "signatureUploadId": "af0a827be1065b0d00e3a73e",
                "photoUploadId": "d9a438dd14caf1a3abb6c075",
                "photoUploadIds": [
                    "d9a438dd14caf1a3abb6c075",
                    "d577e30b212ca4a835748ace"
                ],
                "firstLocation": [
                    -80.500990638,
                    43.450479373
                ],
                "lastLocation": [
                    -80.500990638,
                    43.450479373
                ],
                "unavailableAttachments": [],
                "distance": 0
            },
            "feedback": [],
            "metadata": [],
            "overrides": {},
            "quantity": 0,
            "additionalQuantities": {
                "quantityA": 0,
                "quantityB": 0,
                "quantityC": 0
            },
            "serviceTime": 0,
            "identity": {
                "failedScanCount": 0,
                "checksum": null
            },
            "appearance": {
                "triangleColor": null
            },
            "scanOnlyRequiredBarcodes": false,
            "routePlan": "*GGUhlbQM*GX~kiTJTlgsESe",
            "customFieldGroup": null,
            "customRequirements": [],
            "customFields": [
                {
                    "key": "website",
                    "name": "website",
                    "description": "",
                    "type": "url",
                    "asArray": false,
                    "contexts": [
                        {
                            "name": "save",
                            "isRequired": false,
                            "conditions": []
                        }
                    ],
                    "visibility": [
                        "admin",
                        "api",
                        "worker"
                    ],
                    "editability": [
                        "admin",
                        "api"
                    ],
                    "value": "https://mail.google.com/mail/u/0/#inbox"
                },
                {
                    "key": "driverPayTotal",
                    "name": "Driver Pay Total",
                    "description": "Total driver pay for this task (calculated via payroll integration)",
                    "type": "decimal",
                    "asArray": false,
                    "contexts": [
                        {
                            "name": "save",
                            "isRequired": false,
                            "conditions": []
                        }
                    ],
                    "visibility": [
                        "admin",
                        "api"
                    ],
                    "editability": [
                        "admin",
                        "api"
                    ],
                    "fieldRules": {
                        "hiddenBeforeTaskCompleted": true,
                        "readOnlyBeforeTaskCompleted": true
                    },
                    "integration": "payroll",
                    "value": 34
                },
                {
                    "key": "driverPayLineItems",
                    "name": "Driver Pay Line Items",
                    "description": "Itemized breakdown of how the driver pay was calculated (via payroll integration) for this task",
                    "type": "multi_line_text_field",
                    "asArray": false,
                    "contexts": [
                        {
                            "name": "save",
                            "isRequired": false,
                            "conditions": []
                        }
                    ],
                    "visibility": [
                        "admin",
                        "api"
                    ],
                    "editability": [
                        "admin",
                        "api"
                    ],
                    "fieldRules": {
                        "hiddenBeforeTaskCompleted": true,
                        "readOnlyBeforeTaskCompleted": true
                    },
                    "integration": "payroll",
                    "value": "Flat Rate: $34"
                }
            ],
            "sourceTaskId": "z5JTYimZDIcS4zW0IyZa61Ht",
            "trackingViewed": false,
            "packages": [],
            "delayTime": null,
            "estimatedCompletionTime": null,
            "estimatedArrivalTime": null,
            "eta": null,
            "order": {
                "id": "ATQO5dgybzqy8AIBMHQp4QLI",
                "shortId": "138355b5",
                "timeCreated": 1767723688000,
                "timeLastModified": 1767723688645,
                "events": [
                    {
                        "event": "state",
                        "comment": 3,
                        "time": 1767723688645
                    },
                    {
                        "event": "trackingURL",
                        "comment": "https://onf.lt/5486598d",
                        "time": 1767723688645
                    },
                    {
                        "event": "locationId",
                        "comment": null,
                        "time": 1767723688645
                    },
                    {
                        "event": "isManual",
                        "comment": false,
                        "time": 1767723688645
                    }
                ],
                "pickupTask": null,
                "dropoffTask": "NYAQNZ6~bjh2ZQ5WirynS4bc",
                "organization": "gz6~YVrx7HVI34ecvWOG1LfB",
                "deliveryService": null,
                "orchestrationDetails": null,
                "priceBreakdown": [],
                "deliveryServiceInvoice": null
            },
            "recipients": [],
            "destination": {
                "id": "tlWg5TvE1t0W6sK*DcPQFsY7",
                "timeCreated": 1749674098000,
                "timeLastModified": 1749674163040,
                "location": [
                    -80.4853115,
                    43.4482913
                ],
                "address": {
                    "name": "New City Supermarket",
                    "number": "236",
                    "street": "King Street East",
                    "apartment": "",
                    "city": "Kitchener",
                    "state": "Ontario",
                    "postalCode": "N2G 2L1",
                    "country": "Canada"
                },
                "notes": "",
                "metadata": [],
                "googlePlaceId": "ChIJFxnzSuz0K4gR7axbKiLBrc8",
                "warnings": [],
                "useGPS": false
            }
        }
}