Skip to main content
Use this endpoint to update an existing FHIR R4 resource through the passthrough gateway. Supply only the fields you want to change — the server merges your payload with the existing resource. Ownership is verified before the update proceeds; you can only update resources belonging to your tenant. The response is the full updated FHIR resource.

Request

PATCH https://api.clinikapi.com/v1/fhir/:resourceType/:id

Headers

x-api-key
string
required
Your ClinikAPI secret key (clk_live_* or clk_test_*).
Content-Type
string
required
Must be application/fhir+json or application/json.

Path parameters

resourceType
string
required
The FHIR resource type (e.g. Patient, Observation, Condition).
id
string
required
The ID of the FHIR resource to update (e.g. pt_abc123).

Body

A partial FHIR R4 resource object containing only the fields to update. The resourceType and id fields should be included to identify the resource.

Response

Returns 200 OK with the full updated FHIR R4 resource reflecting all changes.
resourceType
string
FHIR resource type.
id
string
Resource ID.
meta.versionId
string
Incremented version ID after the update.
meta.lastUpdated
string
ISO 8601 timestamp of when the resource was last updated.

Examples

curl

curl -X PATCH https://api.clinikapi.com/v1/fhir/Patient/pt_abc123 \
  -H "x-api-key: clk_live_abc123" \
  -H "Content-Type: application/fhir+json" \
  -d '{
    "resourceType": "Patient",
    "id": "pt_abc123",
    "telecom": [{ "system": "phone", "value": "+1-555-0199", "use": "mobile" }]
  }'

TypeScript SDK

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

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

const { data: patient } = await clinik.fhir.request('PATCH', '/Patient/pt_abc123', {
  resourceType: 'Patient',
  id: 'pt_abc123',
  telecom: [{ system: 'phone', value: '+1-555-0199', use: 'mobile' }],
});

console.log(patient.meta.versionId); // incremented version