Replace patient form schema
Overwrite the clinic's intake questions with a new set.
PATCH /v2/workspaces/patient-formWrites the schema that the read route
returns. Despite the PATCH verb, fields is a replace: the array you send
becomes the clinic's form.
This is a whole-form write
Read the current schema, change what you need, and send the complete fields
array back. Sending only your new question deletes every other one.
Body
| Field | Type | Required | Description |
|---|---|---|---|
fields | array | Yes | The complete set of custom questions. |
standardFieldOverrides | object | No | Built-in field tweaks, keyed by native field id. Omit to leave the stored overrides alone; send {} to clear them. |
standardSectionOverrides | object | No | Built-in sections to hide. Same omit-versus-empty rule. |
standardFieldOrder | object | No | Ordering of built-in fields per section. Same rule. |
A field
| Key | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Stable key. It is what patientFormValues is keyed by, so changing it orphans every existing answer. |
type | string | Yes | One of the supported types. |
label | string | Yes | What the patient reads. |
sortOrder | number | No | Display order. |
required | boolean | No | Enforced on write. |
staffOnly | boolean | No | Hidden from patients. |
sensitive | boolean | No | Stored encrypted. |
placeholder, helperText | string | No | Rendering hints. |
options | string[] | Conditional | Required for DROPDOWN and CHECKBOX_GROUP. |
maxRating | number | Conditional | For RATING. |
allowedMimeTypes, maxSizeBytes | array / number | Conditional | For FILE_UPLOAD. |
precision | string | No | DAY, MONTH or YEAR for DATE. |
body | string | Conditional | The text of a NOTICE. |
showWhen | object | No | Conditional display, keyed on another field's answer. |
removed | boolean | No | Retire a field without destroying the answers already recorded against it. |
Overrides
standardFieldOverrides is keyed by native field id and takes hidden,
label and required. Only the ids in hideableNativeFieldIds and
requirableNativeFieldIds may be tweaked; the rest are fixed.
Try it
/v2/workspaces/patient-formA whole-form replace, not a merge — send every field you want to keep.
Body
PATCH /v2/workspaces/patient-form{
"fields": [
{
"key": "allergies",
"label": "Allergies",
"type": "TEXT",
"required": false
}
]
}https://api.medos.oneUse a dedicated test key, and put your browser's address on its allowlist
A Developer API key authenticates on its own, so it only works from the addresses registered against it — and this page calls from your browser, not your servers. Unless your own public address is on the list you get a 403 naming it, which is the allowlist doing its job. Your browser may also reach us over IPv6 even when your server does not, so the address in the error is often not the one you expected. The key here is kept in memory only and never written to storage, but create a test key for it and deactivate that key when you are done.
Request
curl -sX PATCH "https://api.medos.one/v2/workspaces/patient-form" \
-H "x-api-key: $MEDOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fields": [
{
"id": "occupation",
"type": "TEXT",
"label": "Occupation",
"sortOrder": 1
},
{
"id": "referral_source",
"type": "DROPDOWN",
"label": "How did you hear about us?",
"sortOrder": 2,
"required": true,
"options": ["Search", "Friend", "Doctor referral"]
}
],
"standardFieldOverrides": { "bloodGroup": { "hidden": true } }
}'Response
The saved schema, in the same shape the read route returns — read it back to confirm what was stored.
Common failures
| Status | Cause |
|---|---|
400 | Duplicate ids, a type outside supportedFieldTypes, or a type missing its required extra (options on a DROPDOWN). |
400 | An override on a native field the clinic is not allowed to hide or mandate. |
Retire, do not delete
Dropping a field from fields removes it from the form. Existing answers keep
their key but nothing describes it any more. Set removed: true instead when
the history matters.