Server-side APIEndpointsClinical records

Amend a prescription

Change an existing prescription. No patientId needed — it already has one.

PATCH /v1/prescriptions/{id}

Answers 200. No patientId needed — the prescription already has one. doctorId is still required, and is still the practitioner rather than the person typing.

API-key only (a widget session is refused), entitlement-gated on devapi_prescriptions_update, and attributed with X-Acting-User-Id.

Path parameters

NameRequiredDescription
idYes—

Query parameters

NameRequiredDescription
doctorIdYesA query parameter, not a body field — and a different person from the acting user: the practitioner it is issued under.

Body

NameRequiredDescription
medicinesNo—
notesNo—

Try it

PATCH/v1/prescriptions/:idAPI key onlydevapi_prescriptions_update

Path

Query

Body

Request
PATCH /v1/prescriptions/?doctorId=4
{
  "medicines": [
    {
      "name": "Amoxicillin 500mg",
      "frequency": "TID",
      "durationDays": 5
    }
  ]
}
to https://api.medos.one
Use 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 -s -X PATCH "https://api.medos.one/v1/prescriptions/88?doctorId=4" \
  -H "x-api-key: $MEDOS_API_KEY" \
  -H "X-Acting-User-Id: 4821" \
  -H "Content-Type: application/json" \
  -d '{
        "medicines": [
          {
            "name": "Amoxicillin 500mg",
            "frequency": "TID",
            "durationDays": 5
          }
        ]
      }'

Common failures

StatusCause
400 naming x-acting-user-idA write without the acting-user header.
403 with requiredFeatureNot entitled to this operation.
403 "only available to Developer API keys"A widget session token was used. Send x-api-key.
403 "not an active member"The acting user is not in your workspace, or is deactivated.
a medos permission errorThe acting user's role does not allow this. Not a gateway failure.

On this page