> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getswitch.io/llms.txt
> Use this file to discover all available pages before exploring further.

# List Fleet Tasks

> Open tasks (work orders such as battery swaps, pickups or maintenance) that your fleet platform holds for vehicles in one location, with priority and validity window. Filtering, sorting and pagination (`filter`, `sort`, `limit`, `cursor`) apply to the whole list; follow `next_cursor` while `has_more` is true. The list is cached for up to 1 minutes.

Integrations talk to the fleet platform your company is linked to (for example Wunder, ATOM or an MDS feed) and return its data in one common format, whatever the platform. They need a fleet integration configured for your company; `GET /integrations/availability` shows which kinds of data and operations your platform supports.

**Failure Modes:**
- **401**: Token is missing or invalid
- **403**: `access_denied` when your role or API key lacks the permission below
- **404**: `no_data_binding` (`kind: fleet`) when no fleet integration is configured for your company; `no_data_binding` (`kind: location`) when `location` is not one of its locations
- **422**: Invalid parameters, or your fleet platform does not support this (`Unknown provider: ...`)
- **502**: The fleet platform returned an error (`Upstream provider error: ...`)

**Required Auth Scopes:**
- `integrations:tasks:read`



## OpenAPI

````yaml /api-reference/openapi.json get /integrations/tasks
openapi: 3.1.0
info:
  title: SWITCH API
  version: '1.0'
  description: >-
    The SWITCH API gives mobility and logistics teams programmatic access to
    SWITCH forecasts, fleet operations, routing and analytics. Every request is
    authenticated with an API key sent as a bearer token.
servers:
  - url: https://api.getswitch.io
    description: Production
security: []
tags:
  - name: Forecast
    description: Demand forecasts per zone and time window.
  - name: Operations
    description: Fleet imbalance, rebalancing suggestions and generated tasks.
  - name: Routing
    description: Route optimisation for single and multiple fleets.
  - name: Routing Sessions
    description: Saved routing sessions, their routes and drivers.
  - name: Routing Operations
    description: Complete, undo and re-route the stops of a route.
  - name: Fleet Management
    description: Your depots, stations, drivers and cargo vehicles.
  - name: Integrations
    description: Vehicles, statuses and commands on your fleet platform.
  - name: Station Based Analytics
    description: Analytics for station-based (docked) services.
  - name: Zone Based Analytics
    description: Analytics for free-floating services, by zone.
  - name: Free Float Analytics
    description: Trip history for free-floating services.
  - name: Transit Analytics
    description: Punctuality and service delivery for public transit.
  - name: Live
    description: Real-time fleet, delivery and transit status.
  - name: Grids
    description: Spatial grids used by forecasts and analytics.
  - name: API Keys
    description: Create and manage the API keys you call this API with.
