---
title: List plans
description: List plans
url: /api/plans/listPlans
---

# List plans

`GET /plans`

````yaml
openapi: 3.1.0
info:
  title: Spoke API
  version: v1
servers:
  - url: https://api.spoke.com/public/v1
security:
  - BasicAuth: []
paths:
  /plans:
    get:
      operationId: listPlans
      summary: List plans
      tags:
        - Plans
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 255
          in: query
          name: pageToken
          required: false
          description: The page token, if any.
        - schema:
            default: 10
            type: number
            minimum: 1
            maximum: 20
          in: query
          name: maxPageSize
          required: false
          description: The max page size.
        - schema:
            type: object
            properties:
              title:
                description: Filter by title, exact match
                type: string
                minLength: 1
                maxLength: 255
              startsGte:
                description: Search for plans that start after this date, inclusive. The date must be in the format YYYY-MM-DD.
                type: string
                pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}$
              startsLte:
                description: Search for plans that start before this date,inclusive. The date must be in the format YYYY-MM-DD.
                type: string
                pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}$
            additionalProperties: false
          in: query
          name: filter
          required: false
          description: "The filter to apply to the list of plans. The filter params are passed like this: `?filter[title]=foo` or like this: `?filter.title=foo`"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  plans:
                    type: array
                    items:
                      $ref: "#/components/schemas/planSchema"
                    description: The plans list.
                  nextPageToken:
                    description: The next page token.
                    type:
                      - "null"
                      - string
                required:
                  - plans
                  - nextPageToken
                definitions:
                  planSchema:
                    type: object
                    properties:
                      id:
                        type: string
                        pattern: ^plans\/[a-zA-Z0-9---_]{1,50}$
                        description: The unique identifier of the plan.
                      title:
                        type: string
                        description: The title of the plan.
                      starts:
                        type: object
                        properties:
                          day:
                            type: integer
                            minimum: 1
                            maximum: 31
                            description: The day of the date.
                          month:
                            type: integer
                            minimum: 1
                            maximum: 12
                            description: The month of the date.
                          year:
                            type: integer
                            minimum: 2000
                            maximum: 2100
                            description: The year of the date.
                        required:
                          - day
                          - month
                          - year
                        additionalProperties: false
                        description: A date.
                      depot:
                        anyOf:
                          - type: string
                            pattern: ^depots\/[a-zA-Z0-9---_]{1,50}$
                          - type: "null"
                        description: The depot ID of the plan, in the format depots/<id>
                      distributed:
                        type: boolean
                        description: Whether the plan has been distributed.
                      writable:
                        type: boolean
                        description: Whether the plan is writable using the normal Plan APIs. If this is false, you will need to use the [Live Plan APIs](/api/live-plans) to edit the plan. Any plan created before 2023-04-01 is not writable.
                      optimization:
                        anyOf:
                          - type: string
                            enum:
                              - creating
                              - editing
                              - preview
                              - optimized
                              - optimizing
                          - type: "null"
                        description: The optimization state of the plan.
                      drivers:
                        type: array
                        items:
                          type: string
                          pattern: ^drivers\/[a-zA-Z0-9---_]{1,50}$
                        description: The driver IDs of the plan, in the format drivers/<id>.
                      routes:
                        type: array
                        items:
                          type: string
                          pattern: ^routes\/[a-zA-Z0-9---_]{1,50}$
                        description: The route IDs of the plan, in the format routes/<id>.
                      routeOverrides:
                        anyOf:
                          - type: object
                            properties:
                              startTime:
                                anyOf:
                                  - type: object
                                    properties:
                                      hour:
                                        type: integer
                                        minimum: 0
                                        maximum: 23
                                        description: Hour of the day
                                      minute:
                                        type: integer
                                        minimum: 0
                                        maximum: 59
                                        description: Minute of the hour
                                    required:
                                      - hour
                                      - minute
                                    additionalProperties: false
                                    description: Time of day in hours and minutes. Uses a 24 hour clock.
                                  - type: "null"
                                description: Plan's start time.
                              endTime:
                                anyOf:
                                  - type: object
                                    properties:
                                      hour:
                                        type: integer
                                        minimum: 0
                                        maximum: 23
                                        description: Hour of the day
                                      minute:
                                        type: integer
                                        minimum: 0
                                        maximum: 59
                                        description: Minute of the hour
                                    required:
                                      - hour
                                      - minute
                                    additionalProperties: false
                                    description: Time of day in hours and minutes. Uses a 24 hour clock.
                                  - type: "null"
                                description: Plan's end time.
                              startAddress:
                                anyOf:
                                  - type: object
                                    properties:
                                      address:
                                        type: string
                                        description: The address of the stop.
                                      addressLineOne:
                                        type: string
                                        description: The first line of the address.
                                      addressLineTwo:
                                        type: string
                                        description: The second line of the address.
                                      latitude:
                                        anyOf:
                                          - type: number
                                            minimum: -90
                                            maximum: 90
                                          - type: "null"
                                        description: The latitude of the address in decimal degrees.
                                      longitude:
                                        anyOf:
                                          - type: number
                                            minimum: -180
                                            maximum: 180
                                          - type: "null"
                                        description: The longitude of the address in decimal degrees.
                                      placeId:
                                        description: The identifier of the place corresponding to this stop on Google Places
                                        type:
                                          - string
                                          - "null"
                                      placeTypes:
                                        type: array
                                        items:
                                          type: string
                                        description: Array of strings that is provided by the Google AutoCompleteAPI
                                    required:
                                      - address
                                      - addressLineOne
                                      - addressLineTwo
                                      - latitude
                                      - longitude
                                      - placeId
                                      - placeTypes
                                    additionalProperties: false
                                    description: The address of the stop.
                                  - type: "null"
                                description: Plan's start location.
                              endAddress:
                                anyOf:
                                  - type: object
                                    properties:
                                      address:
                                        type: string
                                        description: The address of the stop.
                                      addressLineOne:
                                        type: string
                                        description: The first line of the address.
                                      addressLineTwo:
                                        type: string
                                        description: The second line of the address.
                                      latitude:
                                        anyOf:
                                          - type: number
                                            minimum: -90
                                            maximum: 90
                                          - type: "null"
                                        description: The latitude of the address in decimal degrees.
                                      longitude:
                                        anyOf:
                                          - type: number
                                            minimum: -180
                                            maximum: 180
                                          - type: "null"
                                        description: The longitude of the address in decimal degrees.
                                      placeId:
                                        description: The identifier of the place corresponding to this stop on Google Places
                                        type:
                                          - string
                                          - "null"
                                      placeTypes:
                                        type: array
                                        items:
                                          type: string
                                        description: Array of strings that is provided by the Google AutoCompleteAPI
                                    required:
                                      - address
                                      - addressLineOne
                                      - addressLineTwo
                                      - latitude
                                      - longitude
                                      - placeId
                                      - placeTypes
                                    additionalProperties: false
                                    description: The address of the stop.
                                  - type: "null"
                                description: Plan's end location.
                              maxStops:
                                anyOf:
                                  - type: integer
                                    minimum: -9007199254740991
                                    maximum: 9007199254740991
                                  - type: "null"
                                description: Maximum number of Stops per route.
                              drivingSpeed:
                                anyOf:
                                  - type: string
                                    enum:
                                      - slower
                                      - average
                                      - faster
                                  - type: "null"
                                description: The relative driving speed compared to others.
                              deliverySpeed:
                                anyOf:
                                  - type: string
                                    enum:
                                      - slower
                                      - average
                                      - faster
                                  - type: "null"
                                description: The relative delivery speed compared to others.
                              vehicleType:
                                anyOf:
                                  - type: string
                                    enum:
                                      - bike
                                      - scooter
                                      - car
                                      - small_truck
                                      - truck
                                      - electric_cargo_bike
                                  - type: "null"
                                description: The vehicle type used for deliveries.
                              optimizationSettings:
                                type: object
                                properties:
                                  objective:
                                    type: string
                                    enum:
                                      - minimize_drivers
                                      - distribute_services
                                    description: The primary optimization objective.
                                  subObjective:
                                    anyOf:
                                      - type: string
                                        enum:
                                          - equalize_workload
                                          - equalize_time
                                          - maximize_efficiency
                                        description: The secondary optimization objective.
                                      - type: "null"
                                required:
                                  - objective
                                additionalProperties: false
                                description: Optimization settings for the plan.
                            required:
                              - startTime
                              - endTime
                              - startAddress
                              - endAddress
                              - maxStops
                              - drivingSpeed
                              - deliverySpeed
                              - vehicleType
                              - optimizationSettings
                            additionalProperties: false
                            description: Settings for this plan to override default route configurations.
                          - type: "null"
                        description: Settings for this plan to override default route configurations.
                    required:
                      - id
                      - title
                      - starts
                      - depot
                      - distributed
                      - writable
                      - optimization
                      - drivers
                      - routes
                      - routeOverrides
                    additionalProperties: false
                    description: A plan.
                description: Success
        "400":
          description: Query parameters are invalid
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The error message.
                  code:
                    type: string
                    description: The error code.
                  param:
                    type: string
                    description: The parameter that caused the error.
                  url:
                    type: string
                    description: The URL with more information about the error.
                required:
                  - message
                description: Query parameters are invalid
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The error message.
                  url:
                    type: string
                    description: The URL with more information about the error.
                required:
                  - message
                description: Unauthorized
        "500":
          description: An internal server error occurred
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The error message.
                  code:
                    type: string
                    description: The error code.
                  param:
                    type: string
                    description: The parameter that caused the error.
                  url:
                    type: string
                    description: The URL with more information about the error.
                required:
                  - message
                description: An internal server error occurred
        default:
          description: The default error model
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The error message.
                  code:
                    type: string
                    description: The error code.
                  param:
                    type: string
                    description: The parameter that caused the error.
                  url:
                    type: string
                    description: The URL with more information about the error.
                required:
                  - message
                description: The default error model
