For the complete documentation index, see llms.txt. This page is also available as Markdown.

/api/v1/search

Run searches over the indexed objects, or over a different domain selected by the request type (pool, collection, event, message, user, group or acl). POST /search takes a SearchRequest body; GET /search takes the same request as a JSON string in the BODY query parameter so the call can be cached. Both return a SearchResponse with the total count and the requested page of objects, restricted to what the requesting user may read.

Differs from easydb 5: the searchable domains are pool, collection, event, message, user, group and acl (plus the default object search). easydb 5 has no event domain, and fylr has no pool_management domain (easydb 5 documents pool_management to search pools with bag_write).

From version 6.34.0, every element of the search array accepts a boost parameter (number, default 1), with the semantics known from easydb 5: a higher boost gives objects matching that element a higher _score. Combine bool: should elements with different boosts and sort by _score to rank preferred matches first.

GET /search — Search for objects (cacheable).

get

Same as POST /search, but the SearchRequest is passed as a JSON string in the BODY query parameter instead of in the request body. This makes the request a plain GET that clients and intermediate proxies can cache.

Caching stays an explicit opt-in: without cache_seconds the response carries the default Cache-Control: no-store, no-cache. Pass cache_seconds to let fylr answer with Cache-Control: max-age=<cache_seconds>, public instead.

Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Query parameters
BODYstringRequired

The SearchRequest, encoded as a JSON string. The content is the same as the request body of POST /search.

cache_secondsintegerOptional

When greater than 0, fylr replaces the default Cache-Control: no-store, no-cache response header with Cache-Control: max-age=<cache_seconds>, public, so the result can be cached for that many seconds. The parameter works on any GET endpoint, not just /search.

Header parameters
x-fylr-authorizationstringOptional

The access token in form of Bearer <token>. You can also use authorization which does the same. authorization is looked at first.

authorizationstringOptional

The access token in form of Bearer <token>.

Responses
200

The search ran successfully. The response contains the page of matching objects and the total result count.

application/json

The result of a search.

typestringOptional

The search domain, echoed from the request.

objecttypesstring[]Optional

The object types that were searched.

languagestringOptional

Primary language of the result.

countinteger · int64Required

Total number of objects matching the search.

offsetintegerRequired

Offset of the returned page within the full result.

limitintegerRequired

Maximum number of objects in the returned page.

formatstringOptional

Render format of the objects in the response.

merge_linked_objectsstringOptional

The merge_linked_objects mode applied, echoed from the request.

merge_max_depthintegerOptional

The merge_max_depth applied, echoed from the request.

POST /search — Search for objects.

Search for objects.

post

Run a search and return the matching objects.

The request body is a SearchRequest. Its search property holds a list of search elements that are combined into a single boolean query. Each element has a type — one of text, in, range, changelog_range, complex, nested, geo_bounding_box or geo_shape (match is a legacy alias of text) — and a bool that decides whether it must, should or must_not match. Elements of type complex and nested group further elements, so arbitrarily nested queries can be expressed.

By default the search runs over the indexed objects. Set type on the request to search a different domain instead: pool, collection, event, message, user, group or acl.

Only objects the requesting user is allowed to read are returned. The response reports the total count together with the objects of the requested page and any requested aggregations.

Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Header parameters
x-fylr-authorizationstringOptional

The access token in form of Bearer <token>. You can also use authorization which does the same. authorization is looked at first.

authorizationstringOptional

The access token in form of Bearer <token>.

Body

Describes a search to run against fylr. The search property holds the query; the remaining properties control paging, sorting, the response format and aggregations.

typestring · enumOptional

Domain to search. Omit (or use an empty string) to search indexed objects. Each other domain has its own object shape in the response.

Possible values:
objecttypesstring[]Optional

Restrict the search to these object types. When empty, all object types are searched.

offsetintegerOptional

Number of hits to skip before the first returned object.

limitintegerOptional

Maximum number of objects to return.

formatstringOptional

Render format for the objects in the response, for example standard or long.

merge_linked_objectsstring · enumOptional

Controls whether linked objects are embedded into the hits.

Possible values:
merge_max_depthintegerOptional

Maximum depth up to which linked objects are embedded when merge_linked_objects is used.

