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

# User Preferences

> Get and update user scheduling preferences

## GET /v1/user/preferences

Get the current preferences for a user.

### Authentication

Requires **User API Key** in the `X-API-Key` header.

### Request

```bash theme={null}
GET https://api.syncline.run/v1/user/preferences
```

### Response

```json theme={null}
{
  "email": "alice@example.com",
  "preferences": {
    "work_hours": {
      "monday": { "enabled": true, "start": "09:00", "end": "17:00" },
      "tuesday": { "enabled": true, "start": "09:00", "end": "17:00" },
      "wednesday": { "enabled": true, "start": "09:00", "end": "17:00" },
      "thursday": { "enabled": true, "start": "09:00", "end": "17:00" },
      "friday": { "enabled": true, "start": "09:00", "end": "17:00" },
      "saturday": { "enabled": false, "start": "09:00", "end": "17:00" },
      "sunday": { "enabled": false, "start": "09:00", "end": "17:00" }
    },
    "timezone": "America/New_York",
    "buffer_minutes": 15,
    "availability_window_days": 14,
    "max_meetings_per_day": 5,
    "energy_pattern": "morning_person",
    "scheduling_context": "Prefer mornings for strategic meetings",
    "focus_blocks": []
  }
}
```

## PUT /v1/user/preferences

Update user scheduling preferences.

### Authentication

Requires **User API Key** in the `X-API-Key` header.

### Request

```bash theme={null}
PUT https://api.syncline.run/v1/user/preferences
```

### Request Body

```json theme={null}
{
  "work_hours": {
    "monday": { "enabled": true, "start": "10:00", "end": "18:00" }
  },
  "buffer_minutes": 30,
  "energy_pattern": "afternoon_person",
  "scheduling_context": "Prefer afternoons. Need 30min between meetings."
}
```

You only need to include fields you want to update - others remain unchanged.

### Response

```json theme={null}
{
  "success": true,
  "email": "alice@example.com",
  "preferences": {
    // Updated preferences object
  }
}
```

## Preference Fields

<ParamField body="work_hours" type="object">
  Work hours for each day of the week. Each day has:

  * `enabled`: Whether you work this day
  * `start`: Start time in HH:MM format (e.g., "09:00")
  * `end`: End time in HH:MM format (e.g., "17:00")
</ParamField>

<ParamField body="timezone" type="string">
  IANA timezone (e.g., "America/New\_York", "Europe/London")
</ParamField>

<ParamField body="buffer_minutes" type="integer">
  Minutes of buffer between meetings: 0, 15, or 30
</ParamField>

<ParamField body="availability_window_days" type="integer">
  How many days ahead to search for availability (7-90)
</ParamField>

<ParamField body="max_meetings_per_day" type="integer">
  Maximum meetings allowed per day (1-10)
</ParamField>

<ParamField body="energy_pattern" type="string">
  When you're most productive:

  * `flexible` - No preference
  * `morning_person` - Best before noon
  * `afternoon_person` - Peak 12-5pm
  * `evening_person` - Best after 5pm
</ParamField>

<ParamField body="scheduling_context" type="string">
  Free-form text describing your preferences. The AI processes this with Claude LLM to generate SmartWeights.

  Example: "I prefer to keep Fridays meeting-free for deep work. Morning meetings work best for strategic discussions."
</ParamField>

<ParamField body="focus_blocks" type="array">
  Protected time blocks for deep work:

  ```json theme={null}
  [
    {
      "day": "tuesday",
      "start": "09:00",
      "end": "12:00",
      "reason": "Deep work - coding"
    }
  ]
  ```
</ParamField>

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Update Preferences (MCP)" icon="sliders" href="/mcp/update-preferences">
    MCP tool for updating preferences
  </Card>

  <Card title="AI Learning" icon="brain" href="/concepts/ai-learning">
    How preferences affect AI scheduling
  </Card>
</CardGroup>
