Skip to main content
Use this endpoint to modify an existing consent. A common use case is revoking a consent by setting its status to inactive. You can also update verification records after the fact or adjust provision rules when a patient’s preferences change.

Request

PATCH https://api.clinikapi.com/v1/consents/:id

Headers

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

Path parameters

id
string
required
The ID of the consent to update (e.g. consent_abc123).

Body

status
string
Updated consent status. One of: draft, proposed, active, rejected, inactive.
policyUri
string
Updated URI of the policy document.
verification
object
Updated verification details. Replaces the existing verification object.
provision
object
Updated provision rules. Replaces the existing provision object.

Response

Returns 200 OK with the full updated consent resource.
data.id
string
The consent ID.
data.status
string
Updated status value.
data.verification
object
Updated verification details, if changed.
meta
object
Standard response metadata including requestId, timestamp, status, and rate-limit fields.

Examples

curl

curl -X PATCH https://api.clinikapi.com/v1/consents/consent_abc123 \
  -H "x-api-key: clk_live_abc123" \
  -H "Content-Type: application/json" \
  -d '{ "status": "inactive" }'

TypeScript SDK

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

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

// Revoke a consent
const { data } = await clinik.consents.update('consent_abc123', {
  status: 'inactive',
});

// Update verification after signing
await clinik.consents.update('consent_abc123', {
  verification: {
    verified: true,
    verifiedWith: 'pt_abc123',
    verificationDate: new Date().toISOString(),
  },
});

console.log(data.status); // 'inactive'