The search stream lets you read many objects from acre Access Control in one request, with no paging. Use it when you need to:
In the examples, {base} is the regional API address and {folder} is the key of the instance root folder. Every call needs an Authorization: Bearer {token} header.
A normal list call returns one page of objects as one JSON array. You have to wait for the whole page before you can use any of it.
The search stream works differently. It sends one object per line and sends each line as soon as it has read it from the database. Your code reads a line, handles that object, and moves on to the next. Neither side has to hold the whole result in memory, and you get the first object long before the server finds the last one.
Each line is a full object, in the same JSON shape you get from a single-object GET. It includes a $type field that tells you the exact type, for example Feenics.Keep.WebApi.Model.PersonInfo, Feenics.Keep.WebApi.Model.
One thing to watch: the response says Content-Type: application/json, but the body is not a JSON array. It is one JSON object per line. Parse each line by itself.
| Endpoint | Method | Where the query goes |
|---|---|---|
{base}/api/f/{folder}/searchstream |
GET |
q query-string parameter |
{base}/api/f/{folder}/searchstream2 |
POST |
request body, as a JSON string |
Both endpoints do the same thing and take the same options. The only difference is where you put the query. searchstream2 exists because a MongoDB filter can be long and full of characters that do not fit well in a URL. Use searchstream2 unless you have a reason not to. The wrapper’s SearchStream class uses it.
The POST body is the query as a JSON string. That means the whole query is wrapped in double quotes, and every quote inside it is escaped with a backslash:
"{ \"_t\": \"Person\", \"Surname\": \"Example\" }"
A query has two parts: an optional type prefix, then the search text.
[type:<TypeName> ]<search>
type:Person, type:Reader, type:AccessLevel, and so on) limits the search to one object type. Leave it out to search every type.| First character | Form | Matches |
|---|---|---|
{ |
MongoDB filter | Any field, any operator. The full filter language. |
/ |
Regular expression | CommonName only. |
| anything else | Text search | The collection’s text index (names and similar fields). |
You can use the prefix and a MongoDB filter together. But a filter can also say "_t": "Person" itself, which does the same job. So when you use a filter, the prefix is optional.
All options go in the query string. They work the same on both endpoints.
| Option | Default | Meaning |
|---|---|---|
includeChildFolders |
false |
Also return objects from folders below {folder}. Set this to true to search the whole instance. |
spanScope |
false |
Include objects shared from other scopes. |
forTags |
— | Repeat once per tag. Only objects that carry all listed tags. |
limit |
none | Stop after this many objects. |
page, pageSize |
none | Optional. Leave them out to get everything in one response. Set both to get one page at a time, sorted by _id. This is useful if you want to restart a long read from a known point. |
hints |
— | Index hints. Not normally needed. |
Each example shows the POST body for searchstream2. Some also show the full curl call. Replace {token}, {base} and {folder} with your own values.
Body:
"{ \"_t\": \"Person\" }"
curl -N -X POST "{base}/api/f/{folder}/searchstream2?includeChildFolders=true" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '"{ \"_t\": \"Person\" }"'
-N tells curl not to buffer output, so you see each line as it arrives. This is the call to use for a full resync.
Body:
"{ \"_t\": \"Person\", \"_id\": { \"$in\": [ { \"$oid\": \"68a1…\" }, { \"$oid\": \"6899…\" } ] } }"
curl -N -X POST "{base}/api/f/{folder}/searchstream2?includeChildFolders=true" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '"{ \"_t\": \"Person\", \"_id\": { \"$in\": [ { \"$oid\": \"68a1…\" }, { \"$oid\": \"6899…\" } ] } }"'
Use this to re-read a set of people, for example the ones that Change Tracking said have changed. If a key you asked for does not come back, that person was either deleted or is no longer visible to your user.
Body:
"{ \"_t\": \"Person\", \"Surname\": { \"$regex\": \"^Ex\", \"$options\": \"i\" } }"
There is more than one type of reader. To get them all, match several type names with $in:
Body:
"{ \"_t\": { \"$in\": [ \"Reader\", \"MercuryReader\" ] } }"
The type: prefix only takes one type name. When you need more than one, use a filter like this instead.
Body:
"type:Person /^Jane/"
The regular expression is matched against CommonName only.
Body:
"type:Person jane example"
This uses the text index. It is a good fit for a search box, but it is less exact than a filter.
A card is active when three things are true: ActiveOn is in the past, ExpiresOn is in the future, and IsDisabled is false. $elemMatch makes sure all three are checked against the same card:
Body:
"{ \"_t\": \"Person\", \"CardAssignments\": { \"$elemMatch\": { \"ActiveOn\": { \"$lte\": { \"$date\": \"2026-11-19T00:00:00Z\" } }, \"ExpiresOn\": { \"$gt\": { \"$date\": \"2026-11-19T00:00:00Z\" } }, \"IsDisabled\": false } } }"
Replace both dates with the current time.
A Person’s access levels are stored as links in ObjectLinks, each with Relation set to AccessLevel:
Body:
"{ \"_t\": \"Person\", \"ObjectLinks.Relation\": \"AccessLevel\" }"
To find people in one particular access level, add its key:
"{ \"_t\": \"Person\", \"ObjectLinks\": { \"$elemMatch\": { \"Relation\": \"AccessLevel\", \"LinkedObjectId\": { \"$oid\": \"{accessLevelKey}\" } } } }"
curl -N -X POST "{base}/api/f/{folder}/searchstream2?includeChildFolders=true&forTags=contractor&forTags=site-a" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '"{ \"_t\": \"Person\" }"'
This returns people that have both tags, not either one.
searchstream (GET)curl -N -G "{base}/api/f/{folder}/searchstream" \
-H "Authorization: Bearer {token}" \
--data-urlencode 'q={ "_t": "Person", "Surname": "Example" }' \
--data-urlencode 'includeChildFolders=true'
-G together with --data-urlencode puts q in the query string and encodes it correctly for you.
In the .NET wrapper, you create the stream once and then read it in a loop. (See Data Streams for the full wrapper guide, which also covers EventsStream and AggregateStream.)
using var stream = await SearchStream.Create(client, folder, "{ '_t': 'Person' }", includeChildFolders: true);
while (await stream.ReadAsync())
{
var person = stream.BaseInfo as PersonInfo;
// process one object
}
Create calls searchstream2 for you. BaseInfo is null until the first ReadAsync returns. You can use single quotes inside the filter string; the wrapper accepts relaxed JSON.
$type field (or the _t array, if you asked for it) to decide which model to map it to.page and pageSize, or make the filter narrower. Results are only sorted by _id when you supply page and pageSize._id values as { "$oid": "…" } and dates as { "$date": "2026-11-19T00:00:00Z" }.{…} is a filter, /…/ is a name pattern, and anything else is treated as free text.search endpoint. Use search when the result is small and known (for example, one object by key). Use the stream when the result might be large.SearchStream, EventsStream and AggregateStream