Veículos

A API de Veículos permite listar e obter detalhes dos veículos vinculados aos usuários de sua organização.

Propriedades

  • Name
    id
    Type
    number
    Description

    ID único do veículo.

  • Name
    license_plate
    Type
    string
    Description

    Placa do veículo.

  • Name
    renavam
    Type
    string
    Description

    Código RENAVAM do veículo.

  • Name
    chassis
    Type
    string
    Description

    Número do chassi.

  • Name
    manufacturer
    Type
    string
    Description

    Fabricante do veículo.

  • Name
    model
    Type
    string
    Description

    Modelo do veículo.

  • Name
    color
    Type
    string
    Description

    Cor do veículo.

  • Name
    manufacture_year
    Type
    number
    Description

    Ano de fabricação.

  • Name
    model_year
    Type
    number
    Description

    Ano do modelo.

  • Name
    state
    Type
    string
    Description

    Estado do veículo (UF).

  • Name
    city
    Type
    string
    Description

    Cidade do veículo.

  • Name
    category
    Type
    string
    Description

    Categoria do veículo.

  • Name
    species
    Type
    string
    Description

    Espécie do veículo.

  • Name
    fuel
    Type
    string
    Description

    Tipo de combustível.

  • Name
    motor_power
    Type
    string
    Description

    Potência do motor.

  • Name
    engine_displacement
    Type
    string
    Description

    Cilindrada do motor.

  • Name
    seating_capacity
    Type
    number
    Description

    Capacidade de passageiros.

  • Name
    gross_weight
    Type
    number
    Description

    Peso bruto total (kg).

  • Name
    maximum_towing_capacity
    Type
    number
    Description

    Capacidade máxima de tração (kg).

  • Name
    crv_issued_at
    Type
    string
    Description

    Data de emissão do CRV no formato "YYYY-MM-DD".

  • Name
    crlv_issued_at
    Type
    string
    Description

    Data de emissão do CRLV no formato "YYYY-MM-DD".

  • Name
    restriction_1
    Type
    string
    Description

    Restrição 1.

  • Name
    restriction_2
    Type
    string
    Description

    Restrição 2.

  • Name
    restriction_3
    Type
    string
    Description

    Restrição 3.

  • Name
    restriction_4
    Type
    string
    Description

    Restrição 4.

  • Name
    status
    Type
    string
    Description

    Status atual do veículo. Valores possíveis:

    ValorDescrição
    activeVeículo regularmente registrado e licenciado no órgão executivo de trânsito, apto a circular nas vias públicas (CTB, art. 130).
    decommissionedVeículo com baixa do registro junto ao Detran por se tornar irrecuperável, ter sido desmontado, sofrido sinistro com perda total ou ser vendido para sucata, ficando proibida sua circulação (CTB, art. 126).
    transferredVeículo cuja propriedade foi transferida a outro proprietário, com expedição de novo Certificado de Registro de Veículo (CRV) em nome do adquirente (CTB, art. 123, I).
    unknownSituação do veículo não classificada ou indisponível no momento da consulta.
  • Name
    traffic_violations
    Type
    object
    Description

    Resumo das infrações de trânsito do veículo.

    • Name
      notices
      Type
      number
      Description

      Quantidade de notificações de infração.

    • Name
      penalties
      Type
      number
      Description

      Quantidade de multas.

  • Name
    user
    Type
    object
    Description

    Usuário associado ao veículo.

    • Name
      id
      Type
      number
      Description

      ID do usuário.

    • Name
      external_uid
      Type
      string
      Description

      Identificador externo do usuário.

  • Name
    company
    Type
    object
    Description

    Empresa associada ao veículo.

    • Name
      id
      Type
      number
      Description

      ID da empresa.

    • Name
      name
      Type
      string
      Description

      Nome da empresa.


GET/v1/vehicles/

Listar Veículos

Retorna uma lista paginada de todos os veículos.

