# User Settings API

Base URL: `${FORGEJO_URL}/api/v1`

## Get User Settings

```
GET /user/settings
```

```bash
curl -s \
  -H "Authorization: token ${FORGEJO_PAT}" \
  "${FORGEJO_URL}/api/v1/user/settings"
```

**Response (UserSettings):**
| Field | Type | Description |
|-------|------|-------------|
| full_name | string | Display name |
| website | string | Website URL |
| description | string | Bio/description |
| location | string | Location |
| pronouns | string | Pronouns |
| language | string | Preferred language (e.g. `en-US`) |
| theme | string | UI theme (e.g. `gitea-auto`, `gitea-light`, `gitea-dark`) |
| diff_view_style | string | Diff view: `unified` or `split` |
| enable_repo_unit_hints | boolean | Show repo unit hints |
| hide_email | boolean | Hide email from profile |
| hide_pronouns | boolean | Hide pronouns from profile |
| hide_activity | boolean | Hide activity from profile |

**Example Response:**
```json
{
  "full_name": "Jane Doe",
  "website": "https://jane.example.com",
  "description": "Software developer",
  "location": "Berlin",
  "pronouns": "she/her",
  "language": "en-US",
  "theme": "gitea-auto",
  "diff_view_style": "unified",
  "enable_repo_unit_hints": true,
  "hide_email": false,
  "hide_pronouns": false,
  "hide_activity": false
}
```

---

## Update User Settings

```
PATCH /user/settings
```

**Request Body (UserSettingsOptions):**

All fields are optional. Only include fields you want to change.

| Field | Type | Description |
|-------|------|-------------|
| full_name | string | Display name |
| website | string | Website URL |
| description | string | Bio/description |
| location | string | Location |
| pronouns | string | Pronouns |
| language | string | Preferred language |
| theme | string | UI theme |
| diff_view_style | string | `unified` or `split` |
| enable_repo_unit_hints | boolean | Show repo unit hints |
| hide_email | boolean | Hide email from profile |
| hide_pronouns | boolean | Hide pronouns from profile |
| hide_activity | boolean | Hide activity from profile |

### Update display name and location

```bash
curl -s -X PATCH \
  -H "Authorization: token ${FORGEJO_PAT}" \
  -H "Content-Type: application/json" \
  -d '{
    "full_name": "Jane Doe",
    "location": "Berlin, Germany"
  }' \
  "${FORGEJO_URL}/api/v1/user/settings"
```

### Switch to dark theme with split diff

```bash
curl -s -X PATCH \
  -H "Authorization: token ${FORGEJO_PAT}" \
  -H "Content-Type: application/json" \
  -d '{
    "theme": "gitea-dark",
    "diff_view_style": "split"
  }' \
  "${FORGEJO_URL}/api/v1/user/settings"
```

### Hide personal information

```bash
curl -s -X PATCH \
  -H "Authorization: token ${FORGEJO_PAT}" \
  -H "Content-Type: application/json" \
  -d '{
    "hide_email": true,
    "hide_pronouns": true,
    "hide_activity": true
  }' \
  "${FORGEJO_URL}/api/v1/user/settings"
```

**Response:** Returns the full updated `UserSettings` object.
