> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dados.rio/llms.txt
> Use this file to discover all available pages before exploring further.

# Cadastrar veículo

> Cadastra um veículo para o CPF autenticado. Fluxo catálogo (brand_id+model_id), híbrido (brand_id + model_other sem model_id) ou Outro livre (brand_other/model_other+vehicle_type). URLs de foto devem ser HTTPS GCS. Se has_invoice=true, invoice_photo_url é obrigatória. Contato do dono (nome/telefone/e-mail) é enriquecido ao vivo via RMI a partir do owner_cpf — não enviar owner_* no body. registration_number é gerado pelo backend (formato RJ-E-XXXXXX).



## OpenAPI

````yaml https://raw.githubusercontent.com/prefeitura-rio/app-rmi/refs/heads/main/docs/openapi-v3.json post /citizen/{cpf}/vehicles
openapi: 3.0.0
info:
  description: >-
    API para gerenciamento de dados de cidadãos do Rio de Janeiro, incluindo
    autodeclaração de informações e verificação de contato.
  title: API RMI
  termsOfService: http://swagger.io/terms/
  contact:
    name: Suporte RMI
    url: http://www.rio.rj.gov.br
    email: suporte@rio.rj.gov.br
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: https://services.pref.rio/rmi/v1
    description: Production
  - url: https://services.staging.app.dados.rio/rmi/v1
    description: Staging
security: []
tags:
  - description: >-
      Operações relacionadas a cidadãos, incluindo consulta e atualização de
      dados autodeclarados
    name: citizen
  - description: >-
      Carteira de veículos (bicicleta elétrica, autopropelido, ciclomotor),
      condutores e catálogo
    name: mobilidade
  - description: Operações relacionadas a departamentos/unidades administrativas (UA)
    name: departments
  - description: Gerenciamento de categorias de notificação (admin) e listagem pública
    name: notification-categories
  - description: Gerenciamento de preferências de notificação por CPF e telefone
    name: notification-preferences
  - description: Operações de verificação de saúde da API
    name: health
  - description: >-
      Integração Salesforce Person Account: login sync, webhook inbound (delta),
      proxies CRM e push assíncrono RMI→SF via sync worker
    name: salesforce
paths:
  /citizen/{cpf}/vehicles:
    post:
      tags:
        - mobilidade
      summary: Cadastrar veículo
      description: >-
        Cadastra um veículo para o CPF autenticado. Fluxo catálogo
        (brand_id+model_id), híbrido (brand_id + model_other sem model_id) ou
        Outro livre (brand_other/model_other+vehicle_type). URLs de foto devem
        ser HTTPS GCS. Se has_invoice=true, invoice_photo_url é obrigatória.
        Contato do dono (nome/telefone/e-mail) é enriquecido ao vivo via RMI a
        partir do owner_cpf — não enviar owner_* no body. registration_number é
        gerado pelo backend (formato RJ-E-XXXXXX).
      parameters:
        - description: CPF do cidadão (11 dígitos)
          name: cpf
          in: path
          required: true
          schema:
            type: string
            minLength: 11
            maxLength: 11
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/models.VehicleCreateRequest'
        description: Dados do veículo
        required: true
      responses:
        '201':
          description: Veículo criado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.VehicleDetail'
        '400':
          description: Validação inválida
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers.ErrorResponse'
        '401':
          description: Não autenticado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers.ErrorResponse'
        '403':
          description: Acesso negado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers.ErrorResponse'
        '500':
          description: Erro interno
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers.ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    models.VehicleCreateRequest:
      type: object
      required:
        - color
        - display_name
        - has_invoice
        - self_declaration
        - serial_number
        - serial_number_photo_url
        - vehicle_photo_url
      properties:
        brand_id:
          type: string
          nullable: true
        brand_other:
          type: string
          nullable: true
        color:
          type: string
        display_name:
          type: string
        has_invoice:
          type: boolean
        invoice_photo_file_name:
          type: string
        invoice_photo_file_size:
          type: integer
        invoice_photo_url:
          type: string
          nullable: true
        model_id:
          type: string
          nullable: true
        model_other:
          type: string
          nullable: true
        self_declaration:
          type: boolean
        serial_number:
          type: string
        serial_number_photo_file_name:
          type: string
        serial_number_photo_file_size:
          type: integer
        serial_number_photo_url:
          type: string
        vehicle_photo_file_name:
          type: string
        vehicle_photo_file_size:
          type: integer
        vehicle_photo_url:
          type: string
        vehicle_type:
          $ref: '#/components/schemas/models.VehicleType'
    models.VehicleDetail:
      type: object
      properties:
        brand_id:
          type: string
          nullable: true
        brand_name:
          description: >-
            BrandName is response-only: catalog brand name when brand_id is set
            and brand_other is empty.
          type: string
          nullable: true
        brand_other:
          type: string
          nullable: true
        color:
          type: string
        conductor_id:
          type: string
        created_at:
          type: string
        deleted_at:
          type: string
        display_name:
          type: string
        has_invoice:
          type: boolean
        id:
          type: string
        invoice_photo_file_name:
          type: string
        invoice_photo_file_size:
          type: integer
        invoice_photo_url:
          type: string
          nullable: true
        model_id:
          type: string
          nullable: true
        model_name:
          description: >-
            ModelName is response-only: catalog model name when model_id is set
            and model_other is empty.
          type: string
          nullable: true
        model_other:
          type: string
          nullable: true
        owner_cpf:
          type: string
        owner_email:
          type: string
        owner_name:
          type: string
        owner_phone:
          type: string
        registration_number:
          description: >-
            RegistrationNumber is a short wallet identifier generated on create
            (format RJ-E-XXXXXX). Not accepted in POST/PATCH.
          type: string
          example: RJ-E-000001
        role:
          $ref: '#/components/schemas/models.VehicleRole'
        self_declaration:
          type: boolean
        serial_number:
          type: string
        serial_number_photo_file_name:
          description: Optional file metadata for UI detail (Apêndice A.4).
          type: string
        serial_number_photo_file_size:
          type: integer
        serial_number_photo_url:
          type: string
        updated_at:
          type: string
        vehicle_photo_file_name:
          type: string
        vehicle_photo_file_size:
          type: integer
        vehicle_photo_url:
          type: string
        vehicle_type:
          $ref: '#/components/schemas/models.VehicleType'
    handlers.ErrorResponse:
      type: object
      properties:
        error:
          type: string
    models.VehicleType:
      type: string
      enum:
        - bicicleta_eletrica
        - autopropelido
        - ciclomotor
      x-enum-varnames:
        - VehicleTypeBicicletaEletrica
        - VehicleTypeAutopropelido
        - VehicleTypeCiclomotor
    models.VehicleRole:
      type: string
      enum:
        - owner
        - conductor
      x-enum-varnames:
        - VehicleRoleOwner
        - VehicleRoleConductor
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.