> ## 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.

# Create a vehicle search

> Starts a search for car rentals, from a pick-up place and time to a drop-off place and time.

Searches are asynchronous: this answers `202` at once with the search in `PROCESSING` status while the travel suppliers answer in the background. Poll the search with its `id` until `status` is `COMPLETED` — or `FAILED` — to read the results. A vehicle search lasts 30 minutes (see `ttl`); after that, create it again. Creating the same search again while it lasts returns the same `id`, and only your organization can read the searches it created.

Find `pickUpLocation` and `dropOffLocation` with the locations endpoint. To book a result, open the item for its fare options, then create a trip with the item's `id` as `searchItemId` and the chosen fare option's `id` as `fareId`.

An error the travel provider reports about the request — an unknown place, say — is returned with its own status, `code` and `message`.


## OpenAPI

````yaml /api-reference/travel.openapi.json post /realms/{realmId}/organizations/{organizationId}/vehicle/searches
openapi: 3.0.3
info:
  title: Travel
  version: 1.0.0
  description: >-
    Portão 3 travel 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). Passenger directory, trips
    and the search proxy (air/hotel/bus/vehicle). Every route validates path,
    query and body through a zod Input class (`travel/src/domain/*/input`),
    which documents its parameters and body; responses are the named interfaces
    in `travel/src/domain/*/response.ts`. Confidence tiers: generated:typed=53
    copied:manual=0 unknown=0.
servers:
  - url: https://api.travel.v2.portao3.com.br/
    description: production
  - url: https://api.travel.dev.3pers.com.br/
    description: development
security: []
tags:
  - name: Passengers
  - name: Trips
  - name: Air search
  - name: Hotel search
  - name: Bus search
  - name: Vehicle search
paths:
  /realms/{realmId}/organizations/{organizationId}/vehicle/searches:
    post:
      tags:
        - Vehicle search
      summary: Create a vehicle search
      description: >-
        Starts a search for car rentals, from a pick-up place and time to a
        drop-off place and time.
      operationId: postRealmsByRealmIdOrganizationsByOrganizationIdVehicleSearches
      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 your organization.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                pickUpLocation:
                  type: string
                  minLength: 1
                  description: >-
                    Pick-up place: its `id` or its `slug` from the locations
                    endpoint.
                  example: sao-paulo-sp
                dropOffLocation:
                  type: string
                  minLength: 1
                  description: >-
                    Drop-off place: its `id` or its `slug` from the locations
                    endpoint.
                  example: sao-paulo-sp
                pickUpDate:
                  type: string
                  minLength: 1
                  description: >-
                    Pick-up date and time, local to the pick-up place
                    (`YYYY-MM-DDTHH:mm:ss`, no time-zone offset). Today or
                    later, and before `dropOffDate`.
                  example: '2026-11-02T10:00:00'
                dropOffDate:
                  type: string
                  minLength: 1
                  description: >-
                    Drop-off date and time, local to the drop-off place
                    (`YYYY-MM-DDTHH:mm:ss`, no time-zone offset), after
                    `pickUpDate`.
                  example: '2026-11-05T10:00:00'
              required:
                - pickUpLocation
                - dropOffLocation
                - pickUpDate
                - dropOffDate
      responses:
        '202':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: >-
                      ID of the search. The same search parameters, within the
                      time the search lasts, return the same ID.
                    example: srch_Hb7Yk1DrMv3Lq8UsAe0Xj
                  searchParams:
                    type: object
                    properties:
                      pickUpLocation:
                        type: string
                        description: Pick-up place, as sent.
                        example: sao-paulo-sp
                      dropOffLocation:
                        type: string
                        description: Drop-off place, as sent.
                        example: sao-paulo-sp
                      pickUpDate:
                        type: string
                        description: Pick-up date and time, as sent.
                        example: '2026-11-02T10:00:00'
                      dropOffDate:
                        type: string
                        description: Drop-off date and time, as sent.
                        example: '2026-11-05T10:00:00'
                    required:
                      - pickUpLocation
                      - dropOffLocation
                      - pickUpDate
                      - dropOffDate
                    description: What the search was made for.
                  type:
                    type: string
                    enum:
                      - VEHICLE
                    description: Always `VEHICLE`.
                    example: VEHICLE
                  status:
                    type: string
                    enum:
                      - PROCESSING
                      - FAILED
                      - COMPLETED
                    description: >-
                      `PROCESSING` right after creation. It becomes `COMPLETED`
                      or `FAILED` on its own: poll the search.
                    example: PROCESSING
                  warning:
                    description: >-
                      How the search went across the suppliers. `null` while it
                      is processing.
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - ALL_FAILED
                          - PARTIAL_SUCCESS
                          - ALL_SUCCESS
                        description: >-
                          `ALL_SUCCESS`: every supplier answered.
                          `PARTIAL_SUCCESS`: some suppliers failed, so the
                          results may be incomplete. `ALL_FAILED`: no supplier
                          answered.
                        example: ALL_SUCCESS
                      message:
                        type: string
                        description: Human-readable explanation.
                        example: All suppliers answered.
                    required:
                      - code
                      - message
                    nullable: true
                  ttl:
                    type: number
                    description: Seconds until the search expires.
                    example: 1800
                  facets:
                    description: >-
                      Facets to build filters from (price ranges, categories,
                      rental companies, with their counts). `null` until the
                      search completes.
                    type: object
                    additionalProperties: {}
                    nullable: true
                  createdAt:
                    type: string
                    description: When the search was created.
                    example: '2026-10-19T15:00:00.000Z'
                    format: date-time
                required:
                  - id
                  - searchParams
                  - type
                  - status
                  - warning
                  - ttl
                  - facets
                  - createdAt
                description: >-
                  A search just created for vehicle rentals. Results come later:
                  poll the search.
        '422':
          description: >-
            `BAD_REQUEST` — A path parameter is not a valid ID or the body
            failed validation; `fields` lists each offending field.
          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:
                      - TRAVEL
                    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: TRAVEL
                message: >-
                  Bad Request: Your request is invalid or incomplete. Please
                  make sure you are requesting with the right fields.
                fields:
                  - field: pickUpLocation
                    message: 'Invalid input: expected string, received undefined'
                    code: PICKUPLOCATION_REQUIRED
        '503':
          description: >-
            `PROVIDER_UNAVAILABLE` — The travel provider could not be reached;
            no search was created. Retry later.
          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:
                      - PROVIDER_UNAVAILABLE
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - TRAVEL
                    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: PROVIDER_UNAVAILABLE
                origin: TRAVEL
                message: Travel provider temporarily unavailable, please retry.

````

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