Disconnect a connection

Revoke your organization's access to one of the patient's connections by its conn_ id. The patient's link to the source EHR is removed for your organization; stored tokens are revoked when no other workspace still uses them. Returns a tombstone confirming the disconnect.

DELETE
/patients/{id}/connections/{connection_id}

Authorization

BearerAuth
AuthorizationBearer <token>

Medblocks API key for server-side requests.

In: header

Path Parameters

id*string

Your patient_id from Patient creation or Session upsert.

connection_id*string

The conn_ connection id from the patient's connections[].

Header Parameters

Version?string

Date-pinned API version. If omitted, Medblocks uses the version pinned on your API key.

Response Body

application/json

application/json

curl -X DELETE "https://example.com/patients/string/connections/string" \  -H "Version: 2026-04-25"
{  "id": "conn_01J9YR9N3X4VZ6P2K5RH7M3LMP",  "resource_type": "connection",  "disconnected": true}
{  "error": {    "type": "authentication_error",    "code": "invalid_api_key",    "message": "API key invalid",    "param": null,    "doc_url": "https://docs.medblocks.com/errors/invalid_api_key",    "request_id": "9c9b6f7a-8e4f-4a3b-9c1e-6f3a2d8b7c4d"  }}
Non-2xx responses use the standard API error envelope. Log error.code and error.request_id for support.