Approve or reject pending trainees
POST/api/public/trainees/pending
Approve or reject trainees from the coach's approval queue, which GET /trainees?status=pending lists. Approving counts them against the coach's trainee limit and returns 422 if that limit would be exceeded.
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.
Header parameters
| Name | Type | Description |
|---|---|---|
Idempotency-Key | string | 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
application/json, required
| Name | Type | Description |
|---|---|---|
traineeIdsrequired | string[] | Ids of trainees currently in the pending queue. Ids that are not pending make the whole request fail with 422. |
approverequired | boolean | true to approve the trainees, false to reject them. |
Request examples
curl --request POST \
--url 'https://api.coach-platform.com/api/public/trainees/pending' \
--header 'Authorization: Bearer cp_live_...' \
--header 'Content-Type: application/json' \
--data '{
"traineeIds": [
"<string>"
],
"approve": true
}'const response = await fetch('https://api.coach-platform.com/api/public/trainees/pending', {
method: 'POST',
headers: {
Authorization: 'Bearer cp_live_...',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"traineeIds": [
"<string>"
],
"approve": true
}),
});
const data = await response.json();Responses
200 OK
Successful response
{
"data": {
"success": true
}
}Response fields (2)
| Name | Type | Description |
|---|---|---|
data | object | |
data.success | boolean |
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.