Fleet Engine – Task Reference
Task Creation Endpoints
Create a single Task
POST https://fleetengine.googleapis.com/v1/{parent=providers/*}/tasks
Create multiple Tasks in batch
POST https://fleetengine.googleapis.com/v1/{parent=providers/*}/tasks:batchCreate
Path Parameters
| Field |
Type |
Description |
parent |
string |
Required. Format: providers/{provider} (GCP project ID). |
taskId |
string |
Required. Unique Task ID. Max 64 characters, Unicode NFC, without characters / : ? , #. |
Task Object Structure
{
"name": "providers/sample-project/tasks/task-123",
"type": "DELIVERY",
"state": "OPEN",
"taskOutcome": "SUCCEEDED",
"taskOutcomeTime": "2025-07-21T15:01:23Z",
"taskOutcomeLocation": {
"point": {
"latitude": 38.736946,
"longitude": -9.142685
},
"place": "Lisboa",
"pointLocationSource": "PROVIDER"
},
"taskOutcomeLocationSource": "PROVIDER",
"trackingId": "tracking-abc-123",
"plannedLocation": {
"point": {
"latitude": 38.736946,
"longitude": -9.142685
},
"place": "Lisboa",
"pointLocationSource": "PROVIDER"
},
"taskDuration": "600s",
"targetTimeWindow": {
"startTime": "2025-07-21T09:00:00Z",
"endTime": "2025-07-21T10:00:00Z"
},
"attributes": [{ "key": "driver_id", "stringValue": "driver-123" }]
}
Allowed Fields in Body (POST)
| Field |
Can include? |
Notes |
Enum/Type |
name |
❌ |
Auto-generated |
string |
type |
✅ |
Required |
📋 type |
state |
✅ |
Required |
📋 state |
taskOutcome |
✅ |
Optional, depends on state |
📋 taskOutcome |
taskOutcomeTime |
✅ |
Optional |
string (RFC 3339) |
taskOutcomeLocation |
✅ |
Optional, otherwise auto-filled |
📋 LocationInfo |
taskOutcomeLocationSource |
✅ |
Optional |
📋 taskOutcomeLocationSource |
trackingId |
✅ |
Optional, not for all types |
string |
deliveryVehicleId |
❌ |
Output only |
string |
plannedLocation |
✅ |
Required except if UNAVAILABLE |
📋 LocationInfo |
taskDuration |
✅ |
Required |
string (ex: "600s") |
targetTimeWindow |
✅ |
Optional |
📋 TimeWindow |
journeySharingInfo |
❌ |
Output only |
object |
taskTrackingViewConfig |
✅ |
Optional |
object |
attributes |
✅ |
Optional |
📋 TaskAttribute |
Enums
type
| Enum |
Description |
TYPE_UNSPECIFIED |
Unknown type (default). |
PICKUP |
Pickup of a package from a customer. |
DELIVERY |
Delivery of a package to a customer. |
SCHEDULED_STOP |
Planned stop (depot, feeder, etc). |
UNAVAILABLE |
Vehicle unavailable (ex: break, refueling). |
taskOutcome
| Enum |
Description |
TASK_OUTCOME_UNSPECIFIED |
No result defined yet. |
SUCCEEDED |
Task completed successfully. |
FAILED |
Task failed or was canceled. |
state
| Enum |
Description |
STATE_UNSPECIFIED |
State unspecified. |
OPEN |
Not yet assigned to a vehicle or not yet executed. |
CLOSED |
Vehicle has already passed the associated stop. |
taskOutcomeLocationSource
| Enum |
Description |
TASK_OUTCOME_LOCATION_SOURCE_UNSPECIFIED |
Unknown. |
PROVIDER |
Specified by the provider. |
LAST_VEHICLE_LOCATION |
Automatically filled by the system. |
Additional Structures
LocationInfo
{
"point": {
"latitude": 38.736946,
"longitude": -9.142685
},
"place": "Lisboa",
"pointLocationSource": "PROVIDER"
}
TimeWindow
{
"startTime": "2025-07-21T09:00:00Z",
"endTime": "2025-07-21T10:00:00Z"
}
TaskAttribute
{
"key": "driver_id",
"stringValue": "driver-123"
}
- The
task_attribute_value field can be:
stringValue (ex: "driver-123")
boolValue (ex: true)
numberValue (ex: 42)
- Max 256 characters per
key:value pair
- The
key cannot contain :