---
title: Retrieve a depot
description: Retrieve a depot
url: /api/depots/getDepot
---

# Retrieve a depot

`GET /depots/{depotId}`

````yaml
openapi: 3.1.0
info:
  title: Spoke API
  version: v1
servers:
  - url: https://api.spoke.com/public/v1
security:
  - BasicAuth: []
paths:
  /depots/{depotId}:
    get:
      operationId: getDepot
      summary: Retrieve a depot
      tags:
        - Depots
      parameters:
        - schema:
            type: string
            pattern: ^[a-zA-Z0-9---_]{1,50}$
          in: path
          name: depotId
          required: true
          description: The depot id
      responses:
        "200":
          description: The requested depot
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/depotSchema"
                description: The requested depot
        "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
        "404":
          description: The provided depot id does not exist
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    enum:
                      - Depot not found
                required:
                  - message
                description: The provided depot id does not exist
                title: Depot not found
        "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:
    depotIdSchema:
      type: string
      pattern: ^depots\/[a-zA-Z0-9---_]{1,50}$
    depotSchema:
      type: object
      properties:
        id:
          allOf:
            - $ref: "#/components/schemas/depotIdSchema"
          description: The depot id, in the format `depots/<id>`
        name:
          type: string
          description: The name of the depot.
        routeOverrides:
          anyOf:
            - type: object
              properties:
                startTime:
                  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: Default route start time.
                startAddress:
                  type: object
                  properties:
                    address:
                      description: The full address.
                      type:
                        - string
                        - "null"
                    addressLineOne:
                      description: The first line of the address.
                      type:
                        - string
                        - "null"
                    addressLineTwo:
                      description: The second line of the address.
                      type:
                        - string
                        - "null"
                    latitude:
                      description: Latitude coordinate of the depot in decimal degrees.
                      type:
                        - number
                        - "null"
                    longitude:
                      description: Longitude coordinate of the depot in decimal degrees.
                      type:
                        - number
                        - "null"
                    placeId:
                      description: A Google PlaceID identifying the location of the depot.
                      type:
                        - string
                        - "null"
                    countryCode:
                      description: The country code of the address.
                      type:
                        - string
                        - "null"
                  required:
                    - address
                    - addressLineOne
                    - addressLineTwo
                    - latitude
                    - longitude
                    - placeId
                    - countryCode
                  description: The default start address for routes originating from this depot.
                defaultTimeAtStop:
                  description: Estimated time at stop in seconds.
                  type:
                    - number
                    - "null"
                endAddress:
                  anyOf:
                    - type: object
                      properties:
                        address:
                          description: The full address.
                          type:
                            - string
                            - "null"
                        addressLineOne:
                          description: The first line of the address.
                          type:
                            - string
                            - "null"
                        addressLineTwo:
                          description: The second line of the address.
                          type:
                            - string
                            - "null"
                        latitude:
                          description: Latitude coordinate of the depot in decimal degrees.
                          type:
                            - number
                            - "null"
                        longitude:
                          description: Longitude coordinate of the depot in decimal degrees.
                          type:
                            - number
                            - "null"
                        placeId:
                          description: A Google PlaceID identifying the location of the depot.
                          type:
                            - string
                            - "null"
                        countryCode:
                          description: The country code of the address.
                          type:
                            - string
                            - "null"
                      required:
                        - address
                        - addressLineOne
                        - addressLineTwo
                        - latitude
                        - longitude
                        - placeId
                        - countryCode
                      description: The default end address for routes originating from this depot (if empty, assume a round-trip).
                    - type: "null"
                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: Default route end time.
                    - type: "null"
                maxStops:
                  description: Max stops assigned to each driver
                  type:
                    - number
                    - "null"
                roadSide:
                  anyOf:
                    - type: string
                      enum:
                        - any
                        - left_only
                        - right_only
                    - type: "null"
                  description: The side of the road drivers should stop at.
                vehicleType:
                  anyOf:
                    - type: string
                      enum:
                        - bike
                        - scooter
                        - car
                        - small_truck
                        - truck
                        - electric_cargo_bike
                    - type: "null"
                  description: Default vehicle type for new routes from this depot.
                roundTrip:
                  description: Return to start address at end of route
                  type:
                    - boolean
                    - "null"
              required:
                - startTime
                - startAddress
            - type: "null"
      required:
        - id
        - name
        - routeOverrides
      additionalProperties: false
      description: A depot.
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: Use the API key as the username and leave the password empty.
````