---
title: "Set realm theme assignment"
method: PATCH
path: "/clusters/{cluster_id}/realms/{realm}/themes"
tags: ["Themes"]
---

# Set realm theme assignment

`PATCH /clusters/{cluster_id}/realms/{realm}/themes`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/clusters/{cluster_id}/realms/{realm}/themes`
- Auth: API key in header `API-Key`

Assigns deployed custom themes to the realm for one or more Keycloak theme types. Setting a type to `null` resets it to Keycloak's built-in default. Only themes with `status: deployed` can be assigned.

Required scope: `themes:write`

## Path parameters

- `cluster_id` string, uuid, required
- `realm` string, required: Keycloak realm name (not ID). Must start with a letter; allows letters, digits, and hyphens.

## Headers

- `API-Version` '2026-06-01.beta', required

## Request body

- SetThemeAssignmentRequest
  - `login` string, uuid
  - `email` string, uuid
  - `account` string, uuid
  - `admin` string, uuid

## Response `200`

The request has succeeded.

- ThemeAssignment: Which custom theme is active for each Keycloak theme type in the realm.
  - `login` string, uuid, required
  - `email` string, uuid, required
  - `account` string, uuid, required
  - `admin` string, uuid, required

## Other responses

- `400`: The server could not understand the request due to invalid syntax.
- `401`: Access is unauthorized.
- `403`: Access is forbidden.
- `404`: The server cannot find the requested resource.
- `409`: The target cluster is temporarily unavailable because an update or maintenance operation is in progress. The request was not applied and can be retried once the cluster returns to the available state; the Retry-After header carries a suggested delay in seconds.
- `422`: Client error
- `429`: Client error
- `500`: Server error
- `501`: Server error

---

[API](https://skmtc.dev/skycloak/apis/skycloak-public-api.md) · [All operations](https://skmtc.dev/skycloak/apis/skycloak-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/skycloak/apis/skycloak-public-api/revisions/33a69e2ce35f?raw)
