> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/azfar-imtiaz/PayPulse-Cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Get user profile

> Retrieve the authenticated user's profile information.

## Authentication

All requests to this endpoint must include a valid JWT in the `Authorization` header.

```
Authorization: Bearer <token>
```

## Response

<ResponseField name="message" type="string">
  A human-readable confirmation message. Example: `"User profile retrieved successfully"`
</ResponseField>

<ResponseField name="code" type="number">
  HTTP status code. `200` on success.
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="name" type="string">
      The user's display name.
    </ResponseField>

    <ResponseField name="email" type="string">
      The email address associated with the account.
    </ResponseField>

    <ResponseField name="created_on" type="string">
      The date the account was created, in `YYYY-MM-DD` format.
    </ResponseField>

    <ResponseField name="gmail_account_connected" type="boolean">
      Whether the user has linked a Gmail account. `true` if OAuth tokens are stored in Secrets Manager, `false` otherwise.
    </ResponseField>
  </Expandable>
</ResponseField>

## Error responses

| Status | Error code              | Description                                                              |
| ------ | ----------------------- | ------------------------------------------------------------------------ |
| `401`  | `INVALID_CREDENTIALS`   | The `Authorization` header is missing or the token is invalid.           |
| `401`  | `TOKEN_EXPIRED`         | The JWT has expired.                                                     |
| `404`  | `USER_NOT_FOUND`        | No account exists for the user ID encoded in the token.                  |
| `502`  | `DEPENDENCY_FAILURE`    | A downstream dependency (DynamoDB or Secrets Manager) returned an error. |
| `500`  | `INTERNAL_SERVER_ERROR` | An unexpected server-side error occurred.                                |

Error responses follow this structure:

```json theme={null}
{
  "error": {
    "code": "USER_NOT_FOUND",
    "message": "User not found"
  }
}
```

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.paypulse.io/v1/user/me \
    --header 'Authorization: Bearer <token>'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "message": "User profile retrieved successfully",
    "code": 200,
    "data": {
      "name": "Jane Doe",
      "email": "jane@example.com",
      "created_on": "2024-03-15",
      "gmail_account_connected": true
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": "TOKEN_EXPIRED",
      "message": "Expired token."
    }
  }
  ```

  ```json 404 theme={null}
  {
    "error": {
      "code": "USER_NOT_FOUND",
      "message": "User not found"
    }
  }
  ```
</ResponseExample>
