---
title: "Unified Search"
method: GET
path: "/api/search"
tags: ["search"]
---

# Unified Search

`GET /api/search`

## Request

- Base URL: `https://app.ctlsurf.com` (the document declares no server; this is the origin it was published from)
- URL: `https://app.ctlsurf.com/api/search`
- Auth: HTTP bearer

Unified search across pages (by title/root_path) and blocks (by title/content).

Returns both page matches and block matches, ranked by relevance.
Uses PostgreSQL full-text search with trigram fuzzy matching fallback.

## Query parameters

- `q` string, required: Search query
- `limit` integer: Max results per category
- `offset` integer: Pagination offset

## Response `200`

Successful Response

- UnifiedSearchResponse: Combined search results from pages and blocks.
  - `query` string, required
  - `pages` UnifiedPageResult[], required
    - `result_type` 'page'
    - `page_id` string, uuid, required
    - `page_title` string, required
    - `root_path` string, nullable
    - `folder_id` string, uuid, nullable
    - `rank` number, required
    - `match_type` string, required
  - `blocks` UnifiedBlockResult[], required
    - `result_type` 'block'
    - `block_id` string, uuid, required
    - `page_id` string, uuid, required
    - `page_title` string, nullable, required
    - `block_title` string, nullable, required
    - `block_type` 'text' | 'checklist' | 'table' | 'react_flow' | 'agent_control' | 'tree' | 'ctlsurf_task' | 'page_summary' | 'file' | 'mindmap' | 'datastore' | 'state' | 'log' | 'presentation', required
    - `snippet` string, required
    - `match_start` integer, required
    - `match_end` integer, required
    - `size_bytes` integer, required
    - `content_type` string, required
    - `rank` number, required
  - `total_pages` integer, required
  - `total_blocks` integer, required
  - `limit` integer, required
  - `offset` integer, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/ctlsurf/apis/notebook-control-plane.md) · [All operations](https://skmtc.dev/ctlsurf/apis/notebook-control-plane/llms.txt) · [OpenAPI document](https://skmtc.dev/ctlsurf/apis/notebook-control-plane/revisions/ddfbbe20d5ce?raw)
