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

# Search

> Full-text search across shipments, containers, and tracking requests in your Terminal49 account by BL number, container number, or reference number.



## OpenAPI

````yaml get /search
openapi: 3.0.0
info:
  title: Terminal49 API Reference
  version: 0.2.0
  contact:
    name: Terminal49 API support
    url: https://www.terminal49.com
    email: support@terminal49.com
  description: >-
    The Terminal 49 API offers a convenient way to programmatically track your
    shipments from origin to destination.


    Please enter your API key into the "Variables" tab before using these
    endpoints within Postman.
  x-label: Beta
  termsOfService: https://www.terminal49.com/terms
servers:
  - url: https://api.terminal49.com/v2
    description: Production
security:
  - authorization: []
tags:
  - name: Containers
  - name: Custom Field Definitions
  - name: Custom Field Options
  - name: Custom Fields
  - name: Shipments
  - name: Locations
  - name: Events
  - name: Tracking Requests
  - name: Webhooks
  - name: Webhook Notifications
  - name: Ports
  - name: Metro Areas
  - name: Terminals
  - name: Routing (Paid)
  - name: Documents
  - name: Email Submissions
  - name: Document Schemas
  - name: Search
paths:
  /search:
    get:
      tags:
        - Search
      summary: Search shipments, containers, and tracking requests
      description: >-
        Full-text search across shipments, containers (cargos), and tracking
        requests within your account. Results are ranked by type (shipments
        first, then containers, then tracking requests) and recency. Returns up
        to 25 results. Duplicate tracking requests (where a shipment exists with
        the same BL number) are automatically filtered out.
      operationId: searchAll
      parameters:
        - schema:
            type: string
          in: query
          name: query
          required: true
          description: >-
            Search term to match against BL numbers, container numbers,
            reference numbers, and other indexed fields. Supports full-text
            search and partial (ILIKE) matching.
      responses:
        '200':
          description: Successful search results
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Unique identifier of the matched resource
                        type:
                          type: string
                          description: Resource type
                          enum:
                            - shipment
                            - cargo
                            - tracking_request
                        attributes:
                          type: object
                          properties:
                            entity_type:
                              type: string
                              description: >-
                                Type of the matched entity: `shipment`, `cargo`,
                                or `tracking_request`
                            number:
                              type: string
                              description: >-
                                BL number (shipments), container number
                                (cargos), or request number (tracking requests)
                            shipment_id:
                              type: string
                              nullable: true
                              description: >-
                                Associated shipment ID (for cargos and tracking
                                requests only)
                            scac:
                              type: string
                              nullable: true
                              description: Standard Carrier Alpha Code of the shipping line
                            port_of_lading_name:
                              type: string
                              nullable: true
                              description: Port of lading name (shipments only)
                            port_of_discharge_name:
                              type: string
                              nullable: true
                              description: Port of discharge name (shipments only)
                            containers_count:
                              type: integer
                              nullable: true
                              description: >-
                                Number of containers on the shipment (shipments
                                only)
                            tracking_stopped:
                              type: boolean
                              nullable: true
                              description: >-
                                Whether tracking has been stopped (shipments
                                only)
                            tracking_stopped_reason:
                              type: string
                              nullable: true
                              description: Reason tracking was stopped (shipments only)
                            status:
                              type: string
                              nullable: true
                              description: Tracking request status (tracking requests only)
                            failed_reason:
                              type: string
                              nullable: true
                              description: >-
                                Reason the tracking request failed (tracking
                                requests only)
                            ref_numbers:
                              type: array
                              items:
                                type: string
                              description: Customer reference numbers
                            created_at:
                              type: string
                              format: date-time
                              description: When the resource was created
                            updated_at:
                              type: string
                              format: date-time
                              description: When the resource was last updated
              example:
                data:
                  - id: abc12345-6789-40ef-9012-3456789abcde
                    type: shipment
                    attributes:
                      entity_type: shipment
                      number: MEDUA1234567
                      shipment_id: null
                      scac: MSCU
                      port_of_lading_name: Shanghai
                      port_of_discharge_name: Los Angeles
                      containers_count: 3
                      tracking_stopped: false
                      tracking_stopped_reason: null
                      status: null
                      failed_reason: null
                      ref_numbers:
                        - PO-2026-001
                      created_at: '2026-01-15T10:30:00.000Z'
                      updated_at: '2026-03-01T14:22:00.000Z'
                  - id: def45678-9012-43ab-9cde-f0123456789a
                    type: cargo
                    attributes:
                      entity_type: cargo
                      number: MSCU1234567
                      shipment_id: abc12345-6789-40ef-9012-3456789abcde
                      scac: MSCU
                      port_of_lading_name: null
                      port_of_discharge_name: null
                      containers_count: null
                      tracking_stopped: null
                      tracking_stopped_reason: null
                      status: null
                      failed_reason: null
                      ref_numbers: []
                      created_at: '2026-01-15T10:30:00.000Z'
                      updated_at: '2026-03-01T14:22:00.000Z'
        '400':
          description: Bad request — missing required `query` parameter
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        detail:
                          type: string
              example:
                errors:
                  - detail: Query parameter is required
        '401':
          description: Unauthorized — missing or invalid API token
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      $ref: '#/components/schemas/error'
              examples:
                unauthorized:
                  summary: Missing or invalid API token
                  value:
                    errors:
                      - status: '401'
                        title: Unauthorized
                        detail: Invalid or missing API token.
components:
  schemas:
    error:
      title: Error model
      type: object
      properties:
        detail:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        source:
          type: object
          nullable: true
          properties:
            pointer:
              type: string
              nullable: true
            parameter:
              type: string
              nullable: true
        code:
          type: string
          nullable: true
        status:
          type: string
          nullable: true
        meta:
          type: object
          nullable: true
          additionalProperties: true
      required:
        - title
  securitySchemes:
    authorization:
      name: Authorization
      type: apiKey
      in: header
      description: >-
        Use a Terminal49 API key in the `Authorization` header with the `Token`
        prefix.


        `Authorization: Token YOUR_API_KEY`

````