List trainees
GET/api/public/trainees
List trainees of the coach, filterable by label/search.
Authentication
Requires an API key, sent as Authorization: Bearer cp_live_....
API keys carry scopes. Get the catalog of scopes and webhook events lists every scope.
Query parameters
| Name | Type | Description |
|---|---|---|
page | string | Page number (1-based, default 1) |
limit | string | Items per page (1-500, default 25) |
search | string | Search by name, email, or phone |
labelId | string | Filter to trainees with this label |
email | string | Match by email (case insensitive) |
phone | string | Match by phone number |
status | string | Filter by coaching status. "active" = has an active coaching period. "pending" = invited but not yet approved by the coach; these trainees are not returned by the other filters, and their activeCoachDetails.pendingCoachDate tells you how long they have been waiting. "archived" = removed with |
Request examples
curl --request GET \
--url 'https://api.coach-platform.com/api/public/trainees' \
--header 'Authorization: Bearer cp_live_...'const response = await fetch('https://api.coach-platform.com/api/public/trainees', {
method: 'GET',
headers: {
Authorization: 'Bearer cp_live_...',
},
});
const data = await response.json();Responses
200 OK
Successful response
{
"data": [
{
"id": "<string>",
"name": "<string>",
"email": "<string>",
"phoneNumber": "<string>",
"goal": "<string>",
"profileImageUrl": "<string>",
"personalDetails": {},
"labels": [
{
"id": "<string>",
"text": "<string>",
"color": "<string>",
"coachId": "<string>"
}
],
"assignedEmployees": [
{
"id": "<string>",
"name": "<string>"
}
],
"activeCoachDetails": {
"activeEscort": "<string>",
"pendingCoach": "<string>",
"pendingCoachDate": "<date-time>"
},
"createdAt": "<date-time>"
}
],
"pagination": {
"page": 123,
"limit": 123,
"total": 123,
"hasMore": true,
"truncated": true
}
}Response fields (27)
| Name | Type | Description |
|---|---|---|
data | object[] | |
data[].id | string | |
data[].name | string | |
data[].email | string | |
data[].phoneNumber | string | |
data[].goal | string | |
data[].profileImageUrl | string | |
data[].personalDetails | object | |
data[].labels | object[] | |
data[].labels[].id | string | |
data[].labels[].text | string | |
data[].labels[].color | string | |
data[].labels[].coachId | string | |
data[].assignedEmployees | object[] | |
data[].assignedEmployees[].id | string | |
data[].assignedEmployees[].name | string | |
data[].activeCoachDetails | object | |
data[].activeCoachDetails.activeEscort | string | null | Id of the escort currently in use for this trainee. Fetch the full escort with |
data[].activeCoachDetails.pendingCoach | string | null | 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 |
data[].activeCoachDetails.pendingCoachDate | string<date-time> | null | When the trainee entered the pending state. Use it to measure how long approval has been waiting. |
data[].createdAt | string<date-time> | |
pagination | object | |
pagination.page | number | |
pagination.limit | number | |
pagination.total | number | null | Total number of matching items. null when the underlying source cannot report an exact count for this page; use hasMore to keep paging. |
pagination.hasMore | boolean | |
pagination.truncated | boolean | Present and true when the result set exceeded the in-memory scan cap and was truncated. Narrow your filters to page through all items. |
Error responses
400Bad Request401Unauthorized403Forbidden429Too Many Requests500Internal Server Error
These statuses share the same response body.
{
"error": {
"code": "<string>",
"message": "<string>",
"fix": "<string>",
"details": {},
"retryAfterMs": 123
}
}Error fields (6)
| Name | Type | Description |
|---|---|---|
error | object | |
error.code | string | |
error.message | string | |
error.fix | string | null | |
error.details | object | null | |
error.retryAfterMs | number | null |
More Trainees endpoints
This page is also available as Markdown. Browse it in the interactive explorer or download the OpenAPI spec.