# Respond to a check-in

`POST https://api.coach-platform.com/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.

- Resource: Forms
- Authentication: API key in the `Authorization: Bearer cp_live_...` header
- HTML version: https://www.coach-platform.com/docs/api/reference/post-updates-update-id-respond
- OpenAPI spec: https://www.coach-platform.com/openapi.json

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `updateId` | string | Yes |   |

## Header parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Idempotency-Key` | string | No | 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

Content type: `application/json`. Required.

| Field | Type | Required | Description |
|---|---|---|---|
| `coachNotes` | string | No | Private note, never shown to the trainee. |
| `feedback` | string | No | Feedback text delivered to the trainee. |
| `rating` | integer | No | Minimum: `1`. Maximum: `5`. |
| `trainingDays` | integer | No | Minimum: `0`. Maximum: `7`. |
| `cardioDays` | integer | No | Minimum: `0`. Maximum: `7`. |
| `cardioTime` | integer | No | Cardio minutes per session. Minimum: `0`. |
| `dailyStepsTarget` | integer | No | Minimum: `0`. |
| `nutritionNotes` | string | No |   |
| `customTrainingPlan` | string | No | Training plan id to switch the coaching period to. |
| `customNutritionPlan` | string | No | Nutrition menu id to switch the coaching period to. |
| `saveFeedbackToTrainee` | boolean | No |   |
| `notificationChannel` | string | No | How to deliver the feedback. Defaults to notification (in-app). whatsapp and both require the messaging:send scope. Allowed values: `notification`, `whatsapp`, `both`. |
| `whatsappMessage` | string | No | WhatsApp text to send instead of the feedback text. Requires the messaging:send scope. |

## Responses

| Status | Description |
|---|---|
| `200` OK | Successful response |
| `400` Bad Request |  |
| `401` Unauthorized |  |
| `403` Forbidden |  |
| `404` Not Found |  |
| `409` Conflict |  |
| `429` Too Many Requests |  |
| `500` Internal Server Error |  |

### 200 OK

Content type: `application/json`

| Field | Type | Description |
|---|---|---|
| `data` | object |   |
| `data.id` | string |   |
| `data.target` | string | Which kind of record the id resolved to. Allowed values: `formResponse`, `update`. |
| `data.whatsappSent` | boolean |   |

Example:

```json
{
  "data": {
    "id": "<string>",
    "target": "formResponse",
    "whatsappSent": true
  }
}
```

### Error responses 400, 401, 403, 404, 409, 429, 500

Content type: `application/json`

| Field | Type | Description |
|---|---|---|
| `error` | object |   |
| `error.code` | string |   |
| `error.message` | string |   |
| `error.fix` | string \| null |   |
| `error.details` | object \| null |   |
| `error.retryAfterMs` | number \| null |   |

Example:

```json
{
  "error": {
    "code": "<string>",
    "message": "<string>",
    "fix": "<string>",
    "details": {},
    "retryAfterMs": 123
  }
}
```

## Examples

### cURL

```bash
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)

```js
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();
```

## Related endpoints

- [List forms](https://www.coach-platform.com/docs/api/reference/get-forms/index.md): `GET /api/public/forms`. List forms (questionnaires) created by the coach.
- [List registration form responses](https://www.coach-platform.com/docs/api/reference/get-forms-registration/index.md): `GET /api/public/forms/registration`. List submitted registration (intake) form responses across every registration form, newest first.
- [List check-in responses](https://www.coach-platform.com/docs/api/reference/get-updates/index.md): `GET /api/public/updates`. List submitted update (check-in) form responses across every update form, newest first.
- [Get a form with its questions](https://www.coach-platform.com/docs/api/reference/get-forms-form-id/index.md): `GET /api/public/forms/{formId}`. Get one form including its full question set.
- [Get a form response](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-response-response-id/index.md): `GET /api/public/forms/{formId}/response/{responseId}`. Get a single submitted form response with its answers.
- [List responses to a form](https://www.coach-platform.com/docs/api/reference/get-forms-form-id-responses/index.md): `GET /api/public/forms/{formId}/responses`. List submitted responses for a form, newest first.
- Previous: [List check-in responses](https://www.coach-platform.com/docs/api/reference/get-updates/index.md): `GET /api/public/updates`. List submitted update (check-in) form responses across every update form, newest first.
- Next: [Get a form with its questions](https://www.coach-platform.com/docs/api/reference/get-forms-form-id/index.md): `GET /api/public/forms/{formId}`. Get one form including its full question set.
