> ## 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.

# Create a theme

> Create a new email theme with a name and optional style attributes for use across Loops emails.

<Tip>
  Read more about [themes](/creating-emails/styles#themes).
</Tip>

## Request

### Body

<ParamField body="name" type="string" required>
  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

Returns `201 Created`.

<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>

### Error

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

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": false,
    "createdAt": "2026-03-28T15:00:00.000Z",
    "updatedAt": "2026-03-28T15:00:00.000Z"
  }
  ```

  ```json Error response theme={"dark"}
  {
    "message": "Name is required."
  }
  ```
</ResponseExample>
