---
agentTools:
  projectIndex: https://ownli.readme.io/llms.txt
---

# Retrieve a vehicle (by id)

Retrieve a vehicle by passing in the Id. If the caller does not have access to the vehicle throws an exception.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "OpenAPI definition",
    "version": "v0"
  },
  "servers": [
    {
      "url": "https://api.sandbox.ownli.app",
      "description": "Generated server url"
    }
  ],
  "paths": {
    "/api/vehicles/by-id/{id}": {
      "get": {
        "tags": [
          "Vehicle"
        ],
        "summary": "Retrieve a vehicle (by id)",
        "description": "Retrieve a vehicle by passing in the Id. If the caller does not have access to the vehicle throws an exception.",
        "operationId": "getVehicleById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "partnerId",
            "in": "header",
            "description": "Partner Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientId",
            "in": "header",
            "description": "Client Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientSecret",
            "in": "header",
            "description": "Client Secret",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The vehicle object requested.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleDto"
                }
              }
            }
          },
          "401": {
            "description": "Authorization error e.g. due to an invalid or missing API keys."
          },
          "403": {
            "description": "Forbidden. \nPossible error codes \n1. **ERROR_NO_PERMISSIONS_TO_RESOURCE**",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Vehicle not found or owning User not found. \nPossible error codes \n1. **ERROR_USER_NOT_FOUND** \n2. **ERROR_VEHICLE_NOT_FOUND**",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal error. \nPossible error codes \n1. **INTERNAL_SERVER_ERROR**",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "VehicleDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Id of the vehicle"
          },
          "license": {
            "type": "string",
            "description": "License plate number"
          },
          "photoUrl": {
            "type": "string",
            "description": "Photo of Vehicle"
          },
          "make": {
            "type": "string",
            "description": "Make of the vehicle"
          },
          "model": {
            "type": "string",
            "description": "Model of the vehicle"
          },
          "vin": {
            "type": "string",
            "description": "VIN of the vehicle."
          },
          "state": {
            "type": "string",
            "description": "2 Letter State Code (eg. AL, CA, CO etc.)"
          },
          "year": {
            "type": "string",
            "description": "Year vehicle was built."
          },
          "dateAdded": {
            "type": "string",
            "description": "Time at which vehicle was added to the system"
          },
          "updated": {
            "type": "string",
            "description": "Last updated timestamp"
          },
          "userId": {
            "type": "string",
            "description": "User id of the owner"
          },
          "customerPhoneNumber": {
            "type": "string",
            "description": "Phone number of the owner"
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "ErrorResponseDto": {
        "type": "object",
        "properties": {
          "error_code": {
            "type": "string",
            "description": "Error code"
          },
          "error_message": {
            "type": "string",
            "description": "A verbose error message"
          }
        },
        "description": "Error response."
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 105,
      "1": 149,
      "2": 36,
      "3": 236,
      "4": 14,
      "5": 67,
      "6": 148,
      "7": 138,
      "8": 212,
      "9": 48,
      "10": 246,
      "11": 30
    }
  }
}
```