Skip to main content
Use this endpoint to search across consent records. Filter by patient to retrieve all consents for a specific individual, or filter by status to find active consents across your patient population. Results are paginated using an opaque cursor.

Request

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

Headers

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

Query parameters

patientId
string
Filter consents to a specific patient (e.g. pt_abc123).
status
string
Filter by consent status. One of: draft, proposed, active, rejected, inactive.
dateFrom
string
Return only consents dated on or after this date (YYYY-MM-DD).
dateTo
string
Return only consents dated on or before this date (YYYY-MM-DD).
count
number
Number of results per page. Maximum: 100. Defaults to 20.
cursor
string
Opaque pagination cursor from the previous response. Omit to start from the beginning.

Response

Returns 200 OK with a paginated list of consent resources.
data
array
Array of consent objects matching the search filters.
data[].id
string
Consent ID.
data[].patientId
string
Patient reference.
data[].scope
string
Consent scope.
data[].status
string
Consent status.
meta
object
Standard response metadata including requestId, timestamp, status, and rate-limit fields.
meta.nextCursor
string
Cursor for the next page. Absent when there are no more results.

Examples

curl

curl "https://api.clinikapi.com/v1/consents?patientId=pt_abc123&status=active" \
  -H "x-api-key: clk_live_abc123"

TypeScript SDK

import { Clinik } from '@clinikapi/sdk';

const clinik = new Clinik(process.env.CLINIKAPI_SECRET_KEY!);

const { data, meta } = await clinik.consents.search({
  patientId: 'pt_abc123',
  status: 'active',
});

console.log(data.length);
console.log(meta.nextCursor);