Initialize a Connect PatientFlow
Authorization
BearerAuth Medblocks API key for server-side requests.
In: header
Header Parameters
Date-pinned API version. If omitted, Medblocks uses the version pinned on your API key.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://example.com/patient-flows" \ -H "Version: 2026-04-25" \ -H "Content-Type: application/json" \ -d '{ "patient_id": "user_42", "patient_email": "jane@example.com", "patient_name": "Jane Doe", "recommended_connection_ids": [ "fhirsrc_02Zh2bnvRoWQJYgOAkI0Twcc", "fhirsrc_0a9Ea55aR4u7HaWMyFBN8wcc", "fhirsrc_lcvXRHLSSI2WK9Prrt5Qggcc" ], "return_url": "https://app.example.com/connected", "return_button_label": "Acme Health", "expires_in": 1800, "metadata": { "signup_source": "checkout" } }'{ "id": "pf_01J9YQ8M2X4VZ6P2K5RH7M3KQT", "resource_type": "patient_flow", "status": "open", "url": "https://app.medblocks.com/c/9c9b6f7a8e4f4a3b9c1e6f3a2d8b7c4d", "patient_id": "user_42", "connection_id": null, "recommended_connection_ids": [ "fhirsrc_02Zh2bnvRoWQJYgOAkI0Twcc", "fhirsrc_0a9Ea55aR4u7HaWMyFBN8wcc", "fhirsrc_lcvXRHLSSI2WK9Prrt5Qggcc" ], "return_url": "https://app.example.com/connected", "return_button_label": "Acme Health", "connections": [], "expires_at": "2026-04-25T15:00:00.000Z", "metadata": { "signup_source": "checkout" }, "created_at": "2026-04-25T14:30:00.000Z"}{ "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" }}error.code and error.request_id for support.Your stable identifier for this patient. Reserved prefixes (pat_, pf_, conn_, fhirsrc_) are not permitted.
1 <= lengthPatient email to store or update.
emailPatient display name to store or update.
Source ID from /connections. Used for Direct Mode. Mutually exclusive with recommended_connection_ids.
1 <= lengthSource IDs to show first in the hosted picker. Mutually exclusive with connection_id.
URL to redirect after the Connect flow.
uriText shown on the patient-facing completion button.
1 <= length <= 60Seconds until the patient_flow token expires. Default 1800 (30 min). Max 86400 (24h).
60 <= value <= 86400Additional metadata returned with the Session.