Parâmetros de Paginação

  • Name
    pagination[page]
    Type
    integer
    Description

    Número da página (começando em 1). Use junto com pagination[size].

  • Name
    pagination[size]
    Type
    integer
    Description

    Tamanho da página (número de itens por página, máximo 100). Use junto com pagination[page].

Parâmetros de Filtro

  • Name
    filters[license_plate]
    Type
    object
    Description

    Filtra por placa do veículo.

    • Name
      $eq
      Type
      string
      Description

      Igual ao valor especificado.

    • Name
      $ne
      Type
      string
      Description

      Diferente do valor especificado.

    • Name
      $contains
      Type
      string
      Description

      Contém o valor especificado.

    • Name
      $startsWith
      Type
      string
      Description

      Começa com o valor especificado.

    • Name
      $endsWith
      Type
      string
      Description

      Termina com o valor especificado.

  • Name
    filters[renavam]
    Type
    object
    Description

    Filtra por código RENAVAM.

    • Name
      $eq
      Type
      string
      Description

      Igual ao valor especificado.

    • Name
      $ne
      Type
      string
      Description

      Diferente do valor especificado.

    • Name
      $contains
      Type
      string
      Description

      Contém o valor especificado.

  • Name
    filters[manufacturer]
    Type
    object
    Description

    Filtra por fabricante do veículo.

    • Name
      $eq
      Type
      string
      Description

      Igual ao valor especificado.

    • Name
      $ne
      Type
      string
      Description

      Diferente do valor especificado.

    • Name
      $contains
      Type
      string
      Description

      Contém o valor especificado.

  • Name
    filters[model]
    Type
    object
    Description

    Filtra por modelo do veículo.

    • Name
      $eq
      Type
      string
      Description

      Igual ao valor especificado.

    • Name
      $ne
      Type
      string
      Description

      Diferente do valor especificado.

    • Name
      $contains
      Type
      string
      Description

      Contém o valor especificado.

  • Name
    filters[state]
    Type
    object
    Description

    Filtra por estado do veículo (UF).

    • Name
      $eq
      Type
      string
      Description

      Igual ao valor especificado.

    • Name
      $ne
      Type
      string
      Description

      Diferente do valor especificado.

  • Name
    filters[status]
    Type
    object
    Description

    Filtra por status do veículo. Valores aceitos: active, decommissioned, transferred.

    • Name
      $eq
      Type
      string
      Description

      Igual ao valor especificado. Ex: active.

    • Name
      $ne
      Type
      string
      Description

      Diferente do valor especificado. Ex: decommissioned.

Request

GET
/v1/vehicles/
curl -G https://api.habilitar.me/v1/vehicles/ \
  -H "x-api-key: {token}" \
  -d "pagination[page]=1" \
  -d "pagination[size]=10"

Response

{
  "data": [
    {
      "id": 1,
      "license_plate": "ABC1234",
      "renavam": "12345678901",
      "chassis": "9BWZZZ377VT004251",
      "manufacturer": "FIAT",
      "model": "UNO MILLE 1.0",
      "color": "BRANCA",
      "manufacture_year": 2020,
      "model_year": 2021,
      "state": "SP",
      "city": "São Paulo",
      "category": "PARTICULAR",
      "species": "PASSAGEIRO",
      "fuel": "GASOLINA",
      "motor_power": "1.0",
      "engine_displacement": "999",
      "seating_capacity": 5,
      "gross_weight": 1200,
      "maximum_towing_capacity": 400,
      "crv_issued_at": "2024-01-01",
      "crlv_issued_at": "2024-01-01",
      "restriction_1": "NENHUMA",
      "restriction_2": "NENHUMA",
      "restriction_3": "NENHUMA",
      "restriction_4": "NENHUMA",
      "status": "active",
      "traffic_violations": {
        "notices": 2,
        "penalties": 1
      },
      "user": {
        "id": 1,
        "external_uid": "EXT_USER_12345"
      },
      "company": {
        "id": 1,
        "name": "Empresa Exemplo Ltda"
      }
    }
  ],
  "pagination": {
    "page": 1,
    "size": 10
  },
  "total": 1
}

GET/v1/vehicles/{id}

