Appearance
Search API
Full-text search across a project's Documents, Content, Components, Files, asset Folders, and Libraries.
Search
Endpoint: POST /api/v1/query
Request Body:
| Field | Type | Notes |
|---|---|---|
query | string | Required, at least 1 character. Matched against title/body/caption, plus a component's handle, a library's slug, and an asset's folder path (whichever the hit type has). |
bash
curl -X POST "https://admin.flatnode.net/api/v1/query" \
-H "Authorization: Bearer your-token-here" \
-H "Content-Type: application/json" \
-d '{"query": "bmx"}'Response: 200 OK
json
{
"message": "OK",
"data": [
{
"_uuid": "770e8400-e29b-41d4-a716-446655440002",
"type": "file",
"title": "bmx_parts.md",
"document": null,
"documentTitle": null,
"library": null,
"libraryTitle": null,
"folder": "880e8400-e29b-41d4-a716-446655440003",
"folderPath": "Press / 2026"
},
{
"_uuid": "990e8400-e29b-41d4-a716-446655440004",
"type": "content",
"title": null,
"document": "550e8400-e29b-41d4-a716-446655440000",
"documentTitle": "Products",
"library": null,
"libraryTitle": null,
"folder": null,
"folderPath": null
},
{
"_uuid": "dd0e8400-e29b-41d4-a716-446655440008",
"type": "library",
"title": "Press Releases",
"document": null,
"documentTitle": null,
"library": null,
"libraryTitle": null,
"folder": null,
"folderPath": null
}
]
}_uuidis the hit's own identifier, ready for a follow-up request to that resource's own endpoint (GET /document/{uuid},GET /component/{uuid},GET /file/{uuid},GET /library/{uuid},GET /content/{uuid}). It is also the key for a results list - there is no other one. Hits used to carry anidsuch asfile-8; that was the index's own key, built on a row id, and it is gone.typeis one ofdocument,content,component,file,file-folder,library.- A
componenthit matches on its title, its schemadescription, and itshandle(see Handles); alibraryhit matches on its title,slug, and declared filterable field names. - A
contenthit has notitleof its own (content is a block of data inside a Document, not a named entity) -document/documentTitleidentify which Document it was found in instead. - A
contenthit that is a library entry additionally carrieslibrary/libraryTitle. Prefer those for display and linking: itsdocument/documentTitlepoint at the library's internal container document, which is not where the entry is edited. A Library's entries are indexed ascontent, not aslibrary- only the Library itself is alibraryhit. - A
filehit carriesfolder/folderPathsaying where the asset is filed (both null at the top level), and afile-folderhit carries its ownfolderPath. Because that path is matched too, searching a folder's name returns the folder and the assets inside it. Afile-folderhit'suuidis forGET /file-folder/{uuid}, and in the admin UI for/backend/{project}/media?folder={uuid}- the media screen opened on that folder. Hits carry identifiers, never built URLs. - Every hit carries every key; the ones that do not apply to its type are null.
- A hit indexed long enough ago can still come back with
_uuid: null; it gets one the next time that item is saved. Skip those rather than treatingnullas an identifier. - Results are scoped to the caller's own project - there is no cross-project search.
- There is no pagination,
limit, oroffset: results are capped at 20 hits. - Indexing is near-real-time, not synchronous: a create/update/delete becomes searchable within about a second of the write, so a search issued immediately after one may not reflect it yet. Writes are batched into a shared commit rather than each forcing its own.
Requires the search.read ability (or the bare read ability).