> ## 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 hotel search

> Starts a search for hotels in a destination, for given dates and rooms.

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 hotel 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 `destinationId` with the locations endpoint. To book a result, open the item for its rooms, then create a trip with the item's `id` as `searchItemId` and the chosen rooms' `id` as `roomId`.

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


## OpenAPI

````yaml /api-reference/travel.openapi.json post /realms/{realmId}/organizations/{organizationId}/hotel/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}/hotel/searches:
    post:
      tags:
        - Hotel search
      summary: Create a hotel search
      description: Starts a search for hotels in a destination, for given dates and rooms.
      operationId: postRealmsByRealmIdOrganizationsByOrganizationIdHotelSearches
      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:
                checkInDate:
                  type: string
                  minLength: 1
                  description: >-
                    Check-in date (`YYYY-MM-DD`). Today or later, and before
                    `checkOutDate`.
                  example: '2026-11-02'
                checkOutDate:
                  type: string
                  minLength: 1
                  description: Check-out date (`YYYY-MM-DD`), after `checkInDate`.
                  example: '2026-11-05'
                destinationId:
                  type: string
                  minLength: 1
                  description: >-
                    Destination: the `id` or the `slug` of a place returned by
                    the locations endpoint.
                  example: sao-paulo-sp
                rooms:
                  minItems: 1
                  type: array
                  items:
                    type: object
                    properties:
                      adults:
                        type: integer
                        minimum: 1
                        description: Number of adults staying in the room, at least 1.
                        example: 2
                      children:
                        description: >-
                          Number of children staying in the room. Omit it when
                          there are none.
                        example: 1
                        type: integer
                        minimum: 0
                    required:
                      - adults
                  description: >-
                    The rooms to search for, with who stays in each. At least
                    one.
              required:
                - checkInDate
                - checkOutDate
                - destinationId
                - rooms
      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_Qm8Zt3LwXc1Ry7NvB0kHd
                  searchParams:
                    type: object
                    properties:
                      checkInDate:
                        type: string
                        description: Check-in date, as sent.
                        example: '2026-11-02'
                      checkOutDate:
                        type: string
                        description: Check-out date, as sent.
                        example: '2026-11-05'
                      destinationId:
                        type: string
                        description: Destination, as sent.
                        example: sao-paulo-sp
                      rooms:
                        type: array
                        items:
                          type: object
                          properties:
                            adults:
                              type: number
                              description: Number of adults staying in the room.
                              example: 2
                            children:
                              type: number
                              description: >-
                                Number of children staying in the room. Omitted
                                when there are none.
                              example: 1
                          required:
                            - adults
                          description: The occupancy of one room of a hotel search.
                        description: Rooms, as sent.
                    required:
                      - checkInDate
                      - checkOutDate
                      - destinationId
                      - rooms
                    description: What the search was made for.
                  type:
                    type: string
                    enum:
                      - HOTEL
                    description: Always `HOTEL`.
                    example: HOTEL
                  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 (star ratings, price ranges).
                      `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 hotels. 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: checkInDate
                    message: 'Invalid input: expected string, received undefined'
                    code: CHECKINDATE_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.