clinik.fhir namespace gives you direct access to the underlying FHIR R4 API when the simplified resource namespaces don’t cover your use case. You get the full power of FHIR — custom search parameters, chained queries, and FHIR operations like $everything and $validate — while still benefiting from the SDK’s authentication, retry logic, and tenant isolation.
All passthrough requests enforce the same tenant isolation and rate limits as the simplified SDK methods. The ClinikAPI server always injects and filters by your tenant tag, so you cannot accidentally read or write another tenant’s data.
request
HTTP method. Accepted values:
GET, POST, PUT, PATCH, DELETE.FHIR resource path relative to the API root, for example
/Patient or /Observation/obs_abc123. Do not include /v1/ — the SDK prepends it automatically.Request body for
POST, PUT, and PATCH requests. Pass a raw FHIR R4 resource object.The raw FHIR R4 resource or Bundle returned by the server. The generic type parameter
T lets you provide your own type annotation.Examples
When to use the passthrough
Useclinik.fhir.request() when you need:
- Custom FHIR search parameters not exposed in the simplified SDK, such as chained parameters or composite searches.
- FHIR operations —
$everything,$validate,$apply, and other operation framework endpoints. - Resource types not yet simplified by ClinikAPI, such as
HealthcareService,Location, orCareTeam. - Complex FHIR queries with multiple
_include,_revinclude, or_filterparameters.