Server-side APIEndpointsStaff

Add a staff member

Add a doctor or staff member to your workspace from your own system, with their public profile.

Adds a person to your workspace from your own system. It is meant for hospitals whose doctors never open the Medos app. One call sets a doctor up completely: their details, their role, the locations they work at, and the public profile patients see on your clinic site.

API-key only, gated on devapi_users_create.

Parameters

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

firstNamestringrequiredExample: Asha

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.

emailstringrequiredExample: asha.rao@clinic.example

Their sign-in. Medos emails a one-time link to set a password.

rolestringrequiredExample: DOCTOR

A role in your workspace, by name: DOCTOR, ALLIED_PROFESSIONAL, STAFF or one of your own. Not ADMIN.

addressIdsstringrequiredExample: [1]

The locations they work at, from GET /v1/addresses.

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.

  • They are added, not invited. The member is active at the given locations as soon as the call returns. There is no invitation to accept. Medos emails them a one-time link to set a password, which they need only if they will ever sign in.
  • role is a role's name in your workspace: DOCTOR, ALLIED_PROFESSIONAL, STAFF or a role you created. Case does not matter.
  • ADMIN cannot be granted through the API. Adding an admin stays in the Medos app, so a leaked key cannot hand anyone control of your clinic.
  • addressIds are your own locations, from GET /v1/addresses. Anyone else's is a 400 and nobody is added.
  • profile is published straight away on your clinic's site. It is only for DOCTOR and ALLIED_PROFESSIONAL staff and needs a gender, and a doctor's also needs a registrationNumber. Each of these is checked before anyone is added. Photos and the gallery are uploads, and are added in the Medos app.
  • Seats work as they do for an invitation. A member beyond the seats your plan has paid for is added but locked until a seat is free.

Responses

The 201 body is the member as stored. id is their MDU_… staff id, the one every other route takes: a practitioner's slots, bookings and records name them by it. profile is the profile this call published, or null if you sent none.

If part of the request fails

Adding a member is several steps in Medos. If one fails after the member was added, the error says so and names their id. Send the rest with PUT /v1/staff/{staffId}. Do not add them again: the email already has an account, so a second add is refused.

Test request