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

# Keyword search

`GET /api/search`

## Request

- Base URL: `https://telawiki.com`
- URL: `https://telawiki.com/api/search`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `tela_session`

Ranked Postgres full-text over titles and bodies, with highlighted snippets. Scoped to what you can read, plus published spaces you cannot — those come back with `public: true` and are rank-demoted. Limit is fixed at 25; there is no space filter on this route (the MCP `search` tool has both).

## Query parameters

- `q` string, required

## Response `200`

Up to 25 ranked hits.

- object
  - `results` SearchHit[], required
    - `page_id` integer, required
    - `space_id` integer, required
    - `title` string, required
    - `snippet` string, required: Contains `<mark>` tags around the matched terms.
    - `breadcrumb` string[], required
    - `public` boolean, required: True when you can read this hit only because the space is published, not because you are a member. Such hits are rank-demoted.
    - `url` string, required
    - `public_path` string: Present only on public hits.
    - `id` string, required: `page_id` as a string. An alias for connector clients that require a string id.
    - `text` string, required: Alias of `snippet`, for the same reason.

## Other responses

- `401`: `unauthorized` — no valid credential. A malformed bearer token never falls back to the session cookie.
- `500`: `internal` — server error.

---

[API](https://skmtc.dev/telawiki/apis/tela-rest-api.md) · [All operations](https://skmtc.dev/telawiki/apis/tela-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/telawiki/apis/tela-rest-api/revisions/f316f31f6fcb?raw)
