/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog
API Reference Search Docs

Search Docs

Search documentation content

GET/v1/projects/{projectId}/searchTry it

Full-text search across all documentation pages in a project.

Headers

NameDescription
X-Audience-Token:stringheader
An audience access token. Pages gated to an audience appear in results only when the token grants it; without one, gated pages are left out. No other credential is needed.

Path Parameters

NameDescription
projectId:stringpathRequired
The project ID, a UUID (for example 3f2b8c1e-6a4d-4e9b-9c7a-1d2e3f4a5b6c). Anything else gets 400 validation_error before any search runs.

Query Parameters

NameDescription
q:stringqueryRequired
Search query string, 1–500 characters.
limit:integerquery
Maximum number of results, 1–100.
Default20
offset:integerquery
Number of results to skip for pagination.
Default0
category:stringquery
Only results of this category: guide, api, sdk, changelog or other.
version:stringquery
Only results from this docs version (1–100 characters).
preview:stringquery
Search a preview build's own index instead of production: the branch part of the preview's hostname — the label before --, up to 255 characters of letters, digits, ., _, / and -. When <branch>--<subdomain> fits in 63 characters this is the branch name, lower-cased with other characters turned into -; for longer branches use the shortened label from the preview URL (it ends in a short code, e.g. …-page-m-e202f7). It only ever selects a preview of the project in the path. When that preview has no index, the result is empty — it never falls back to production. Preview searches aren't counted in search analytics.

Response

Not wrapped in data. Search failures return empty results rather than an error, so a site's search box degrades quietly.

NameDescription
query:string
The query as searched.
hits:array
Matching pages, best first. Hits may also carry other indexed fields; rely on the ones below.
Show 10 child attributesarray
grouped:object
The same hits grouped by category.
processingTimeMs:integer
Search processing time in milliseconds.
estimatedTotalHits:integer
Estimated number of matches.

Errors

StatusCodeWhen
400validation_errorprojectId isn't a UUID, or a query parameter is invalid (for example preview with other characters)
403FORBIDDENThe site is private (password, invite-only or SSO) and the call didn't come through the doc site — message Search from the docs site

Search Syntax

The search query supports:

•
Exact phrases: "api key" — matches exact phrase
•
Excluded terms: -deprecated — exclude results with this term
•
Prefix matching: the last word is matched as a prefix, so auth finds authentication
•
Typo tolerance: small misspellings still match

Index diagnostics

GET/v1/projects/{projectId}/search/debug

Reports the state of this project's search index — document count, settings, and the most recent index updates. Useful when a build reports success but search returns nothing.

Note

This endpoint requires a session JWT and membership of the organization that owns {projectId}. It previously required no credentials; it now reports only on your project's index. If you called it anonymously, add an Authorization header — see Authentication.

GET /v1/projects/{projectId}/search and GET /v1/projects/{projectId}/search/popular remain public, because the rendered documentation site calls them from a visitor's browser. On a private site both answer only through the doc site.

GET/v1/projects/{projectId}/search/popular

What readers search for most, and the searches that found nothing. Public; no credential needed.

Query parameterDefaultRangeDescription
days301–365How far back to look
limit81–20How many top queries and zero-result terms to return
cURL
curl "https://api.syntext.dev/v1/projects/3f2b8c1e-6a4d-4e9b-9c7a-1d2e3f4a5b6c/search/popular?days=7&limit=5"
json
{
"data": {
"topQueries": [{ "query": "api key", "count": "42" }],
"zeroResultTerms": [{ "query": "sso saml", "count": "6" }],
"totalQueries": 318,
"zeroResultQueries": 21
}
}

Each entry's count arrives as a numeric string. A direct call on a private site gets 403 FORBIDDEN.

Search analytics

GET/v1/projects/{projectId}/search/analytics

The same report for the dashboard, with up to 20 entries per list and no data wrapper. Needs a session JWT and membership of the project's organization; ?days= sets the window (default 30).

Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl "https://api.syntext.dev/v1/projects/3f2b8c1e-6a4d-4e9b-9c7a-1d2e3f4a5b6c/search?q=authentication&limit=5"
Responseapplication/json
json
{
"query": "authentication",
"hits": [
{
"id": "3f2b8c1e-6a4d-4e9b-9c7a-1d2e3f4a5b6c_…",
"slug": "api-reference/authentication",
"title": "Authentication",
"section": "Bearer Token",
"content": "All API requests require authentication via API key...",
"category": "api",
"_formatted": {
"title": "Authentication",
"section": "Bearer Token",
"content": "All API requests require <mark>authentication</mark> via API key..."
}
}
],
"grouped": { "api": [ { "id": "3f2b8c1e-6a4d-4e9b-9c7a-1d2e3f4a5b6c_…", "…": "…" } ] },
"processingTimeMs": 8,
"estimatedTotalHits": 12
}
Product
Resources
Company
© 2026 SyntextBuilt with Syntext