---
title: "POST /api/public/trainees"
method: POST
path: "/api/public/trainees"
tags: ["Trainees"]
---

# POST /api/public/trainees

`POST /api/public/trainees`

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

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `name` string, required — Trainee full name
  - `email` string, required — Trainee email
  - `phoneNumber` string, required — Trainee phone number
  - `goal` string — Optional coaching goal
  - `passwordAsPhoneNumber` boolean — 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.
  - `labels` string[] — 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 `201`

Created

- object — Created
  - `data` object
    - `id` string
    - `name` string
    - `email` string
    - `phoneNumber` string
    - `goal` string
    - `profileImageUrl` string
    - `personalDetails` object
    - `labels` object[]
      - `id` string
      - `text` string
      - `color` string
      - `coachId` string
    - `assignedEmployees` object[]
      - `id` string
      - `name` string
    - `activeCoachDetails` object
      - `activeEscort` string, nullable — Id of the escort currently in use for this trainee. Fetch the full escort with GET /escorts/{escortId}.
      - `pendingCoach` string, nullable — Coach id this trainee is pending approval for. Set when the trainee was invited but has not been approved yet; null once approved. Use ?status=pending on GET /trainees to list only these.
      - `pendingCoachDate` string, date-time, nullable — When the trainee entered the pending state. Use it to measure how long approval has been waiting.
    - `createdAt` string, date-time
    - `password` string — Login password, returned only in this create response and never retrievable again. Randomly generated, or the normalized phone number when passwordAsPhoneNumber was sent as true. Present only when a brand-new trainee account was created; absent when an existing trainee was attached to the coach. Calling POST /trainees/{traineeId}/send-credentials resets it.
  - `warnings` object[] — Non-fatal problems with follow-up writes. The resource was created, but each listed field was not applied.
    - `field` string
    - `message` string

## Other responses

- `400` — Default Response
- `401` — Default Response
- `403` — Default Response
- `404` — Default Response
- `409` — Default Response
- `429` — Default Response
- `500` — Default Response

---

[API](https://skmtc.dev/coach-platform/apis/coach-platform-api.md) · [All operations](https://skmtc.dev/coach-platform/apis/coach-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/coach-platform/coach-platform-api/revisions/3d18b514ae8c/schema)
