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

# Themes

> List, create, and update themes, apply one to a room, and promote a room theme to your whole organization.

A theme controls how a room looks. You set three values (a primary color, a background color, and a font), and Flowla generates the rest of the palette from them: navigation, header, blocks, groups, links, and canvas. See [Themes](https://docs.flowla.com/rooms/themes.md) for how this looks in the product.

There are two kinds of themes:

* **Organization themes** can be applied to any room. Their `flowId` is `null`.
* **Room themes** belong to one room. Their `flowId` is that room's ID.

## Endpoints

| Method | Path | Description |
| - | - | - |
| `GET` | `/api/v2/themes` | List themes |
| `POST` | `/api/v2/themes` | Create a theme |
| `PATCH` | `/api/v2/themes/{theme_id}` | Update a theme |
| `POST` | `/api/v2/themes/{theme_id}/promote` | Promote a room theme to an organization theme |

To apply an existing theme to a room, set `themeId` with [`PATCH /api/v2/rooms/{room_id}`](https://docs.flowla.com/api/rooms#update-a-room).

***

## Property sources

The three values that drive a theme live in `propertySources`. Each one says where the value comes from:

| Value | Meaning |
| - | - |
| `{ "from": "org" }` | Your organization's brand color or font, from your [organization settings](https://docs.flowla.com/platform/org-settings.md). |
| `{ "from": "target-company" }` | The brand color or font of the company linked to the room. It stays linked, so if that company's brand changes, the room follows. |
| `{ "from": "custom", "value": "#FF5500" }` | A fixed value: a hex color for `primaryColor` and `bgColor`, or a Google font name such as `"Inter"` for `font`. |

| Field | What it controls |
| - | - |
| `primaryColor` | The accent color: buttons, links, and highlights. |
| `bgColor` | The surface color everything sits on. A dark color gives a dark theme. |
| `font` | The typeface used across the room. |

> [!NOTE]
>
> A theme that uses `target-company` needs a company linked to the room. When the room has none, the response includes a `warning`, and the room shows black and white placeholder colors until you link a company.

***

## List themes

`GET /api/v2/themes`

Returns your organization's themes. With `roomId`, it also returns that room's own themes and `roomActiveThemeId`, the ID of the theme the room uses.

### Query parameters

**roomId** `string`

Room ID. Adds the room's own themes to the results, and the room's current theme as `roomActiveThemeId`.

```bash cURL theme={null}
curl "https://api.flowla.com/api/v2/themes?roomId=<room_id>" \
  -H "x-flowla-api-key: YOUR_API_KEY"
```

```python Python theme={null}
import requests

response = requests.get(
    "https://api.flowla.com/api/v2/themes",
    headers={"x-flowla-api-key": "YOUR_API_KEY"},
    params={"roomId": "<room_id>"},
)
print(response.json())
```

```js JavaScript theme={null}
const res = await fetch(
  "https://api.flowla.com/api/v2/themes?roomId=<room_id>",
  { headers: { "x-flowla-api-key": "YOUR_API_KEY" } }
);
const data = await res.json();
```

### Response

```json Response 200 theme={null}
{
  "results": [
    {
      "id": "<theme_id>",
      "name": "Brand",
      "flowId": null,
      "isOrgDefault": false,
      "data": {
        "propertySources": {
          "primaryColor": { "from": "org" },
          "bgColor": { "from": "org" },
          "font": { "from": "org" }
        }
      }
    }
  ],
  "roomActiveThemeId": "<theme_id>"
}
```

`roomActiveThemeId` is only included when you pass `roomId`. `data` holds the full theme. Besides `propertySources`, it contains any values someone set by hand in the theme editor.

***

## Create a theme

`POST /api/v2/themes`

Pass `roomId` to create a room theme. It's applied to that room straight away. Leave `roomId` out to create an organization theme.

### Body parameters

**name** `string` *required*

Theme name, up to 128 characters. It must be unique (ignoring case) among your organization themes, or among the room's own themes for a room theme.

**roomId** `string`

Room ID. The theme belongs to this room and is applied to it.

**propertySources** `object`

Any of `primaryColor`, `bgColor`, and `font`, as described in [Property sources](#property-sources). Values you leave out default to your organization's brand color, a white background (`#FFFFFF`), and your organization's font.

```json Example theme={null}
{
  "name": "Acme",
  "roomId": "<room_id>",
  "propertySources": {
    "primaryColor": { "from": "custom", "value": "#FF5500" },
    "bgColor": { "from": "custom", "value": "#FFF7F2" },
    "font": { "from": "custom", "value": "Inter" }
  }
}
```

```bash cURL theme={null}
curl -X POST https://api.flowla.com/api/v2/themes \
  -H "x-flowla-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme",
    "roomId": "<room_id>",
    "propertySources": {
      "primaryColor": { "from": "custom", "value": "#FF5500" }
    }
  }'
```

```python Python theme={null}
requests.post(
    "https://api.flowla.com/api/v2/themes",
    headers={"x-flowla-api-key": "YOUR_API_KEY"},
    json={
        "name": "Acme",
        "roomId": "<room_id>",
        "propertySources": {
            "primaryColor": {"from": "custom", "value": "#FF5500"},
        },
    },
)
```

```js JavaScript theme={null}
await fetch("https://api.flowla.com/api/v2/themes", {
  method: "POST",
  headers: {
    "x-flowla-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "Acme",
    roomId: "<room_id>",
    propertySources: {
      primaryColor: { from: "custom", value: "#FF5500" },
    },
  }),
});
```

### Response

```json Response 200 theme={null}
{
  "id": "<theme_id>",
  "name": "Acme",
  "flowId": "<room_id>",
  "isOrgDefault": false,
  "data": {
    "propertySources": {
      "primaryColor": { "from": "custom", "value": "#FF5500" },
      "bgColor": { "from": "custom", "value": "#FFFFFF" },
      "font": { "from": "org" }
    }
  }
}
```

***

## Update a theme

`PATCH /api/v2/themes/{theme_id}`

All fields are optional. Only the property sources you send change. Values someone set by hand in the theme editor are kept.

> [!WARNING]
>
> Updating an organization theme changes every room that uses it. To restyle a single room, create a room theme for it instead.

### Body parameters

**name** `string`

New theme name.

**propertySources** `object`

Any of `primaryColor`, `bgColor`, and `font`, as described in [Property sources](#property-sources).

```json Example theme={null}
{
  "propertySources": {
    "primaryColor": { "from": "target-company" },
    "bgColor": { "from": "target-company" }
  }
}
```

```bash cURL theme={null}
curl -X PATCH https://api.flowla.com/api/v2/themes/<theme_id> \
  -H "x-flowla-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"propertySources": {"primaryColor": {"from": "target-company"}}}'
```

```python Python theme={null}
requests.patch(
    "https://api.flowla.com/api/v2/themes/<theme_id>",
    headers={"x-flowla-api-key": "YOUR_API_KEY"},
    json={"propertySources": {"primaryColor": {"from": "target-company"}}},
)
```

```js JavaScript theme={null}
await fetch("https://api.flowla.com/api/v2/themes/<theme_id>", {
  method: "PATCH",
  headers: {
    "x-flowla-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    propertySources: { primaryColor: { from: "target-company" } },
  }),
});
```

The response has the same shape as [Create a theme](#create-a-theme), including `warning` when it applies.

***

## Promote a room theme

`POST /api/v2/themes/{theme_id}/promote`

Turns a room theme into an organization theme, so every room can use it. The theme keeps its ID, and the room it came from keeps using it.

### Body parameters

**name** `string`

Name for the organization theme. Defaults to the current name. Pass a new one if another organization theme already uses that name.

```bash cURL theme={null}
curl -X POST https://api.flowla.com/api/v2/themes/<theme_id>/promote \
  -H "x-flowla-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Acme brand"}'
```

```python Python theme={null}
requests.post(
    "https://api.flowla.com/api/v2/themes/<theme_id>/promote",
    headers={"x-flowla-api-key": "YOUR_API_KEY"},
    json={"name": "Acme brand"},
)
```

```js JavaScript theme={null}
await fetch("https://api.flowla.com/api/v2/themes/<theme_id>/promote", {
  method: "POST",
  headers: {
    "x-flowla-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ name: "Acme brand" }),
});
```

The response is the promoted theme, with `flowId` set to `null`.

***

## Errors

| Status | When |
| - | - |
| `400 Bad Request` | The body is invalid, or you tried to promote a theme that's already an organization theme. |
| `403 Forbidden` | The room belongs to a different organization. |
| `404 Not Found` | The theme or room doesn't exist, or the theme belongs to a different room. |
| `409 Conflict` | A theme with that name already exists. |


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