Detalhar Veículo

Retorna os detalhes de um veículo específico.

Parâmetros de Rota

  • Name
    id
    Type
    number
    Required
    obrigatório
    Description

    ID do veículo que deseja consultar.

Request

GET
/v1/vehicles/{id}
curl https://api.habilitar.me/v1/vehicles/1 \
  -H "x-api-key: {token}"

Response - 200

{
  "data": {
    "id": 1,
    "license_plate": "ABC1234",
    "renavam": "12345678901",
    "chassis": "9BWZZZ377VT004251",
    "manufacturer": "FIAT",
    "model": "UNO MILLE 1.0",
    "color": "BRANCA",
    "manufacture_year": 2020,
    "model_year": 2021,
    "state": "SP",
    "city": "São Paulo",
    "category": "PARTICULAR",
    "species": "PASSAGEIRO",
    "fuel": "GASOLINA",
    "motor_power": "1.0",
    "engine_displacement": "999",
    "seating_capacity": 5,
    "gross_weight": 1200,
    "maximum_towing_capacity": 400,
    "crv_issued_at": "2024-01-01",
    "crlv_issued_at": "2024-01-01",
    "restriction_1": "NENHUMA",
    "restriction_2": "NENHUMA",
    "restriction_3": "NENHUMA",
    "restriction_4": "NENHUMA",
    "status": "active",
    "traffic_violations": {
      "notices": 2,
      "penalties": 1
    },
    "user": {
      "id": 1,
      "external_uid": "EXT_USER_12345"
    },
    "company": {
      "id": 1,
      "name": "Empresa Exemplo Ltda"
    }
  }
}

Response - 404

{
  "error": "Not Found",
  "message": "Vehicle with id 123 not found"
}

GET/v1/vehicles/{id}/crlv

CRLV do Veículo

Retorna o arquivo PDF do CRLV (Certificado de Registro e Licenciamento de Veículo) de um veículo específico.

Parâmetros de Rota

  • Name
    id
    Type
    number
    Required
    obrigatório
    Description

    ID do veículo.

Request

GET
/v1/vehicles/{id}/crlv
curl https://api.habilitar.me/v1/vehicles/1/crlv \
  -H "x-api-key: {token}"

Response - 200

{
  "data": "data:application/pdf;base64,JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2..."
}

Response - 404

{
  "error": "Not Found",
  "message": "CRLV for vehicle with id 123 is not available"
}

Eventos de Webhook

  • Name
    vehicle.created
    Description

    Um novo veículo foi criado.

  • Name
    vehicle.updated
    Description

    Um veículo foi atualizado.

Exemplo de payload

{
  "type": "vehicle.created",
  "data": {
    "id": 1,
    "license_plate": "ABC1234",
    "renavam": "12345678901",
    "chassis": "9BWZZZ377VT004251",
    "manufacturer": "FIAT",
    "model": "UNO MILLE 1.0",
    "color": "BRANCA",
    "manufacture_year": 2020,
    "model_year": 2021,
    "state": "SP",
    "city": "São Paulo",
    "category": "PARTICULAR",
    "species": "PASSAGEIRO",
    "fuel": "GASOLINA",
    "motor_power": "1.0",
    "engine_displacement": "999",
    "seating_capacity": 5,
    "gross_weight": 1200,
    "maximum_towing_capacity": 400,
    "crv_issued_at": "2024-01-01",
    "crlv_issued_at": "2024-01-01",
    "restriction_1": "NENHUMA",
    "restriction_2": "NENHUMA",
    "restriction_3": "NENHUMA",
    "restriction_4": "NENHUMA",
    "status": "active",
    "traffic_violations": {
      "notices": 2,
      "penalties": 1
    },
    "user": {
      "id": 1,
      "external_uid": "EXT_USER_12345"
    },
    "company": {
      "id": 1,
      "tax_id": "12345678000190",
      "external_uid": "EXT_COMPANY_123",
      "name": "Empresa Exemplo Ltda"
    }
  }
}

Essa página foi útil?