Respond to a check-in

POST/api/public/updates/{updateId}/respond

Respond to a submitted check-in. Accepts any id returned by GET /updates or GET /forms/registration, resolving it to a form response or a legacy update record and applying the same review flow the dashboard uses: the record is marked Handled, coachNotes, feedback and rating are stored, and target changes (trainingDays, cardioDays, cardioTime, dailyStepsTarget, nutritionNotes) update the active coaching period. customTrainingPlan and customNutritionPlan switch the active plan or menu to the given id. Feedback is delivered to the trainee as an in-app notification by default; setting notificationChannel to whatsapp or both, or supplying whatsappMessage, sends WhatsApp and additionally requires the messaging:send scope.

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

Path parameters
NameTypeDescription
updateIdrequiredstring

Header parameters

Header parameters
NameTypeDescription
Idempotency-Keystring

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

Request body fields
NameTypeDescription
coachNotesstring

Private note, never shown to the trainee.

feedbackstring

Feedback text delivered to the trainee.

ratinginteger

Minimum: 1

Maximum: 5

trainingDaysinteger

Minimum: 0

Maximum: 7

cardioDaysinteger

Minimum: 0

Maximum: 7

cardioTimeinteger

Cardio minutes per session.

Minimum: 0

dailyStepsTargetinteger

Minimum: 0

nutritionNotesstring
customTrainingPlanstring

Training plan id to switch the coaching period to.

customNutritionPlanstring

Nutrition menu id to switch the coaching period to.

saveFeedbackToTraineeboolean
notificationChannelstring

How to deliver the feedback. Defaults to notification (in-app). whatsapp and both require the messaging:send scope.

Allowed values: notification whatsapp both

whatsappMessagestring

WhatsApp text to send instead of the feedback text. Requires the messaging:send scope.

Request examples

cURL
curl --request POST \
  --url 'https://api.coach-platform.com/api/public/updates/<updateId>/respond' \
  --header 'Authorization: Bearer cp_live_...' \
  --header 'Content-Type: application/json' \
  --data '{
  "coachNotes": "<string>"
}'
JavaScript (fetch)
const response = await fetch('https://api.coach-platform.com/api/public/updates/<updateId>/respond', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer cp_live_...',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "coachNotes": "<string>"
  }),
});

const data = await response.json();

Responses

200 OK

Successful response

Example body (application/json)
{
  "data": {
    "id": "<string>",
    "target": "formResponse",
    "whatsappSent": true
  }
}
Response fields (4)
Response fields
NameTypeDescription
dataobject
data.idstring
data.targetstring

Which kind of record the id resolved to.

Allowed values: formResponse update

data.whatsappSentboolean

Error responses

  • 400 Bad Request
  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not Found
  • 409 Conflict
  • 429 Too Many Requests
  • 500 Internal Server Error

These statuses share the same response body.

Example body (application/json)
{
  "error": {
    "code": "<string>",
    "message": "<string>",
    "fix": "<string>",
    "details": {},
    "retryAfterMs": 123
  }
}
Error fields (6)
Error fields
NameTypeDescription
errorobject
error.codestring
error.messagestring
error.fixstring | null
error.detailsobject | null
error.retryAfterMsnumber | null

This page is also available as Markdown. Browse it in the interactive explorer or download the OpenAPI spec.