Get a coaching period
GET/api/public/escorts/{escortId}
Get a coaching period 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 |
|---|---|---|
escortIdrequired | string |
Request examples
curl --request GET \
--url 'https://api.coach-platform.com/api/public/escorts/<escortId>' \
--header 'Authorization: Bearer cp_live_...'const response = await fetch('https://api.coach-platform.com/api/public/escorts/<escortId>', {
method: 'GET',
headers: {
Authorization: 'Bearer cp_live_...',
},
});
const data = await response.json();Responses
200 OK
Successful response
{
"data": {
"id": "<string>",
"coach": "<string>",
"trainee": {
"id": "<string>",
"name": "<string>",
"email": "<string>",
"phoneNumber": "<string>"
},
"status": "pending",
"escortType": "<string>",
"startDate": "<date-time>",
"endDate": "<date-time>",
"months": 123,
"isUnlimited": true,
"training": {
"activeTrainingPlan": {
"id": "<string>",
"title": "<string>",
"level": "<string>"
},
"trainingDays": null
},
"nutrition": {
"activeNutritionPlan": {
"id": "<string>",
"title": "<string>",
"level": "<string>"
}
},
"skipRegistrationForms": true,
"createdAt": "<date-time>"
}
}Response fields (27)
| Name | Type | Description |
|---|---|---|
data | object | |
data.id | string | |
data.coach | string | |
data.trainee | object | The escorted trainee. email and phoneNumber are returned only when the key also has the trainees:read scope. |
data.trainee.id | string | |
data.trainee.name | string | |
data.trainee.email | string | |
data.trainee.phoneNumber | string | |
data.status | string | |
data.escortType | string | |
data.startDate | string<date-time> | |
data.endDate | string<date-time> | null | When the coaching period ends. null when the escort runs with no time limit, in which case isUnlimited is true. |
data.months | integer | null | Duration in months. null when the escort runs with no time limit. |
data.isUnlimited | boolean | True when the escort has no end date. |
data.training | object | |
data.training.activeTrainingPlan | object | null | |
data.training.activeTrainingPlan.id | string | |
data.training.activeTrainingPlan.title | string | |
data.training.activeTrainingPlan.level | string | |
data.training.trainingDays | any | |
data.nutrition | object | |
data.nutrition.activeNutritionPlan | object | null | |
data.nutrition.activeNutritionPlan.id | string | |
data.nutrition.activeNutritionPlan.title | string | |
data.nutrition.activeNutritionPlan.level | string | |
data.skipRegistrationForms | boolean | true when the trainee is not asked to fill registration forms in the app during this coaching period. Change it with |
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 Escorts endpoints
This page is also available as Markdown. Browse it in the interactive explorer or download the OpenAPI spec.