> ## Documentation Index
> Fetch the complete documentation index at: https://developers.portao3.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Archive a vehicle

> Archives a vehicle and blocks its wallet.

The wallet's available balance goes back to the organization's default wallet — a blocked or cashback balance stays in it — and the wallet is blocked, so it can no longer pay for anything; the vehicle's `status` then becomes `ARCHIVED`. An archived vehicle is still listed and can still be read, and unarchive reactivates it. No request body.

Only organization admins can archive vehicles. If the wallet can't be emptied or blocked, that error is returned with its own status, `code` and `origin` and the vehicle stays `ACTIVE`; sending the request again is safe.


## OpenAPI

````yaml /api-reference/vehicle.openapi.json post /realms/{realmId}/organizations/{organizationId}/vehicles/{vehicleId}/archive
openapi: 3.0.3
info:
  title: Vehicle
  version: 1.0.0
  description: >-
    Portão 3 vehicle API. Every endpoint requires a bearer token in the
    Authorization header (Authorization: Bearer <token>) unless its page states
    otherwise; see the Authentication guide. That requirement is not repeated
    per endpoint. Generated by tools/openapi from code (routes + security) and
    the hand-written spec (request/response bodies). Fleet vehicles, each with a
    dedicated wallet. Confidence tiers: generated:typed=9 copied:manual=0
    unknown=0.
servers:
  - url: https://api.vehicle.v2.portao3.com.br/
    description: production
  - url: https://api.vehicle.dev.3pers.com.br/
    description: development
security: []
tags:
  - name: Vehicles
paths:
  /realms/{realmId}/organizations/{organizationId}/vehicles/{vehicleId}/archive:
    post:
      tags:
        - Vehicles
      summary: Archive a vehicle
      description: Archives a vehicle and blocks its wallet.
      operationId: >-
        postRealmsByRealmIdOrganizationsByOrganizationIdVehiclesByVehicleIdArchive
      parameters:
        - name: realmId
          in: path
          required: true
          description: |-
            ID of your realm.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
        - name: organizationId
          in: path
          required: true
          description: |-
            ID of the organization the vehicle belongs to.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
        - name: vehicleId
          in: path
          required: true
          description: ID of the vehicle (24 hexadecimal characters).
          schema:
            type: string
            pattern: ^[0-9a-fA-F]{24}$
          example: 6710b8e4c9e77b0012a4d6f1
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: ID of the vehicle.
                    example: 6710b8e4c9e77b0012a4d6f1
                  realmId:
                    type: string
                    description: ID of the realm the vehicle belongs to.
                    example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
                    format: uuid
                  organizationId:
                    type: string
                    description: ID of the organization the vehicle belongs to.
                    example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
                    format: uuid
                  name:
                    type: string
                    description: Display name of the vehicle.
                    example: Delivery van 07
                  licensePlate:
                    type: string
                    description: >-
                      License plate, upper-cased with no hyphen or space: the
                      old Brazilian format (`ABC1234`) or the Mercosul one
                      (`ABC1D23`).
                    example: BRA2E19
                  make:
                    type: string
                    description: Manufacturer.
                    example: Fiat
                  model:
                    type: string
                    description: Model.
                    example: Fiorino
                  year:
                    type: number
                    description: Model year.
                    example: 2023
                  status:
                    type: string
                    enum:
                      - ACTIVE
                      - ARCHIVED
                    description: >-
                      `ACTIVE`, or `ARCHIVED` once the vehicle was archived. An
                      archived vehicle's wallet is blocked.
                    example: ARCHIVED
                  external:
                    type: object
                    properties:
                      walletId:
                        type: string
                        description: >-
                          ID of the vehicle's dedicated wallet. Use it with the
                          wallet, card and transaction endpoints of the Banking
                          API.
                        example: 6710b8e4c9e77b0012a4d6f3
                      accountId:
                        type: string
                        description: >-
                          ID of the organization's account the wallet belongs
                          to.
                        example: 66f2a1c7b4d3e80012c9a0b4
                    required:
                      - walletId
                      - accountId
                    description: The vehicle's dedicated wallet.
                  customFields:
                    type: object
                    additionalProperties: {}
                    description: >-
                      Values of the organization's vehicle custom fields, keyed
                      by the custom field's `slug`. Empty when none were set.


                      ---


                      Example: `{"cost-center":"CC-1020"}`
                    example:
                      cost-center: CC-1020
                  createdBy:
                    type: string
                    description: ID of the user who registered the vehicle.
                    example: e3553bc1-5e20-4e17-b22a-a796fda0aa99
                    format: uuid
                  updatedBy:
                    type: string
                    description: ID of the user who last changed the vehicle.
                    example: e3553bc1-5e20-4e17-b22a-a796fda0aa99
                    format: uuid
                  createdAt:
                    type: string
                    description: When the vehicle was registered.
                    example: '2026-10-17T13:45:12.000Z'
                    format: date-time
                  updatedAt:
                    type: string
                    description: When the vehicle was last changed.
                    example: '2026-10-17T13:45:12.000Z'
                    format: date-time
                required:
                  - id
                  - realmId
                  - organizationId
                  - name
                  - licensePlate
                  - make
                  - model
                  - year
                  - status
                  - external
                  - customFields
                description: A vehicle of the organization's fleet.
        '403':
          description: '`VEHICLE_ADMIN_REQUIRED` — You are not an admin of the organization.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - VEHICLE_ADMIN_REQUIRED
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - VEHICLE
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: VEHICLE_ADMIN_REQUIRED
                origin: VEHICLE
                message: Organization admin required
        '404':
          description: >-
            `VEHICLE_NOT_FOUND` — No vehicle with this ID exists in the
            organization.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - VEHICLE_NOT_FOUND
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - VEHICLE
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: VEHICLE_NOT_FOUND
                origin: VEHICLE
                message: Vehicle not found
        '409':
          description: '`VEHICLE_NOT_ACTIVE` — The vehicle is already archived.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - VEHICLE_NOT_ACTIVE
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - VEHICLE
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: VEHICLE_NOT_ACTIVE
                origin: VEHICLE
                message: Vehicle is not active — it has already been archived
        '422':
          description: >-
            `BAD_REQUEST` — A path parameter is not a valid ID; `fields` lists
            each one.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - BAD_REQUEST
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - VEHICLE
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                  fields:
                    type: array
                    description: >-
                      One entry per invalid request field (validation errors
                      only).
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: >-
                            Path of the invalid field, e.g. `label` or
                            `values[0].value`.
                          example: label
                        message:
                          type: string
                          description: Why the field was rejected.
                          example: label is required
                        code:
                          type: string
                          description: >-
                            `<FIELD>_<REASON>` — e.g. `LABEL_REQUIRED`,
                            `TYPE_ONE_OF`, `VALUES_VALUE_TYPE_ERROR`.
                          example: LABEL_REQUIRED
                        values:
                          type: array
                          items:
                            type: string
                          description: >-
                            The accepted values, when the field is an
                            enumeration.
                      required:
                        - field
                        - message
                        - code
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: BAD_REQUEST
                origin: VEHICLE
                message: >-
                  Bad Request: Your request is invalid or incomplete. Please
                  make sure you are requesting with the right fields.
                fields:
                  - field: organizationId
                    message: Invalid UUID
                    code: ORGANIZATIONID_UUID

````

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