Global Search
One endpoint, all models. Searches across every content model that opts in via api_config.searchable.
Endpoint
GET /api/v1/search
Query parameters
| Param | Example | Notes |
|---|---|---|
q | headless cms | Required search term |
models | blog-posts,products | Restrict to specific model slugs |
locale | en | Locale filter |
per_page | 10 | Default 20, capped at 50 |
page | 1 | 1-based |
Example
GET /api/v1/search?q=launch&models=blog-posts,events&per_page=5
X-API-Key: pk_live_…
X-API-Secret: sk_live_…
200 OK
{
"data": [
{
"model": "blog-posts",
"id": "01H…",
"slug": "launch-day",
"title": "Launch day",
"excerpt": "We are live!",
"locale": "en",
"url": "/api/v1/blog-posts/launch-day",
"score": 0.92,
"published_at": "2026-05-29T10:00:00Z"
},
{
"model": "events",
"id": "01H…",
"slug": "launch-meetup",
"title": "Launch meetup",
"excerpt": "Join us in person",
"locale": "en",
"url": "/api/v1/events/launch-meetup",
"score": 0.81,
"published_at": "2026-05-30T18:00:00Z"
}
],
"meta": { "page": 1, "per_page": 5, "total": 12, "query": "launch" },
"error": null
}
How it works
- The search query runs against each model's title field plus any text fields flagged
searchablein the field builder. - Results are ranked by relevance (title match > excerpt > body) and recency (boost for newer entries).
- Only entries with
status = publishedare returned. - Per-model API config can override field visibility, so result objects only include keys the public is allowed to see.
Excluding a model
To remove a model from search, set its api_config.searchable = false in the content model editor. Useful for internal-only models you still want to expose via direct endpoints.
Errors
| Status | Code | When |
|---|---|---|
| 422 | VALIDATION_FAILED | q missing or under 2 chars |
| 404 | MODEL_NOT_FOUND | A slug in models doesn't exist |
PerformanceFor a higher-traffic install, point search at MeiliSearch or Typesense by swapping the controller's resolver — the response envelope is intentionally compatible with both engines' result shapes.