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

# Update a theme

> Update a theme's name and/or styles. Style changes cascade to every email using the theme.

<Info>
  At least one of `name` or `styles` must be provided.
</Info>

When `styles` change, the update cascades to every email using this theme. `affectedEmailCount` in the response reports how many emails were affected.

Manual style edits made on individual emails are preserved: the cascade only
changes properties an email has not overridden. A per-email override is removed
only when it becomes identical to the theme's new value, after which that email
follows the theme for that property.

## Request

### Path parameters

<ParamField path="themeId" type="string" required>
  The ID of the theme.
</ParamField>

### Body

<ParamField body="name" type="string">
  The theme name.
</ParamField>

<ParamField body="styles" type="object">
  Style attributes for the theme. Attributes use the same names as the LMX
  [`<Style />`](/creating-emails/lmx#document-styles) tag attributes.
</ParamField>

## Response

### Success

<ResponseField name="id" type="string" required>
  The theme ID.
</ResponseField>

<ResponseField name="name" type="string" required>
  The theme name.
</ResponseField>

<ResponseField name="styles" type="object" required>
  The theme's style attributes.
</ResponseField>

<ResponseField name="isDefault" type="boolean" required>
  Whether this theme is the team's default theme.
</ResponseField>

<ResponseField name="createdAt" type="string" required>
  ISO 8601 timestamp for when the theme was created.
</ResponseField>

<ResponseField name="updatedAt" type="string" required>
  ISO 8601 timestamp for when the theme was last updated.
</ResponseField>

<ResponseField name="affectedEmailCount" type="number" required>
  The number of emails using this theme that are affected by the style change.
  `0` when only the name changed.
</ResponseField>

### Error

If the request body is invalid, a `400 Bad Request` is returned.

A `404 Not Found` is returned if the theme does not exist.

If the API key is invalid (or content API is not enabled for your team), a
`401 Unauthorized` is returned.

<ResponseField name="message" type="string" required>
  An error message describing what went wrong.
</ResponseField>

<ResponseExample>
  ```json Response theme={"dark"}
  {
    "id": "clo1z5q7s004yl70y3z4a5b6c",
    "name": "Marketing default",
    "styles": {
      "backgroundColor": "#ffffff",
      "textBaseColor": "#111111",
      "textBaseFontSize": 16
    },
    "isDefault": true,
    "createdAt": "2026-03-28T15:00:00.000Z",
    "updatedAt": "2026-03-28T15:30:00.000Z",
    "affectedEmailCount": 12
  }
  ```

  ```json Error response theme={"dark"}
  {
    "message": "Theme not found."
  }
  ```
</ResponseExample>
