Skip to main content
Use this endpoint to search for encounters within your tenant. Filter by patient, status, or date range. Use the sort parameter to control ordering, and paginate with count and cursor.

Request

GET https://api.clinikapi.com/v1/encounters

Headers

x-api-key
string
required
Your ClinikAPI secret key (clk_live_* or clk_test_*).

Query Parameters

patientId
string
Filter encounters by patient ID.
status
string
Filter by encounter status (e.g. finished, in-progress).
dateFrom
string
Return encounters starting on or after this date (YYYY-MM-DD).
dateTo
string
Return encounters starting on or before this date (YYYY-MM-DD).
sort
string
Field to sort by. Prefix with - for descending order (e.g. -period.start).
count
integer
Results per page. Default: 20. Maximum: 100.
cursor
string
Pagination cursor from the previous response.

Response

Returns 200 OK with a paginated list of encounters.
data.data
array
Array of encounter objects.
data.total
integer
Total matching encounters across all pages.
data.cursor
string
Cursor for the next page.
data.hasMore
boolean
true if more pages exist.
meta
object
Standard response metadata.

Examples

curl

curl "https://api.clinikapi.com/v1/encounters?patientId=pt_abc123&status=finished&sort=-period.start" \
  -H "x-api-key: clk_live_abc123"

TypeScript SDK

import { ClinikAPI } from "@clinikapi/sdk";

const client = new ClinikAPI({ apiKey: "clk_live_abc123" });

const results = await client.encounters.search({
  patientId: "pt_abc123",
  status: "finished",
  sort: "-period.start",
});

console.log(results.data.total);