languagesstring[]Optional

Languages to load for localized fields.

include_deletedbooleanOptional

If true, objects in the trash are included in the result.

fieldstringOptional

Field name used when this request is a sub search.

include_fieldsstring[]Optional

If set, only these fields are included in the returned objects.

exclude_fieldsstring[]Optional

Fields to omit from the returned objects.

file_url_expireintegerOptional

Number of days the signed file URLs in the response stay valid.

timezonestringOptional

Timezone used when interpreting and bucketing dates.

generate_rightsbooleanOptional

If true, the effective rights are generated for each hit.

best_mask_filterbooleanOptional

If true, each object is reduced to the best mask the user may see.

Responses
200

The search ran successfully. The response contains the page of matching objects and the total result count.

application/json

The result of a search.

typestringOptional

The search domain, echoed from the request.

objecttypesstring[]Optional

The object types that were searched.

languagestringOptional

Primary language of the result.

countinteger · int64Required

Total number of objects matching the search.

offsetintegerRequired

Offset of the returned page within the full result.

limitintegerRequired

Maximum number of objects in the returned page.

formatstringOptional

Render format of the objects in the response.

merge_linked_objectsstringOptional

The merge_linked_objects mode applied, echoed from the request.

merge_max_depthintegerOptional

The merge_max_depth applied, echoed from the request.

GET /search/parse — Parse a query string into a search request.

Parse a query string into a search request.

get

Same as POST /search/parse, but the parse options are passed as query parameters instead of in a request body.

Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Query parameters
querystringRequired

The query string to parse.

objecttypesstring[]Optional

Restrict the search to these object types. Repeat the parameter for more than one object type.

searchbooleanOptional

If true, run the parsed search and return its result instead of the parsed SearchRequest.

limitintegerOptional

Maximum number of objects to return.

offsetintegerOptional

Number of objects to skip before the first returned object.

formatstringOptional

Render format for the objects in the result.

timezonestringOptional

Timezone used when interpreting dates in the query string.

Header parameters
x-fylr-authorizationstringOptional

The access token in form of Bearer <token>. You can also use authorization which does the same. authorization is looked at first.

authorizationstringOptional

The access token in form of Bearer <token>.

Responses
200

The query string was parsed. The response is the parsed SearchRequest when search is false, or the search result when search is true.

application/json
or

POST /search/parse — Parse a query string into a search request.

Parse a query string into a search request.

post

Parse a query string written in fylr's search query language into the SearchRequest structure that /search expects.

With search set to false (the default) the parsed SearchRequest is returned, so a client can inspect or adjust it before searching. With search set to true the parsed request is executed right away and the search result is returned instead.

Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Header parameters
x-fylr-authorizationstringOptional

The access token in form of Bearer <token>. You can also use authorization which does the same. authorization is looked at first.

authorizationstringOptional

The access token in form of Bearer <token>.

Body

Options for parsing a query string at /search/parse.

querystringRequired

The query string to parse.

objecttypesstring[]Optional

Restrict the search to these object types.

searchbooleanOptional

If true, run the parsed search and return its result instead of the parsed SearchRequest.

limitintegerOptional

Maximum number of objects to return.

offsetintegerOptional

Number of objects to skip before the first returned object.

formatstringOptional

Render format for the objects in the result.

timezonestringOptional

Timezone used when interpreting dates in the query string.

Responses
200

The query string was parsed. The response is the parsed SearchRequest when search is false, or the search result when search is true.

application/json
or

DELETE /search/point_in_time — Close point-in-time search contexts.

Close point-in-time search contexts.

delete

Close one or more point-in-time (PIT) search contexts. A PIT is opened by a search that sets point_in_time and is used to keep a stable view of the index across paginated requests. Closing a PIT frees the resources it holds in the search backend; PITs that are not closed expire on their own after their keep_alive.

Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Header parameters
x-fylr-authorizationstringOptional

The access token in form of Bearer <token>. You can also use authorization which does the same. authorization is looked at first.

authorizationstringOptional

The access token in form of Bearer <token>.

Body
pit_idstring[]Required

IDs of the point-in-time contexts to close.

Responses
200

The point-in-time contexts were closed.

application/json

Last updated