Search
Auth: API key. Scope: search:read
Base path: /v1/search
Search finds patients, pathways, and practitioners with the same filters as the product search bar: a resource type plus tag filters (with / without). All filtering happens on the server, and results are limited to the API key’s workspace.
Search
Section titled “Search”POST /v1/search
curl -X POST "https://api-staging.medflow.care/v1/search" \
-H "Authorization: Bearer $MEDFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"resourceType": "Patient",
"filters": [
{ "op": "with", "tag": "active-patient" },
{ "op": "without", "tag": "cognitive-screen-completed" }
],
"limit": 100,
"offset": 0,
"order": "name",
"orderDirection": "asc"
}'| Field | Required | Description |
|---|---|---|
resourceType | Yes | Patient, Pathway, or Practitioner |
filters | No | Tag filters. op is with or without. tag is a slug from the Tags library |
limit | No | Max hits (default 100, max 500) |
offset | No | Offset for paging |
order | No | Sort field (default name) |
orderDirection | No | asc or desc |
Pathway filters may also target automation status tags (for example completed, running) when those tags are defined on pathways.
Response 200
{
"total": <integer>,
"limit": <integer>,
"offset": <integer>,
"results": [
{
"id": "<uuid>",
"extId": "<string>",
"name": "<string>",
"resourceType": "Patient | Pathway | Practitioner",
"tags": ["<string>"]
}
]
}Hits return id, extId, name, resourceType, and tags for use in run payloads.
The call is audited as search.execute whenever results can include PHI.
Count only
Section titled “Count only”POST /v1/search/count
This takes the same body as search, though you do not need a large limit, and returns a JSON object with a total count (for example 128). It is a quick way to size a match set before you attach a query to a trigger.