> ## 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.

# Get Cargo Vehicle by ID

> Get one cargo vehicle by ID.

**Failure Modes:**
- **401**: Token is missing or invalid
- **403**: Insufficient permissions, or the cargo vehicle belongs to a company you cannot access
- **404**: No cargo vehicle with this ID

**Required Auth Scopes:**
- `cargo-vehicles:read`



## OpenAPI

````yaml /api-reference/openapi.json get /operations/cargo-vehicles/{vehicle_id}
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:
  /operations/cargo-vehicles/{vehicle_id}:
    get:
      tags:
        - Fleet Management
      summary: Get Cargo Vehicle by ID
      description: >-
        Get one cargo vehicle by ID.


        **Failure Modes:**

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

        - **403**: Insufficient permissions, or the cargo vehicle belongs to a
        company you cannot access

        - **404**: No cargo vehicle with this ID


        **Required Auth Scopes:**

        - `cargo-vehicles:read`
      operationId: get_cargo_vehicle_by_id
      parameters:
        - name: vehicle_id
          in: path
          required: true
          schema:
            type: integer
            description: ID of the cargo vehicle.
            title: Vehicle Id
          description: ID of the cargo vehicle.
      responses:
        '200':
          description: >-
            Cargo vehicle retrieved successfully. Returns the complete vehicle
            profile including capacity specs and company ownership.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CargoVehiclePublic'
        '401':
          description: >-
            Unauthorized. Token is missing, invalid, malformed, expired, or
            revoked.
        '403':
          description: >-
            Forbidden. The authenticated user does not have sufficient
            permissions to read cargo vehicles.
        '404':
          description: >-
            Not Found. No cargo vehicle exists with the specified ID in the
            system.
        '422':
          description: >-
            Unprocessable Entity. Request validation failed due to malformed
            data, missing required fields, or invalid field types.
        '500':
          description: Internal Server Error.
      security:
        - HTTPBearer: []
        - HTTPBearer: []
components:
  schemas:
    CargoVehiclePublic:
      properties:
        id:
          type: integer
          title: Id
          description: Unique ID.
          examples:
            - 1
        name:
          type: string
          title: Name
          description: Vehicle display name.
          examples:
            - Cargo Van 01
        icon:
          type: string
          title: Icon
          description: Name of the icon shown for the vehicle, e.g. `Truck`.
          examples:
            - Truck
        capacities:
          additionalProperties: true
          type: object
          title: Capacities
          description: >-
            How many items of each kind the vehicle carries, e.g. `batteries`,
            `scooters`, `bikes`, `vehicles`.
          examples:
            - batteries: 40
              scooters: 12
        company_slug:
          type: string
          title: Company Slug
          description: Owning company slug.
          examples:
            - acme-mobility
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Datetime when the record was created.
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          title: Updated At
          description: Datetime when the record was last updated, if ever.
      type: object
      required:
        - id
        - name
        - icon
        - capacities
        - company_slug
        - created_at
      title: CargoVehiclePublic
      description: |-
        Public schema for a cargo vehicle resource.

        Exposes cargo vehicle details to API consumers, including capacity
        specs and company ownership.
      examples:
        - capacities:
            batteries: 40
            scooters: 12
          company_slug: acme-mobility
          created_at: '2026-10-02T09:15:00Z'
          icon: Truck
          id: 3
          name: Cargo Van 01
          updated_at: '2026-11-12T16:40:00Z'
  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.