---
title: "Search stream messages by subject pattern"
method: GET
path: "/storage/streams/{stream}/search-by-subject"
tags: ["Stream Search"]
---

# Search stream messages by subject pattern

`GET /storage/streams/{stream}/search-by-subject`

## Request

- Base URL: `https://api.quiva.ai`
- URL: `https://api.quiva.ai/storage/streams/{stream}/search-by-subject`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-5/docs/storage/streams/:stream/search-by-subject/get.ts> (a function with typed inputs; its response is checked against the schema)

Searches for stream messages by subject pattern

## Path parameters

- `stream` string, required

## Query parameters

- `search` string, required
- `limit` integer

## Response `200`

Search results

- StreamSearchResponse
  - `body` object
    - `results` SearchStreamItem[]
      - `subject` string
      - `value` string
      - `created` string, date-time
    - `results_total` integer
  - `metadata` Metadata
    - `bucket` string: Bucket name
    - `duration` string: Operation duration
    - `field` string: Search field
    - `hits` integer: Number of hits
    - `index_duration` string: Index search duration
    - `index_hits` integer: Number of index hits
    - `index_name` string: Index name
    - `index_partitions` integer: Number of index partitions
    - `key` string: Entry key
    - `limit` integer: Query limit
    - `partitions` integer: Number of partitions
    - `search` string: Search term
    - `stream` string: Stream name
    - `subject` string: Subject pattern

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not Found
- `500`: Internal Server Error

## Changes

- **2025-07-04** `d566a61279be`: 1 breaking, 3 warning, 13 info
  - added the new path request parameter `name`
  - for the `query` request parameter `limit`, the max was set to `1000.00`
  - for the `query` request parameter `limit`, the min was set to `1.00`
  - removed the optional property `body/results/items/data` from the response with the `200` status
  - …13 more

[Operation history](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-5/changes/storage/streams/:stream/search-by-subject/get.md)

---

[API](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-5.md) - [All operations](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-5/llms.txt) - [OpenAPI document](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-5/revisions/104591eadd10?raw)
