Tasks

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

StateDescription
draftNot yet ready for execution
scheduledScheduled for a future time
unassignedReady but not assigned to a worker
assignedAssigned to a worker
acceptedWorker accepted the task
transitWorker traveling to location
activeWorker working on the task
completedSuccessfully completed
failedCould not be completed
cancelledCancelled

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

CategoryDescription
pick_upCollect items from a location
drop_offDeliver items to a location
servicePerform 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

ParameterDescription
stateFilter by task state (e.g., ?state=assigned)
assigneeFilter by assigned worker
categoryFilter by task category
complete_after__gteTasks due after a specific time
complete_before__lteTasks due before a specific time
orderFilter tasks belonging to a specific order

Example

GET https://api.gsmtasks.com/tasks/?state=assigned