---
title: "Search a transcript"
method: POST
path: "/transcripts/{dir}/{id}/search"
tags: ["search"]
---

# Search a transcript

`POST /transcripts/{dir}/{id}/search`

Search a transcript using grep or LLM-based search.

Returns cached results if the same search was run before.

## Path parameters

- `dir` string, required — Transcripts directory (base64url-encoded)
- `id` string, required — Transcript ID

## Request body

- union
  - GrepSearchRequest — Request body for grep transcript searches.
    - `events` union
      - 'all'
      - union[]
        - union
          - 'model' | 'tool' | 'compaction' | 'branch' | 'approval' | 'sandbox' | 'info' | 'store' | 'logger' | 'error' | 'span_begin' | 'span_end'
          - string
    - `ignore_case` boolean, required
    - `messages` union
      - 'all'
      - string[]
    - `query` string, required
    - `regex` boolean, required
    - `type` 'grep', required
    - `word_boundary` boolean, required
  - LlmSearchRequest — Request body for LLM transcript searches.
    - `events` union
      - 'all'
      - union[]
        - union
          - 'model' | 'tool' | 'compaction' | 'branch' | 'approval' | 'sandbox' | 'info' | 'store' | 'logger' | 'error' | 'span_begin' | 'span_end'
          - string
    - `messages` union
      - 'all'
      - string[]
    - `model` string, nullable
    - `query` string, required
    - `type` 'llm', required

## Response `200`

Successful Response

- SearchResponse — Response from running a transcript search.
  - `id` string, required
  - `result` Result, required — Scan result.
    - `answer` string, nullable
    - `explanation` string, nullable
    - `label` string, nullable
    - `metadata` object, nullable
    - `references` Reference[], required
      - `cite` string, nullable
      - `id` string, required
      - `type` 'message' | 'event', required
    - `type` string, nullable
    - `uuid` string, nullable
    - `value` unknown, required

---

[API](https://skmtc.net/meridianlabs-ai/apis/inspect-scout-viewer-api.md) · [All operations](https://skmtc.net/meridianlabs-ai/apis/inspect-scout-viewer-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/meridianlabs-ai/inspect-scout-viewer-api/versions/09cc54e3f328/schema)
