Get a trainee
GET/api/public/trainees/{traineeId}
Get a single trainee by id.
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.
Path parameters
| Name | Type | Description |
|---|---|---|
traineeIdrequired | string |
Request examples
curl --request GET \
--url 'https://api.coach-platform.com/api/public/trainees/<traineeId>' \
--header 'Authorization: Bearer cp_live_...'const response = await fetch('https://api.coach-platform.com/api/public/trainees/<traineeId>', {
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>"
}
}Response fields (21)
| 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> |
Error responses
400Bad Request401Unauthorized403Forbidden404Not Found409Conflict429Too 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.