components:
  schemas:
    dateSchema:
      type: object
      properties:
        day:
          type: integer
          minimum: 1
          maximum: 31
          description: The day of the date.
        month:
          type: integer
          minimum: 1
          maximum: 12
          description: The month of the date.
        year:
          type: integer
          minimum: 2000
          maximum: 2100
          description: The year of the date.
      required:
        - day
        - month
        - year
      additionalProperties: false
      description: A date.
    depotIdSchema:
      type: string
      pattern: ^depots\/[a-zA-Z0-9---_]{1,50}$
    driverIdSchema:
      type: string
      pattern: ^drivers\/[a-zA-Z0-9---_]{1,50}$
    planIdSchema:
      type: string
      pattern: ^plans\/[a-zA-Z0-9---_]{1,50}$
    planSchema:
      type: object
      properties:
        id:
          allOf:
            - $ref: "#/components/schemas/planIdSchema"
          description: The unique identifier of the plan.
        title:
          type: string
          description: The title of the plan.
        starts:
          $ref: "#/components/schemas/dateSchema"
        depot:
          anyOf:
            - $ref: "#/components/schemas/depotIdSchema"
            - type: "null"
          description: The depot ID of the plan, in the format depots/<id>
        distributed:
          type: boolean
          description: Whether the plan has been distributed.
        writable:
          type: boolean
          description: Whether the plan is writable using the normal Plan APIs. If this is false, you will need to use the [Live Plan APIs](/api/live-plans) to edit the plan. Any plan created before 2023-04-01 is not writable.
        optimization:
          anyOf:
            - type: string
              enum:
                - creating
                - editing
                - preview
                - optimized
                - optimizing
            - type: "null"
          description: The optimization state of the plan.
        drivers:
          type: array
          items:
            $ref: "#/components/schemas/driverIdSchema"
          description: The driver IDs of the plan, in the format drivers/<id>.
        routes:
          type: array
          items:
            $ref: "#/components/schemas/routeIdSchema"
          description: The route IDs of the plan, in the format routes/<id>.
        routeOverrides:
          anyOf:
            - type: object
              properties:
                startTime:
                  anyOf:
                    - type: object
                      properties:
                        hour:
                          type: integer
                          minimum: 0
                          maximum: 23
                          description: Hour of the day
                        minute:
                          type: integer
                          minimum: 0
                          maximum: 59
                          description: Minute of the hour
                      required:
                        - hour
                        - minute
                      additionalProperties: false
                      description: Time of day in hours and minutes. Uses a 24 hour clock.
                    - type: "null"
                  description: Plan's start time.
                endTime:
                  anyOf:
                    - type: object
                      properties:
                        hour:
                          type: integer
                          minimum: 0
                          maximum: 23
                          description: Hour of the day
                        minute:
                          type: integer
                          minimum: 0
                          maximum: 59
                          description: Minute of the hour
                      required:
                        - hour
                        - minute
                      additionalProperties: false
                      description: Time of day in hours and minutes. Uses a 24 hour clock.
                    - type: "null"
                  description: Plan's end time.
                startAddress:
                  anyOf:
                    - type: object
                      properties:
                        address:
                          type: string
                          description: The address of the stop.
                        addressLineOne:
                          type: string
                          description: The first line of the address.
                        addressLineTwo:
                          type: string
                          description: The second line of the address.
                        latitude:
                          anyOf:
                            - type: number
                              minimum: -90
                              maximum: 90
                            - type: "null"
                          description: The latitude of the address in decimal degrees.
                        longitude:
                          anyOf:
                            - type: number
                              minimum: -180
                              maximum: 180
                            - type: "null"
                          description: The longitude of the address in decimal degrees.
                        placeId:
                          description: The identifier of the place corresponding to this stop on Google Places
                          type:
                            - string
                            - "null"
                        placeTypes:
                          type: array
                          items:
                            type: string
                          description: Array of strings that is provided by the Google AutoCompleteAPI
                      required:
                        - address
                        - addressLineOne
                        - addressLineTwo
                        - latitude
                        - longitude
                        - placeId
                        - placeTypes
                      additionalProperties: false
                      description: The address of the stop.
                    - type: "null"
                  description: Plan's start location.
                endAddress:
                  anyOf:
                    - type: object
                      properties:
                        address:
                          type: string
                          description: The address of the stop.
                        addressLineOne:
                          type: string
                          description: The first line of the address.
                        addressLineTwo:
                          type: string
                          description: The second line of the address.
                        latitude:
                          anyOf:
                            - type: number
                              minimum: -90
                              maximum: 90
                            - type: "null"
                          description: The latitude of the address in decimal degrees.
                        longitude:
                          anyOf:
                            - type: number
                              minimum: -180
                              maximum: 180
                            - type: "null"
                          description: The longitude of the address in decimal degrees.
                        placeId:
                          description: The identifier of the place corresponding to this stop on Google Places
                          type:
                            - string
                            - "null"
                        placeTypes:
                          type: array
                          items:
                            type: string
                          description: Array of strings that is provided by the Google AutoCompleteAPI
                      required:
                        - address
                        - addressLineOne
                        - addressLineTwo
                        - latitude
                        - longitude
                        - placeId
                        - placeTypes
                      additionalProperties: false
                      description: The address of the stop.
                    - type: "null"
                  description: Plan's end location.
                maxStops:
                  anyOf:
                    - type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    - type: "null"
                  description: Maximum number of Stops per route.
                drivingSpeed:
                  anyOf:
                    - type: string
                      enum:
                        - slower
                        - average
                        - faster
                    - type: "null"
                  description: The relative driving speed compared to others.
                deliverySpeed:
                  anyOf:
                    - type: string
                      enum:
                        - slower
                        - average
                        - faster
                    - type: "null"
                  description: The relative delivery speed compared to others.
                vehicleType:
                  anyOf:
                    - type: string
                      enum:
                        - bike
                        - scooter
                        - car
                        - small_truck
                        - truck
                        - electric_cargo_bike
                    - type: "null"
                  description: The vehicle type used for deliveries.
                optimizationSettings:
                  type: object
                  properties:
                    objective:
                      type: string
                      enum:
                        - minimize_drivers
                        - distribute_services
                      description: The primary optimization objective.
                    subObjective:
                      anyOf:
                        - type: string
                          enum:
                            - equalize_workload
                            - equalize_time
                            - maximize_efficiency
                          description: The secondary optimization objective.
                        - type: "null"
                  required:
                    - objective
                  additionalProperties: false
                  description: Optimization settings for the plan.
              required:
                - startTime
                - endTime
                - startAddress
                - endAddress
                - maxStops
                - drivingSpeed
                - deliverySpeed
                - vehicleType
                - optimizationSettings
              additionalProperties: false
              description: Settings for this plan to override default route configurations.
            - type: "null"
          description: Settings for this plan to override default route configurations.
      required:
        - id
        - title
        - starts
        - depot
        - distributed
        - writable
        - optimization
        - drivers
        - routes
        - routeOverrides
      additionalProperties: false
      description: A plan.
    routeIdSchema:
      type: string
      pattern: ^routes\/[a-zA-Z0-9---_]{1,50}$
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: Use the API key as the username and leave the password empty.
````