---
title: Retrieve a route
description: Retrieve a route
url: /api/v0.2b/routes/getRoute
---

# Retrieve a route

`GET /routes/{routeId}`

````yaml
openapi: 3.1.0
info:
  title: Spoke API
  version: v0.2b
servers:
  - url: https://api.spoke.com/public/v0.2b
security:
  - BasicAuth: []
paths:
  /routes/{routeId}:
    get:
      operationId: getRoute
      summary: Retrieve a route
      tags:
        - Routes
      parameters:
        - schema:
            type: string
            pattern: ^[a-zA-Z0-9---_]{1,50}$
          in: path
          name: routeId
          required: true
          description: The route id
      responses:
        "200":
          description: The requested route
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/routeSchema"
                description: The requested route
        "400":
          description: ID format is 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: ID format is invalid
                title: The request is 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
        "403":
          description: Route is no longer accessible due to data access restrictions.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    enum:
                      - Route is no longer accessible due to data access restrictions.
                  code:
                    type: string
                    enum:
                      - route_inaccessible
                required:
                  - message
                  - code
                description: Route is no longer accessible due to data access restrictions.
        "404":
          description: The provided route id does not exist
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    enum:
                      - Route not found
                required:
                  - message
                description: The provided route id does not exist
        "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:
    driverIdSchema:
      type: string
      pattern: ^drivers\/[a-zA-Z0-9---_]{1,50}$
    planIdSchema:
      type: string
      pattern: ^plans\/[a-zA-Z0-9---_]{1,50}$
    routeIdSchema:
      type: string
      pattern: ^routes\/[a-zA-Z0-9---_]{1,50}$
    routeSchema:
      type: object
      properties:
        id:
          allOf:
            - $ref: "#/components/schemas/routeIdSchema"
          description: The id of the route, in the format `routes/<id>`.
        title:
          type: string
          description: The title of the route.
        stopCount:
          type: number
          description: The number of stops in the route.
        driver:
          anyOf:
            - $ref: "#/components/schemas/driverIdSchema"
            - type: "null"
          description: The id of the driver.
        state:
          anyOf:
            - type: object
              properties:
                completed:
                  type: boolean
                  description: Whether the route is completed.
                completedAt:
                  description: The timestamp the route was completed at.
                  type:
                    - number
                    - "null"
                distributed:
                  type: boolean
                  description: Whether the route is distributed.
                distributedAt:
                  description: The timestamp the route was distributed at.
                  type:
                    - number
                    - "null"
                notifiedRecipients:
                  type: boolean
                  description: Whether the recipients were notified.
                notifiedRecipientsAt:
                  description: The timestamp the recipients were notified at.
                  type:
                    - number
                    - "null"
                started:
                  type: boolean
                  description: Whether the route is started.
                startedAt:
                  description: The timestamp the route was started at.
                  type:
                    - number
                    - "null"
              required:
                - completed
                - completedAt
                - distributed
                - distributedAt
                - notifiedRecipients
                - notifiedRecipientsAt
                - started
                - startedAt
              additionalProperties: false
              description: The state of a route.
            - type: "null"
          description: The state of the route.
        plan:
          anyOf:
            - $ref: "#/components/schemas/planIdSchema"
            - type: "null"
          description: The id of the related plan.
      required:
        - id
        - title
        - stopCount
        - driver
        - state
        - plan
      additionalProperties: false
      description: A route.
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: Use the API key as the username and leave the password empty.
````