> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prixo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /api/profile/me — current user profile and stats

> Retrieve or update the authenticated user's profile, points, trust level, and preferences. This page also covers the POST /api/feedback endpoint.

The Profile endpoints give you full read and write access to the authenticated user's account data. You can retrieve the complete profile snapshot — including trust level, accuracy scores, streak, and preferences — or update individual fields. All endpoints in this section require an active session.

***

## GET /api/profile/me

Retrieve the current user's profile, stats, and account preferences in a single call.

```
GET /api/profile/me
```

**Authentication:** Required

***

### Response fields

<ResponseField name="profile" type="object">
  The authenticated user's full profile record.

  <Expandable title="Profile fields">
    <ResponseField name="id" type="string">
      The user's UUID. Use this as a stable identifier — usernames can change.
    </ResponseField>

    <ResponseField name="username" type="string">
      The user's public username, unique across PRIXO.
    </ResponseField>

    <ResponseField name="display_name" type="string">
      The user's chosen display name shown in the UI and on the leaderboard.
    </ResponseField>

    <ResponseField name="avatar_url" type="string">
      URL of the user's avatar image.
    </ResponseField>

    <ResponseField name="bio" type="string">
      Short user-authored bio text.
    </ResponseField>

    <ResponseField name="area" type="string">
      The user's primary area in Arabic, used for leaderboard and scope
      resolution, e.g. `العليا`.
    </ResponseField>

    <ResponseField name="contribution_count" type="number">
      Total number of accepted price contributions by this user.
    </ResponseField>

    <ResponseField name="points_balance" type="number">
      Current redeemable points balance.
    </ResponseField>

    <ResponseField name="trust_level" type="object">
      The user's current trust level.

      <Expandable title="Trust level fields">
        <ResponseField name="slug" type="string">
          Internal identifier for the trust level, e.g. `saane`.
        </ResponseField>

        <ResponseField name="name_ar" type="string">
          Trust level name in Arabic, e.g. `سنع`.
        </ResponseField>

        <ResponseField name="name_en" type="string">
          Trust level name in English, e.g. `Saane`.
        </ResponseField>

        <ResponseField name="icon" type="string">
          Emoji icon, e.g. `🏅`.
        </ResponseField>

        <ResponseField name="confirmation_weight" type="number">
          The weight applied to this user's price confirmations relative to
          newer contributors. Higher levels carry more weight.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="trust_score" type="number">
      An overall trust score from 0–100 reflecting the user's confirmation
      accuracy and engagement history.
    </ResponseField>

    <ResponseField name="accuracy_score" type="number">
      Percentage of the user's price submissions that were subsequently
      confirmed as accurate by the community.
    </ResponseField>

    <ResponseField name="streak_days" type="number">
      Number of consecutive days the user has contributed or confirmed at least
      one price. Resets to 0 if a day is missed.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="preferences" type="object">
  The user's current account preferences.

  <Expandable title="Preferences fields">
    <ResponseField name="language" type="string">
      The UI language preference. See [supported values](#language-values)
      below.
    </ResponseField>

    <ResponseField name="show_public_profile" type="boolean">
      When `true`, the user's profile is publicly visible via the leaderboard
      and other community features.
    </ResponseField>

    <ResponseField name="show_in_leaderboard" type="boolean">
      When `true`, the user appears in leaderboard results. Requires
      `show_public_profile` to also be `true`.
    </ResponseField>
  </Expandable>
</ResponseField>

***

### Example response

```json theme={null}
{
  "profile": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "username": "myusername",
    "display_name": "My Name",
    "avatar_url": "https://cdn.prixo.ai/avatars/myusername.jpg",
    "bio": "Love food in Riyadh",
    "area": "العليا",
    "contribution_count": 42,
    "points_balance": 1200,
    "trust_level": {
      "slug": "saane",
      "name_ar": "سنع",
      "name_en": "Saane",
      "icon": "🏅",
      "confirmation_weight": 2
    },
    "trust_score": 85,
    "accuracy_score": 92,
    "streak_days": 7
  },
  "preferences": {
    "language": "ar",
    "show_public_profile": true,
    "show_in_leaderboard": false
  }
}
```

***

## PATCH /api/profile/me

Update writable fields on the authenticated user's profile.

```
PATCH /api/profile/me
```

**Authentication:** Required

### Updatable fields

<ParamField body="display_name" type="string">
  The user's display name shown publicly.
</ParamField>

<ParamField body="username" type="string">
  The user's unique username. Must be URL-safe and unique across PRIXO.
</ParamField>

<ParamField body="bio" type="string">
  Short bio text.
</ParamField>

<ParamField body="area" type="string">
  Primary area in Arabic, used for leaderboard scope and location-aware
  features.
</ParamField>

<ParamField body="show_public_profile" type="boolean">
  Set to `true` to make the profile visible in community features and the
  leaderboard.
</ParamField>

<ParamField body="show_in_leaderboard" type="boolean">
  Control whether the user appears in public leaderboard results. Has no effect
  if `show_public_profile` is `false`.
</ParamField>

<ParamField body="language" type="string">
  Preferred UI language. See [supported values](#language-values) below.
</ParamField>

***

## Language values

The `language` preference field accepts the following values:

| Value  | Language                      |
| ------ | ----------------------------- |
| `auto` | Detect from browser or device |
| `ar`   | Arabic                        |
| `en`   | English                       |
| `ur`   | Urdu                          |
| `hi`   | Hindi                         |
| `tl`   | Filipino (Tagalog)            |

***

## POST /api/feedback

The feedback endpoint lets your integration — or the PRIXO in-app widget — submit user feedback directly to the PRIXO team.

```
POST /api/feedback
```

**Authentication:** Required

**Rate limit:** 3 requests per minute per user

<Warning>
  Exceeding the rate limit returns `429 Too Many Requests`. Space out feedback
  submissions — this endpoint is designed for deliberate user-triggered actions,
  not automated bulk submissions.
</Warning>

### Request body

<ParamField body="message" type="string" required>
  The feedback message text. Plain text only.
</ParamField>

<ParamField body="category" type="string">
  An optional category tag to route the feedback. Example values: `bug`,
  `suggestion`, `pricing`.
</ParamField>

### Example request

```bash theme={null}
POST /api/feedback
Content-Type: application/json

{
  "message": "The price comparison for shawarma in Al-Olaya seems outdated.",
  "category": "pricing"
}
```

### Example response

```json theme={null}
{
  "success": true,
  "id": "fb_7e3a1c09-2d4f-4b8e-a312-0f5c9d7e1b2a"
}
```

### Response fields

<ResponseField name="success" type="boolean">
  `true` when the feedback was accepted and queued for review.
</ResponseField>

<ResponseField name="id" type="string">
  A unique identifier for the submitted feedback record, prefixed with `fb_`.
  You can display this to users as a reference number.
</ResponseField>

<Tip>
  Show the returned `id` to users after submission so they have a reference if
  they follow up via support channels.
</Tip>