paths:
  /integrations/tasks:
    get:
      tags:
        - Integrations
      summary: List Fleet Tasks
      description: >-
        Open tasks (work orders such as battery swaps, pickups or maintenance)
        that your fleet platform holds for vehicles in one location, with
        priority and validity window. Filtering, sorting and pagination
        (`filter`, `sort`, `limit`, `cursor`) apply to the whole list; follow
        `next_cursor` while `has_more` is true. The list is cached for up to 1
        minutes.


        Integrations talk to the fleet platform your company is linked to (for
        example Wunder, ATOM or an MDS feed) and return its data in one common
        format, whatever the platform. They need a fleet integration configured
        for your company; `GET /integrations/availability` shows which kinds of
        data and operations your platform supports.


        **Failure Modes:**

        - **401**: Token is missing or invalid

        - **403**: `access_denied` when your role or API key lacks the
        permission below

        - **404**: `no_data_binding` (`kind: fleet`) when no fleet integration
        is configured for your company; `no_data_binding` (`kind: location`)
        when `location` is not one of its locations

        - **422**: Invalid parameters, or your fleet platform does not support
        this (`Unknown provider: ...`)

        - **502**: The fleet platform returned an error (`Upstream provider
        error: ...`)


        **Required Auth Scopes:**

        - `integrations:tasks:read`
      operationId: list_tasks_integrations_tasks_get
      parameters:
        - name: location
          in: query
          required: true
          schema:
            type: string
            description: >-
              Location (city) to read, one your company's fleet integration
              covers, e.g. `milan`. `GET /auth/me` lists them under
              `access.data.fleets`.
            title: Location
          description: >-
            Location (city) to read, one your company's fleet integration
            covers, e.g. `milan`. `GET /auth/me` lists them under
            `access.data.fleets`.
        - name: min_lat
          in: query
          required: false
          schema:
            type:
              - number
              - 'null'
            description: >-
              Bounding box south edge (latitude). The box applies only when all
              four bounds are given.
            title: Min Lat
          description: >-
            Bounding box south edge (latitude). The box applies only when all
            four bounds are given.
        - name: max_lat
          in: query
          required: false
          schema:
            type:
              - number
              - 'null'
            description: Bounding box north edge (latitude).
            title: Max Lat
          description: Bounding box north edge (latitude).
        - name: min_lng
          in: query
          required: false
          schema:
            type:
              - number
              - 'null'
            description: Bounding box west edge (longitude).
            title: Min Lng
          description: Bounding box west edge (longitude).
        - name: max_lng
          in: query
          required: false
          schema:
            type:
              - number
              - 'null'
            description: Bounding box east edge (longitude).
            title: Max Lng
          description: Bounding box east edge (longitude).
        - name: config_source
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/ConfigSource'
            description: >-
              Legacy parameter, kept for compatibility and ignored: the
              integration is always the one configured for your company.
            default: mobile
          description: >-
            Legacy parameter, kept for compatibility and ignored: the
            integration is always the one configured for your company.
        - name: filter
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
            description: >-
              Filter on a field of the returned items, as `field:op:value` (or
              `field:value` for `eq`); repeat the parameter to combine filters
              (AND). Operators: `eq`, `neq`, `contains` (case-insensitive, text
              fields), `gt`, `gte`, `lt`, `lte` (numbers), `in` (comma-separated
              values). Nested fields use dots, e.g. `extra_params.zone`. A
              filter with an unknown operator is ignored. Example:
              `battery_level:lt:20`.
            default: []
            title: Filter
          description: >-
            Filter on a field of the returned items, as `field:op:value` (or
            `field:value` for `eq`); repeat the parameter to combine filters
            (AND). Operators: `eq`, `neq`, `contains` (case-insensitive, text
            fields), `gt`, `gte`, `lt`, `lte` (numbers), `in` (comma-separated
            values). Nested fields use dots, e.g. `extra_params.zone`. A filter
            with an unknown operator is ignored. Example: `battery_level:lt:20`.
        - name: sort
          in: query
          required: false
          schema:
            type: string
            description: >-
              Sort order as comma-separated `field:dir` pairs, `dir` being `asc`
              (default) or `desc`; items without the field come last. Example:
              `battery_level:asc,last_seen:desc`.
            default: ''
            title: Sort
          description: >-
            Sort order as comma-separated `field:dir` pairs, `dir` being `asc`
            (default) or `desc`; items without the field come last. Example:
            `battery_level:asc,last_seen:desc`.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 500
            minimum: 1
            description: Items per page (1-500).
            default: 50
            title: Limit
          description: Items per page (1-500).
        - name: cursor
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
            description: >-
              Opaque cursor from the previous page's `next_cursor`; omit it for
              the first page. Keep the same filters and sort between pages.
            title: Cursor
          description: >-
            Opaque cursor from the previous page's `next_cursor`; omit it for
            the first page. Keep the same filters and sort between pages.
      responses:
        '200':
          description: Tasks retrieved. One page of tasks and the pagination state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_IntegrationTask_'
              example:
                items:
                  - id: task-5531
                    vehicle_id: veh-1042
                    operation_type: battery_swap
                    priority: high
                    additional_notes: Battery at 18%, swap before the evening peak.
                    generated_at: '2026-11-30T08:15:00Z'
                    valid_from: '2026-11-30T08:15:00Z'
                    valid_until: '2026-11-30T16:00:00Z'
                    title: Battery swap AB123CD
                    labels:
                      - centro
                    extra_params: {}
                next_cursor: NTA=
                has_more: true
                total_count: 23
        '401':
          description: Unauthorized. Token is missing or invalid.
        '403':
          description: Forbidden. Insufficient permissions.
        '404':
          description: Not Found. No fleet integration configured for your company.
        '422':
          description: >-
            Unprocessable Entity. Invalid parameters, or not supported by your
            fleet platform.
        '502':
          description: Bad Gateway. The fleet platform returned an error.
      security:
        - HTTPBearer: []
        - HTTPBearer: []
components:
  schemas:
    ConfigSource:
      type: string
      enum:
        - mobile
        - ops
      title: ConfigSource
      description: Accepted for compatibility (``?config_source=``) and ignored.
    PaginatedResponse_IntegrationTask_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/IntegrationTask'
          type: array
          title: Items
        next_cursor:
          type:
            - string
            - 'null'
          title: Next Cursor
        has_more:
          type: boolean
          title: Has More
          default: false
        total_count:
          type: integer
          title: Total Count
          default: 0
      type: object
      required:
        - items
      title: PaginatedResponse[IntegrationTask]
    IntegrationTask:
      properties:
        id:
          type:
            - string
            - 'null'
          title: Id
          description: Upstream task ID if provided; None when upstream has no ID
        vehicle_id:
          type: string
          title: Vehicle Id
          description: Target vehicle identifier
        operation_type:
          type: string
          title: Operation Type
          description: 'Task type: pickup, battery_swap, maintenance, charging, etc.'
        priority:
          type: string
          enum:
            - low
            - medium
            - high
            - must
          title: Priority
          description: Task urgency level
        additional_notes:
          type:
            - string
            - 'null'
          title: Additional Notes
          description: Human-readable free-text notes about the task.
        generated_at:
          type: string
          format: date-time
          title: Generated At
          description: When the task was created upstream
        valid_from:
          type:
            - string
            - 'null'
          format: date-time
          title: Valid From
          description: Start of validity window
        valid_until:
          type:
            - string
            - 'null'
          format: date-time
          title: Valid Until
          description: End of validity window
        title:
          type: string
          title: Title
          description: Display title
        labels:
          items:
            type: string
          type: array
          title: Labels
          description: Freeform tags/labels
        extra_params:
          additionalProperties: true
          type: object
          title: Extra Params
          description: Provider-specific fields not covered by the schema
      type: object
      required:
        - vehicle_id
        - operation_type
        - priority
        - generated_at
        - title
      title: IntegrationTask
      description: Normalized upstream task / work order.
      examples:
        - additional_notes: Battery at 18%, swap before the evening peak.
          extra_params: {}
          generated_at: '2026-11-30T08:15:00Z'
          id: task-5531
          labels:
            - centro
          operation_type: battery_swap
          priority: high
          title: Battery swap AB123CD
          valid_from: '2026-11-30T08:15:00Z'
          valid_until: '2026-11-30T16:00:00Z'
          vehicle_id: veh-1042
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      description: >-
        An API key, sent as `Authorization: Bearer <key>`. Create one in the
        SWITCH Copilot under **Settings → API keys** (needs the API keys
        permission in your company), or with `POST /auth/api-keys`. The key is
        shown once, at creation.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.