Create a patient
Authorization
BearerAuth AuthorizationBearer <token>
Medblocks API key for server-side requests.
In: header
Header Parameters
Version?string
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/patients" \ -H "Version: 2026-04-25" \ -H "Content-Type: application/json" \ -d '{ "patient_id": "user_42", "email": "jane@example.com", "name": "Jane Doe", "metadata": { "plan": "premium" } }'{ "id": "user_42", "resource_type": "patient", "email": "jane@example.com", "name": "Jane Doe", "metadata": { "plan": "premium" }, "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" }}Non-2xx responses use the standard API error envelope. Log
error.code and error.request_id for support.patient_id*string
Your stable identifier for this patient. Unique within your organization. Reserved prefixes (pat_, pf_, conn_, fhirsrc_) are not permitted.
Length
1 <= length <= 200email?string
Patient email for display and matching in your app.
Format
emailname?string
Patient display name.
Length
length <= 200metadata?
Additional metadata returned with the Patient.
