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

# List trip history

> Lists the changes of a trip's state and status, oldest first.

The first entry is the booking being recorded. Each following one is a change, with how it was learned: `API` when a read or an action of yours found it, `WEBHOOK` when the travel provider reported it, `POLL` when a periodic check did. The trip is brought up to date with the provider before the answer, so a change the provider already made shows up as a fresh entry. Empty while the trip is still being created. Visible to an organization admin and to the users the trip carries, like the trip itself.


## OpenAPI

````yaml /api-reference/travel.openapi.json get /realms/{realmId}/organizations/{organizationId}/trips/{tripId}/history
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}/trips/{tripId}/history:
    get:
      tags:
        - Trips
      summary: List trip history
      description: Lists the changes of a trip's state and status, oldest first.
      operationId: getRealmsByRealmIdOrganizationsByOrganizationIdTripsByTripIdHistory
      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 trip belongs to.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
        - name: tripId
          in: path
          required: true
          description: ID of the trip (24 hexadecimal characters).
          schema:
            type: string
            pattern: ^[0-9a-fA-F]{24}$
          example: 6711b4c0d8e1a30012b7c9f2
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        status:
                          type: string
                          enum:
                            - PROCESSING_RESERVATION
                            - RESERVATION_FAILED
                            - RESERVED
                            - PROCESSING_ISSUE
                            - ISSUED
                            - PROCESSING_CANCELLATION
                            - CANCELED
                            - AWAITING_MANUAL_CANCELLATION
                            - CANCELLATION_FAILED
                            - FAILED
                            - FAILED_BY_INCONSISTENT_DATA
                            - FAILED_BY_UNAVAILABLE_RESOURCE
                            - FAILED_BY_BUDGET_EXCEEDED
                            - EXPIRED
                            - BLOCKED
                            - UNKNOWN
                            - ISSUANCE_FAILED
                          description: The status the trip changed to.
                          example: RESERVED
                        state:
                          type: string
                          enum:
                            - PENDING
                            - RESERVED
                            - ISSUED
                            - CANCELED
                          description: The state the trip was in.
                          example: RESERVED
                        at:
                          type: string
                          description: When the change was recorded.
                          example: '2026-10-01T13:46:03.000Z'
                          format: date-time
                        source:
                          type: string
                          enum:
                            - WEBHOOK
                            - POLL
                            - API
                          description: >-
                            How the change was learned: `API` when you or the
                            system read or acted on the trip, `WEBHOOK` when the
                            travel provider reported it, `POLL` when a periodic
                            check found it.
                          example: API
                      required:
                        - status
                        - state
                        - at
                        - source
                      description: One change of a trip's state or status.
                    description: Changes in chronological order, the oldest first.
                required:
                  - items
                description: The history of a trip.
        '404':
          description: >-
            `TRIP_NOT_FOUND` — No trip with this ID is visible to you in the
            organization: it doesn't exist, belongs to another organization, or
            you are neither an organization admin nor a passenger on it.
          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:
                      - TRIP_NOT_FOUND
                    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: TRIP_NOT_FOUND
                origin: TRAVEL
                message: Trip not found
        '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:
                      - 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: organizationId
                    message: Invalid UUID
                    code: ORGANIZATIONID_UUID

````

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