Server-side APIEndpointsStaff

Update a staff member

Change a staff member's details, role or public profile from your own system.

Changes a person in your workspace: their details, their role, the public profile patients see on your clinic site, or any mix of the three in one call.

API-key only, gated on devapi_users_update.

Parameters

Path parameters

staffIdstringrequiredExample: MDU_K7Q2XB4NZP91

Their MDU_… staff id, from POST /v1/staff or GET /v1/doctors.

Headers

x-api-keystringrequiredExample: mk_…

Your Developer API key. Server-side only.

X-Acting-User-IdstringExample: MDU_A1B2C3D4E5F6

The staff member the call is attributed to, as an MDU_… id. Omit it to attribute the call to the workspace admin.

Content-TypestringrequiredExample: application/json

The body is JSON. Anything else is a 415.

Body

firstNamestring

Up to 100 characters.

middleNamestring

Up to 100 characters.

lastNamestringExample: Rao

Up to 100 characters.

countryCodestringExample: +91

With phoneNumber: both or neither.

phoneNumberstringExample: 9876543210

4 to 15 digits, without the country code.

gender"MALE" | "FEMALE" | "OTHER"enum

Required to publish a profile.

dateOfBirthstringExample: 1985-04-12

YYYY-MM-DD, not in the future.

rolestringExample: DOCTOR

A role by name, not ADMIN. DOCTOR or ALLIED_PROFESSIONAL is added wherever they work; any other replaces their role at addressIds.

addressIdsstring

With a role other than DOCTOR or ALLIED_PROFESSIONAL: the locations it applies at.

profilestringExample: {"prefix":"Dr.","specialization":"Dermatology","registrationNumber":"KMC-12345"}

The public profile, published on the clinic's site. DOCTOR and ALLIED_PROFESSIONAL only; a doctor's needs registrationNumber.

  • Send only what changes. Anything you leave out stays as it is, and an empty body is a 400.
  • staffId is the MDU_… id from POST /v1/staff or GET /v1/doctors. An id outside your workspace is a 404.
  • email cannot be changed here. Medos changes an email only through a link sent to the new address, in the Medos app.
  • Roles work as they do in the Medos app:
    • DOCTOR or ALLIED_PROFESSIONAL is added wherever they already work, and their other roles stay. addressIds is not used with it.
    • Any other role replaces their role at the addressIds you send, which are then required.
    • ADMIN cannot be granted, and an admin's role cannot be changed through the API.
  • profile is published straight away. They must be a DOCTOR or ALLIED_PROFESSIONAL, already or by this same call's role. If you send no gender, the one already on their record is used.

Responses

The 200 body is the member after the change, in the same shape as POST /v1/staff. profile is the profile this call published, or null.

Several changes, several steps

Details, role and profile are saved in that order, one step each. If a later step fails, the earlier ones stay saved. Correct the request and send the part that failed again.

Test request