> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/RafaeltiMoreira/mais-habito-api/llms.txt
> Use this file to discover all available pages before exploring further.

# Update challenge notes

> Add or update progress notes on a user challenge.

<Badge color="orange">PUT</Badge> `/api/user-challenges/:id/notes`

Requires authentication.

<ParamField header="Authorization" type="string" required>
  Bearer token obtained from `/api/auth/login` or `/api/auth/signup`. Format: `Bearer <token>`.
</ParamField>

<Tip>
  Use notes to record daily reflections, observations, or milestones as you progress through a
  challenge. Reviewing your notes over time helps reinforce the habit and maintain motivation.
</Tip>

## Path parameters

<ParamField path="id" type="number" required>
  The numeric ID of the user challenge to update.
</ParamField>

## Request body

<ParamField body="notes" type="string" required>
  Progress notes for the challenge. Replaces any previously saved notes.
</ParamField>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl --request PUT \
    --url http://localhost:3000/api/user-challenges/14/notes \
    --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
    --header 'Content-Type: application/json' \
    --data '{
      "notes": "Dia 5 concluído. Acordei mais disposto e com mais foco durante o trabalho."
    }'
  ```
</CodeGroup>

## Response

**200 OK**

Returns the updated user challenge object with the new `notes` value.

<ResponseField name="id" type="number" required>
  Unique numeric identifier for this user challenge.
</ResponseField>

<ResponseField name="user_id" type="string" required>
  UUID of the authenticated user.
</ResponseField>

<ResponseField name="template_id" type="number" required>
  ID of the challenge template this challenge is based on.
</ResponseField>

<ResponseField name="status" type="string" required>
  Current status of the challenge. One of `ACTIVE`, `COMPLETED`, or `ABANDONED`.
</ResponseField>

<ResponseField name="start_date" type="string" required>
  ISO 8601 timestamp of when the challenge was started.
</ResponseField>

<ResponseField name="completed_at" type="string">
  ISO 8601 timestamp of completion. `null` if the challenge has not been completed.
</ResponseField>

<ResponseField name="notes" type="string" required>
  The updated progress notes.
</ResponseField>

<ResponseField name="created_at" type="string" required>
  ISO 8601 timestamp of when the record was created.
</ResponseField>

<ResponseField name="updated_at" type="string" required>
  ISO 8601 timestamp of this update.
</ResponseField>

```json Example response theme={null}
{
  "id": 14,
  "user_id": "a3f2c1d0-89b4-4e7a-b6f5-1234567890ab",
  "template_id": 3,
  "status": "ACTIVE",
  "start_date": "2026-03-17T09:00:00.000Z",
  "completed_at": null,
  "notes": "Dia 5 concluído. Acordei mais disposto e com mais foco durante o trabalho.",
  "created_at": "2026-03-17T09:00:00.000Z",
  "updated_at": "2026-03-17T19:10:00.000Z"
}
```

## Errors

| Status | Description                                  |
| ------ | -------------------------------------------- |
| `401`  | Missing, invalid, or expired token.          |
| `404`  | No user challenge found with the given `id`. |
