---
title: "Semantic search over indexed chunks"
method: GET
path: "/api/rag/search"
tags: ["search"]
---

# Semantic search over indexed chunks

`GET /api/rag/search`

## Request

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

Retrieval by meaning across page sections and extracted file text. Requires an embedder to be configured on the instance; without one every call is `503 rag_disabled`. Rate-limited per account.

## Query parameters

- `q` string, required
- `space_id` integer
- `limit` integer
- `mode` 'hybrid' | 'semantic' | 'lexical'

## Response `200`

Ranked chunks.

- object
  - `results` Chunk[], required
    - `chunk_id` integer, required: Pass to `/api/rag/chunk` to read the section in full.
    - `source_kind` 'page' | 'file', required
    - `page_id` integer, required: For a file chunk, the parent page — `0` when the file sits at the space root.
    - `space_id` integer, required
    - `title` string, required: Page title, or the file name for a file chunk.
    - `heading_path` string, required: Where in the document this chunk sits, e.g. `Deployment > Rollback`.
    - `snippet` string, required
    - `score` number, required
    - `updated_at` string, required
    - `file_id` integer: File chunks only.
    - `file_name` string: File chunks only.
    - `download_url` string: File chunks only.
    - `share_url` string: File chunks only.

## Other responses

- `400`: Malformed request. `code` is usually `bad_request` or `invalid_json`.
- `429`: `rate_limited` — retry after the interval in the `Retry-After` header.
- `500`: `internal` — server error.
- `503`: `rag_disabled` — semantic retrieval is not configured on this instance.

---

[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)
