> ## 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.

# Get Profile

> Retrieve the authenticated user's profile.

<Badge color="blue">GET</Badge> `/api/user/profile`

Requires authentication.

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

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url http://localhost:3000/api/user/profile \
    --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
  ```
</CodeGroup>

## Response

**200 OK**

<ResponseField name="id" type="string" required>
  Unique identifier for the user.
</ResponseField>

<ResponseField name="name" type="string" required>
  The user's display name.
</ResponseField>

<ResponseField name="email" type="string" required>
  The user's email address, sourced from the local auth provider.
</ResponseField>

<ResponseField name="profile_picture" type="string">
  URL of the user's profile picture. `null` if not set.
</ResponseField>

<ResponseField name="points" type="number" required>
  Total habit points accumulated.
</ResponseField>

<ResponseField name="current_streak" type="number" required>
  Current consecutive days with at least one completed habit.
</ResponseField>

<ResponseField name="max_streak" type="number" required>
  All-time highest streak.
</ResponseField>

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

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

```json Example response theme={null}
{
  "id": "a3f2c1d0-89b4-4e7a-b6f5-1234567890ab",
  "name": "Maria Silva",
  "email": "maria@example.com",
  "profile_picture": "https://example.com/avatars/maria.jpg",
  "points": 120,
  "current_streak": 5,
  "max_streak": 14,
  "created_at": "2026-01-10T08:30:00.000Z",
  "updated_at": "2026-03-15T14:22:00.000Z"
}
```

## Errors

| Status | Description                         |
| ------ | ----------------------------------- |
| `401`  | Missing, invalid, or expired token. |
