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

# Accessibility Preferences API: Get and Set User Settings

> Retrieve or replace your accessibility preferences. Settings sync across devices and cover text scale, contrast, motion, dyslexia font, and speech rate.

AfterCare's accessibility preferences control how the app renders for each user — text scale, line spacing, contrast, motion, and more. The API stores preferences server-side so they follow the user across devices. Both endpoints require a valid bearer token and operate on the full preferences object: a POST always replaces all fields rather than merging a partial update.

<Tip>
  The AfterCare web app also stores preferences locally on the device so the correct display settings apply immediately on load — before the API response arrives. The server-side preferences synced by these endpoints are the authoritative copy and win when you sign in on a new device.
</Tip>

***

## Get accessibility preferences

Return the current accessibility preferences for the authenticated user. If the user has never set preferences explicitly, the server returns the application defaults.

```http theme={null}
GET /accessibility/prefs
```

### Example

```bash cURL theme={null}
curl -X GET https://api.aftercare.app/accessibility/prefs \
  -H "Authorization: Bearer <your_access_token>"
```

### Response — 200 OK

```json Example response theme={null}
{
  "textScale": "normal",
  "lineSpacing": "normal",
  "contrast": false,
  "darkMode": false,
  "reduceMotion": false,
  "dyslexiaFont": false,
  "underlineLinks": false,
  "largeTargets": false,
  "readAloudRate": 0.95
}
```

***

## Set accessibility preferences

Replace all accessibility preferences for the authenticated user. You must send every field — the endpoint does not support partial updates. The response echoes back the saved preferences.

```http theme={null}
POST /accessibility/prefs
```

### Request body

<ParamField body="textScale" type="string" required>
  Font size scaling applied across the entire app. Accepted values: `"normal"`, `"large"`, `"largest"`. Maps to CSS scale factors of 1×, 1.15×, and 1.35× respectively.
</ParamField>

<ParamField body="lineSpacing" type="string" required>
  Line height applied to body text. Accepted values: `"normal"`, `"relaxed"`, `"loose"`. Maps to line-height values of 1.6, 1.85, and 2.1 respectively.
</ParamField>

<ParamField body="contrast" type="boolean" required>
  When `true`, enables the high-contrast colour theme. Mirrors the OS-level `prefers-contrast: more` signal unless the user has explicitly overridden it.
</ParamField>

<ParamField body="darkMode" type="boolean" required>
  When `true`, enables the dark colour theme. Mirrors the OS-level `prefers-color-scheme: dark` signal unless the user has explicitly overridden it.
</ParamField>

<ParamField body="reduceMotion" type="boolean" required>
  When `true`, disables or minimises animations throughout the app. Mirrors the OS-level `prefers-reduced-motion` signal unless explicitly overridden.
</ParamField>

<ParamField body="dyslexiaFont" type="boolean" required>
  When `true`, switches body text to a font designed to reduce letter confusion for readers with dyslexia.
</ParamField>

<ParamField body="underlineLinks" type="boolean" required>
  When `true`, underlines every link so that colour is never the only visual cue distinguishing a link from surrounding text (satisfies WCAG 1.4.1).
</ParamField>

<ParamField body="largeTargets" type="boolean" required>
  When `true`, enforces a 48 px minimum tap/click target on all interactive controls (satisfies WCAG 2.5.8).
</ParamField>

<ParamField body="readAloudRate" type="number" required>
  Speech rate for the read-aloud feature, expressed as a multiplier. Must be between `0.6` (slowest) and `1.4` (fastest). The default is `0.95`.
</ParamField>

### Response fields

<ResponseField name="textScale" type="string">
  The saved text scale value: `"normal"`, `"large"`, or `"largest"`.
</ResponseField>

<ResponseField name="lineSpacing" type="string">
  The saved line spacing value: `"normal"`, `"relaxed"`, or `"loose"`.
</ResponseField>

<ResponseField name="contrast" type="boolean">
  Whether high-contrast mode is enabled.
</ResponseField>

<ResponseField name="darkMode" type="boolean">
  Whether dark mode is enabled.
</ResponseField>

<ResponseField name="reduceMotion" type="boolean">
  Whether reduced motion is enabled.
</ResponseField>

<ResponseField name="dyslexiaFont" type="boolean">
  Whether the dyslexia-friendly font is enabled.
</ResponseField>

<ResponseField name="underlineLinks" type="boolean">
  Whether link underlining is enabled.
</ResponseField>

<ResponseField name="largeTargets" type="boolean">
  Whether large tap targets are enforced.
</ResponseField>

<ResponseField name="readAloudRate" type="number">
  The saved read-aloud speech rate multiplier, clamped to the range 0.6–1.4.
</ResponseField>

### Example

```bash cURL theme={null}
curl -X POST https://api.aftercare.app/accessibility/prefs \
  -H "Authorization: Bearer <your_access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "textScale": "large",
    "lineSpacing": "relaxed",
    "contrast": false,
    "darkMode": true,
    "reduceMotion": true,
    "dyslexiaFont": false,
    "underlineLinks": true,
    "largeTargets": true,
    "readAloudRate": 0.85
  }'
```

### Response — 200 OK

Returns the full saved preferences object using the same shape as the GET response.

```json Example response theme={null}
{
  "textScale": "large",
  "lineSpacing": "relaxed",
  "contrast": false,
  "darkMode": true,
  "reduceMotion": true,
  "dyslexiaFont": false,
  "underlineLinks": true,
  "largeTargets": true,
  "readAloudRate": 0.85
}
```

### Response — 400 Bad Request

Returned when any field is missing, of the wrong type, or outside the accepted range.

```json theme={null}
{ "error": "Invalid accessibility preferences" }
```

***

## Application defaults

If you have never posted preferences, the GET endpoint returns these values:

| Field | Default |
| - | - |
| `textScale` | `"normal"` |
| `lineSpacing` | `"normal"` |
| `contrast` | `false` |
| `darkMode` | `false` |
| `reduceMotion` | `false` |
| `dyslexiaFont` | `false` |
| `underlineLinks` | `false` |
| `largeTargets` | `false` |
| `readAloudRate` | `0.95` |

<Info>
  The defaults for `contrast`, `darkMode`, and `reduceMotion` are `false` at the API layer. In the web app, these three settings are seeded from OS-level media queries before a user explicitly sets them, so the app may behave differently from the raw API defaults on first load.
</Info>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.