Set realm theme assignment
const url = 'http://localhost:8000/clusters/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/realms/customer-portal/themes';
const options = {
method: 'PATCH',
headers: {
'API-Version': '2026-06-01.beta',
'API-Key': '<API-Key>',
'Content-Type': 'application/json'
},
body: '{"login":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","email":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","account":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","admin":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}curl --request PATCH \
--url http://localhost:8000/clusters/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/realms/customer-portal/themes \
--header 'API-Key: <API-Key>' \
--header 'API-Version: 2026-06-01.beta' \
--header 'Content-Type: application/json' \
--data '{ "login": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "email": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "account": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "admin": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'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
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Keycloak realm name (not ID). Must start with a letter; allows letters, digits, and hyphens.
Example
customer-portalHeader Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Theme to activate for the login page. Set to null to reset to Keycloak’s built-in default.
Theme to activate for email templates. Set to null to reset to Keycloak’s built-in default.
Theme to activate for the account console. Set to null to reset to Keycloak’s built-in default.
Theme to activate for the admin console. Set to null to reset to Keycloak’s built-in default.
Example generated
{
"login": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"email": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"account": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"admin": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}Responses
Section titled “Responses”The request has succeeded.
Which custom theme is active for each Keycloak theme type in the realm.
object
Active theme for the login page. null when using Keycloak’s built-in default.
Active theme for email templates. null when using Keycloak’s built-in default.
Active theme for the account console. null when using Keycloak’s built-in default.
Active theme for the admin console. null when using Keycloak’s built-in default.
Example generated
{
"login": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"email": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"account": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"admin": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}The server could not understand the request due to invalid syntax.
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}Access is unauthorized.
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}Access is forbidden.
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}The server cannot find the requested resource.
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}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.
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}Headers
Section titled “Headers”Client error
object
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com",
"errors": [
{
"field": "example",
"detail": "example",
"code": "example",
"value": "example"
}
]
}Client error
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}Headers
Section titled “Headers”Server error
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}Server error
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}