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

# Get & Set Theme

> Retrieve or update the visual theme configuration for a page.

# Page Theme

Retrieve (`GET`) or set (`PUT`) the complete styling and layout token configuration for an okl.ink page.

***

## 1. Get Theme (`GET /api/v1/pages/{id}/theme`)

Requires `pages:read` scope.

### Response

Returns the stored `ThemeConfig` JSON object or `null`.

***

## 2. Set Theme (`PUT /api/v1/pages/{id}/theme`)

Requires `pages:write` scope.

### Request Body

<ParamField body="preset" type="string" required>
  One of: `oklink`, `midnight`, `paper`, `vivid`, `lofi`.
</ParamField>

<ParamField body="background" type="string | null">
  Optional custom hex background (e.g. `#111827`).
</ParamField>

<ParamField body="accent" type="string | null">
  Optional custom hex accent color (e.g. `#10b981`).
</ParamField>

<ParamField body="linkStyle" type="string" default="rounded">
  One of: `rounded`, `pill`, `outline`, `filled`, `minimal`.
</ParamField>

<ParamField body="typography" type="string" default="modern">
  One of: `modern`, `editorial`, `mono`, `geist`.
</ParamField>

<ParamField body="radius" type="string" default="rounded">
  One of: `sharp`, `rounded`, `soft`, `pill`.
</ParamField>

<ParamField body="density" type="string" default="comfortable">
  One of: `compact`, `comfortable`, `airy`.
</ParamField>

<ParamField body="iconStyle" type="string" default="duotone">
  One of: `duotone`, `filled`, `colored`.
</ParamField>

<ParamField body="layoutMode" type="string" default="grid">
  `grid` or `list`.
</ParamField>

<ParamField body="showByline" type="boolean" default="true">
  Whether to render the creator avatar and byline in header.
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Returns `true` when the theme update succeeds.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PUT https://okl.ink/api/v1/pages/cly1019283749/theme \
    -H "Authorization: Bearer YOUR_API_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "preset": "midnight",
      "accent": "#a855f7",
      "typography": "geist",
      "radius": "soft",
      "density": "airy"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "success": true
  }
  ```
</ResponseExample>
