Server-side API

Acting user

Name the staff member a call belongs to, with the optional X-Acting-User-Id header.

Every call you send arrives at Medos as somebody. Without X-Acting-User-Id that somebody is the workspace administrator, so a month of patient syncs all reads as one account. Send the header and the call is attributed to the real staff member instead.

X-Acting-User-Id: MDU_A1B2C3D4E5F6

It is optional, everywhere

On every route, read or write, the header is optional. Leave it out and the call is attributed to the workspace admin, exactly as before. It records who did something, not whether they may: you can integrate before you have mapped a single staff member, and add the header later.

Our audit trail still distinguishes "no actor named" from "the admin acted", so leaving it out never makes a call look like genuine admin activity.

The value is a public staff id

MDU_ followed by 12 characters of [A-Z0-9], such as MDU_A1B2C3D4E5F6. Lowercase input is accepted and normalised. This is the same id the API returns everywhere a practitioner appears: id on GET /v1/doctors, and practitioner.id on appointments, visits and prescriptions.

It is not a number. Internal Medos user ids are not part of the API, and the header never accepts one. Nor is it your own system's user id, or an email.

What you sendResult
No headerAttributed to the workspace admin
A valid MDU_… id of an active member of your workspaceAttributed to that person
Anything not shaped MDU_ + 12 of [A-Z0-9], a number included400 INVALID_ACTING_USER
A well-formed id that is not an active member of your workspace403 ACTING_USER_NOT_A_MEMBER

An id from another clinic and an id that does not exist get the same answer, so the header cannot be used to discover who works where.

Mapping your staff to Medos

Keep a stored mapping from each of your users to their MDU_… id. Build it once from GET /v1/doctors, or from the practitioner.id on records you already hold. Keep it with your integration config rather than resolving it per request.

A deactivation can take up to five minutes to bite

Membership is cached briefly. A staff member deactivated in Medos may still be accepted as an actor for a few minutes. Medos still applies its own permission checks in that window, so the delay only affects who a call is recorded against. It does not bypass access control.

Permissions are Medos's, not the gateway's

The gateway checks that the staff member you named is an active member of your workspace. It does not check whether they are allowed to perform the action. That check happens inside Medos, against its own roles, and the fix for a refusal is in that person's Medos role, not in your request.

A role refusal currently looks like a server error

The gateway reads any permission refusal from the Medos core as its own credential being refused, and answers 500 INTERNAL_ERROR rather than a 403. That is right for its intended case, but it means a role refusal for a named staff member surfaces the same way. If a call fails only when you send a particular X-Acting-User-Id, check that person's role, and quote the requestId if you contact support.

On this page