Trainees

Create a new trainee for the coach. Requires name, email, and phoneNumber.

post/api/public/trainees

Headers

Idempotency-Keystring

Optional. Send a unique key (e.g. a UUID) to make this POST safe to retry. The same key within 24h returns the original result instead of creating a duplicate.

Request body

namestring required

Trainee full name

emailstring required

Trainee email

phoneNumberstring required

Trainee phone number

goalstring

Optional coaching goal

passwordAsPhoneNumberboolean

Set the trainee login password to their phone number instead of a random one. Israeli numbers are normalized to their local 0-prefixed form, so "+972501234567", "972-50-123-4567" and "050 123 4567" all become the password "0501234567", and the trainee can log in by typing any of those forms. Numbers from every other country are supported too and keep their international form, so "+1 415 555 2671" becomes "+14155552671"; a trainee with a non-Israeli number must include the country code when logging in, because the national form ("415-555-2671") cannot be mapped back. Send a clean number: any extra digits, such as an extension, become part of the password. The resulting password is always returned in the password field of this response and is not retrievable afterwards. Changing the phone number later with PATCH /trainees/{traineeId} does not change the password. Rejected with 400 only when phoneNumber has no digits at all, or fewer than 6 digits; error.details.reason says which. If the email belongs to an existing trainee account that is merely attached to the coach, that account keeps its current password and a warning is returned.

labelsstring[]

Optional ids of existing labels to attach. Each item must be the label id (24-character MongoDB ObjectId) as returned in the id field of GET /labels — not the label text. Label text is not accepted here and no new label is created; to attach a label by text, or to create one, use POST /trainees/{traineeId}/labels instead. Requires the labels:write scope: without it the trainee is still created and a warning is returned in the warnings array.

Response

Created

Changes

No recorded changes to this endpoint across all 1 revision of this API.