> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.datalbus.com.br/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.datalbus.com.br/_mcp/server.

# Listar veículos

GET https://datalbus.com.br:8000/api/v2/assets

Lista os veículos cadastrados na empresa, ativos e inativos.

**Resposta 200** (paginada). Cada item de `data`:

| Campo | Tipo | Nulo | Descrição |
| --- | --- | --- | --- |
| `id` | integer | não | Id interno do veículo no Datalbus |
| `asset_id` | integer | sim | Identificador do veículo no cadastro de origem |
| `asset_description` | string | sim | Prefixo do veículo |
| `manufacturer_descr` | string | sim | Fabricante |
| `license_plate` | string | sim | Placa |
| `active` | boolean | sim | Veículo ativo |
| `created_at` | string (ISO-8601 UTC) | sim | Data de criação do registro |
| `updated_at` | string (ISO-8601 UTC) | sim | Data da última atualização |

**Erros:** `422` para parâmetros inválidos.
**Paginação:** resposta no envelope paginado padrão (veja a Introdução). Navegue incrementando `page` até `current_page` = `last_page`.

Reference: https://docs.datalbus.com.br/datalbus-api-v-2/veiculos/listar-veículos

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `per_page` (integer, optional) — Itens por página (1 a 1000, padrão 10). Aceita `all` para retornar até 1000 itens.
- `page` (integer, optional) — Número da página (padrão 1).

## Response

### 200

OK

- `to` (integer, required)
- `data` (list of ListarVeiculosVeiculosResponseDataItem, required)
- `from` (integer, required)
- `path` (string, required)
- `links` (list of ListarVeiculosVeiculosResponseLinksItem, required)
- `total` (integer, required)
- `per_page` (integer, required)
- `last_page` (integer, required)
- `current_page` (integer, required)
- `last_page_url` (string, required)
- `first_page_url` (string, required)
- `next_page_url` (any, optional, nullable)
- `prev_page_url` (any, optional, nullable)

## Errors

### 401 Listar Veiculos Veiculos Request Unauthorized Error

Unauthorized

- `message` (string, required)

### 422 Listar Veiculos Veiculos Request Unprocessable Entity Error

Unprocessable Content

- `errors` (UnprocessableEntityErrorBodyErrors, required)
- `message` (string, required)

## Types

### ListarVeiculosVeiculosResponseDataItem

- `id` (integer, required)
- `active` (boolean, required)
- `asset_id` (integer, required)
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `license_plate` (string, required)
- `asset_description` (string, required)
- `manufacturer_descr` (string, required)

### ListarVeiculosVeiculosResponseLinksItem

- `label` (string, required)
- `active` (boolean, required)
- `url` (any, optional, nullable)

### UnprocessableEntityErrorBodyErrors

- `date` (list of string, required)
- `groupBy` (list of string, required)

## Examples

**Response**

```json
{
  "to": 2,
  "data": [
    {
      "id": 15,
      "active": true,
      "asset_id": 358012,
      "created_at": "2023-03-10T14:22:05Z",
      "updated_at": "2026-09-01T08:00:00Z",
      "license_plate": "ABC1D23",
      "asset_description": "1020",
      "manufacturer_descr": "Mercedes-Benz"
    },
    {
      "id": 16,
      "active": true,
      "asset_id": 358013,
      "created_at": "2023-03-10T14:22:05Z",
      "updated_at": "2026-09-01T08:00:00Z",
      "license_plate": "license_plate",
      "asset_description": "1021",
      "manufacturer_descr": "Volvo"
    }
  ],
  "from": 1,
  "path": "https://datalbus.com.br:8000/api/v2/assets",
  "links": [
    {
      "label": "« Previous",
      "active": false
    },
    {
      "label": "1",
      "active": true,
      "url": "https://datalbus.com.br:8000/api/v2/assets?page=1"
    },
    {
      "label": "Next »",
      "active": false
    }
  ],
  "total": 2,
  "per_page": 50,
  "last_page": 1,
  "current_page": 1,
  "last_page_url": "https://datalbus.com.br:8000/api/v2/assets?page=1",
  "first_page_url": "https://datalbus.com.br:8000/api/v2/assets?page=1"
}
```

**SDK Code**

```python 200 - Lista de veículos
import requests

url = "https://datalbus.com.br:8000/api/v2/assets"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript 200 - Lista de veículos
const url = 'https://datalbus.com.br:8000/api/v2/assets';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 200 - Lista de veículos
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://datalbus.com.br:8000/api/v2/assets"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 200 - Lista de veículos
require 'uri'
require 'net/http'

url = URI("https://datalbus.com.br:8000/api/v2/assets")

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

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

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

```java 200 - Lista de veículos
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://datalbus.com.br:8000/api/v2/assets")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php 200 - Lista de veículos
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://datalbus.com.br:8000/api/v2/assets', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp 200 - Lista de veículos
using RestSharp;

var client = new RestClient("https://datalbus.com.br:8000/api/v2/assets");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift 200 - Lista de veículos
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://datalbus.com.br:8000/api/v2/assets")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```