---
title: "List operations"
method: GET
path: "/operations"
tags: ["Operations"]
---

# List operations

`GET /operations`

## Request

- Base URL: `https://api.spoke.com/public/v1`
- URL: `https://api.spoke.com/public/v1/operations`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/spoke/apis/spoke-api/docs/operations/get.ts> (a function with typed inputs; its response is checked against the schema)

## Query parameters

- `pageToken` string
- `maxPageSize` number
- `filter` object
  - `done` union: Filter by whether the operation is done.
    - 'true'
    - 'false'
  - `type` 'plan_optimization': The type of the operation. Use this to filter which operations to get when listing operations. If not specified, all operations are returned. If specified, only operations of the specified type are returned.

## Response `200`

Success

- object: Success
  - `operations` OperationSchema[], required: The operations.
    - `id` string, required
    - `type` 'plan_optimization', required
    - `done` boolean, required: Whether the operation is done.
    - `metadata` object, required: Metadata related to a plan optimization operation.
      - `canceled` boolean, required: Whether the operation was canceled.
      - `startedAt` number, required: The time the operation started at, in seconds since epoch.
      - `finishedAt` number, nullable, required: The time the operation finished at, in seconds since epoch.
      - `startedBy` union, required: The entity that started the operation.
        - 'dispatcher'
        - 'api'
        - string
      - `targetPlanId` string, required
    - `result` union, required: The result of the plan optimization operation, or an error.
      - object
        - `numOptimizedStops` number, required: The number of stops that were considered for optimization.
        - `skippedStops` object[], required: The stops that were skipped, if any.
          - `id` string, required
          - `reason` union, required: The reason the stop was skipped.
            - 'impossible_time_window'
            - 'impossible_navigation'
            - 'impossible_number_of_stops'
            - 'impossible_order_of_stops'
            - string
      - object
        - `code` string, required: A code that identifies the error
        - `message` string, required: A human-readable message that describes the error. This message is not intended to be parsed by machines.
  - `nextPageToken` string, nullable, required: The next page token.

## Other responses

- `400`: Query parameters are invalid
- `401`: Unauthorized
- `500`: An internal server error occurred

---

[API](https://skmtc.dev/spoke/apis/spoke-api.md) - [All operations](https://skmtc.dev/spoke/apis/spoke-api/llms.txt) - [OpenAPI document](https://skmtc.dev/spoke/apis/spoke-api/revisions/a09d9194ae1c?raw)
