---
agentTools:
  projectIndex: https://developer-docs.gomotive.com/llms.txt
---

# List all the vehicles of a group

**Purpose**: Use this API to find all the associated vehicles of a particular group. You must specify the ID of the group for which you want to view the associated vehicles.

```ruby Ruby. (OAuth 2.0)
require 'uri'
require 'net/http'

url = URI('https://api.gomotive.com/v1/groups/<id>/vehicles')

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request['Authorization'] = "Bearer <OAUTH_TOKEN>"

response = http.request(request)
puts response.read_body
```

## Response Parameters

### Vehicle

* **Type**: Object
* **Description**: Details of a specific vehicle.

### id

* **Type**: Integer
* **Description**: The unique identifier for the vehicle.

### number

* **Type**: String
* **Description**: The vehicle number.

### status

* **Type**: String
* **Description**: The status of the vehicle.

### make

* **Type**: String
* **Description**: The make of the vehicle.

### model

* **Type**: String
* **Description**: The model of the vehicle.

***

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Motive",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.gomotive.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v1/groups/{id}/vehicles": {
      "get": {
        "summary": "List all the vehicles of a group",
        "description": "",
        "operationId": "fetch-a-list-of-all-the-vehicles-in-a-group",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Specify the ID of the group for which you want to view the associated vehicles.",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          },
          {
            "name": "updated_after",
            "in": "query",
            "description": "Specify a date after which you want to view the associated vehicles.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "X-Time-Zone",
            "in": "header",
            "description": "Specify the timezone for formatting the timestamps.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Metric-Units",
            "in": "header",
            "description": "Specify if you want to use the Metric units or the Imperial units. TRUE: Metric units. FALSE: Imperial Units",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "X-User-Id",
            "in": "header",
            "description": "Specify the ID of the Fleet Admin or the Fleet Manager who is accessing this endpoint.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "View all the associated vehicles": {
                    "value": "  {\n  \"vehicles\": [\n    {\n      \"vehicle\": {\n        \"id\": 4565,\n        \"number\": \"301\",\n        \"status\": \"active\",\n        \"make\": \"Demo\",\n        \"model\": \"Vehicle\"\n      }\n    },\n    {\n      \"vehicle\": {\n        \"id\": 11004,\n        \"number\": \"303\",\n        \"status\": \"active\",\n        \"make\": \"Demo\",\n        \"model\": \"Vehicle\"\n      }\n    }\n  ],\n  \"pagination\": {\n    \"per_page\": 25,\n    \"page_no\": 1,\n    \"total\": 2\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "vehicles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "vehicle": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer",
                                "example": 4565,
                                "default": 0
                              },
                              "number": {
                                "type": "string",
                                "example": "301"
                              },
                              "status": {
                                "type": "string",
                                "example": "active"
                              },
                              "make": {
                                "type": "string",
                                "example": "Demo"
                              },
                              "model": {
                                "type": "string",
                                "example": "Vehicle"
                              }
                            }
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "per_page": {
                          "type": "integer",
                          "example": 25,
                          "default": 0
                        },
                        "page_no": {
                          "type": "integer",
                          "example": 1,
                          "default": 0
                        },
                        "total": {
                          "type": "integer",
                          "example": 2,
                          "default": 0
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "examples": {
                  "Group not found": {
                    "value": "{\n  \"error_message\": \"group not found\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error_message": {
                      "type": "string",
                      "example": "group not found"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "66acf64a829e88001980fbf2:66d74e8ed4ef550019b3a475"
}
```