Tasks
Tasks represent stops or waypoints that need to be visited - pickups, deliveries, or service appointments at specific addresses.
Please find the tehnical API specification here for tasks.
Task states
| State | Description |
|---|---|
draft | Not yet ready for execution |
scheduled | Scheduled for a future time |
unassigned | Ready but not assigned to a worker |
assigned | Assigned to a worker |
accepted | Worker accepted the task |
transit | Worker traveling to location |
active | Worker working on the task |
completed | Successfully completed |
failed | Could not be completed |
cancelled | Cancelled |
Creating a task
HTTP request
POST https://api.gsmtasks.com/tasks/
Request
{
"account": "https://api.gsmtasks.com/accounts/a6f60fdf-d87b-4c5d-b5ec-67a90cd16336/",
"category": "drop_off",
"address": {
"raw_address": "381 Queen Street, London, SW85 1GX"
},
"contact": {
"name": "John Doe",
"company": "Example Company",
"emails": ["john@example.com"],
"phones": ["+44 1632 960167"]
},
"complete_after": "2022-01-01T14:00:00Z",
"complete_before": "2022-01-01T16:00:00Z",
"description": "Deliver package to reception"
}Response
{
"id": "e9ba6977-ddc4-41b9-b90b-1ae9b37b3c05",
"url": "https://api.gsmtasks.com/tasks/e9ba6977-ddc4-41b9-b90b-1ae9b37b3c05/",
"account": "https://api.gsmtasks.com/accounts/a6f60fdf-d87b-4c5d-b5ec-67a90cd16336/",
"state": "unassigned",
"category": "drop_off",
"address": {
"raw_address": "381 Queen Street, London, SW85 1GX",
"formatted_address": "381 Queen Street, London SW85 1GX, UK",
"location": {
"type": "Point",
"coordinates": [-0.1276, 51.5074]
}
},
"contact": {
"name": "John Doe",
"company": "Example Company",
"emails": ["john@example.com"],
"phones": ["+44 1632 960167"]
},
"complete_after": "2022-01-01T14:00:00Z",
"complete_before": "2022-01-01T16:00:00Z",
"description": "Deliver package to reception",
"assignee": null,
"order": null,
"position": null,
"created_at": "2022-01-01T10:00:00.000000Z",
"updated_at": "2022-01-01T10:00:00.000000Z"
}Task categories
| Category | Description |
|---|---|
pick_up | Collect items from a location |
drop_off | Deliver items to a location |
service | Perform a service at a location |
Task position and ordering
The position field determines task order in a worker’s list. Lower values appear first.
💡
To reorder tasks, use Task Commands with the update action.
Updating a task
HTTP request
PATCH https://api.gsmtasks.com/tasks/{task_id}/
Request
{
"description": "Updated description",
"complete_before": "2022-01-01T18:00:00Z"
}💡
Use task commands for state changes and reordering.
Filtering tasks
| Parameter | Description |
|---|---|
state | Filter by task state (e.g., ?state=assigned) |
assignee | Filter by assigned worker |
category | Filter by task category |
complete_after__gte | Tasks due after a specific time |
complete_before__lte | Tasks due before a specific time |
order | Filter tasks belonging to a specific order |
Example
GET https://api.gsmtasks.com/tasks/?state=assigned