Create or update login branding
const url = 'http://localhost:8000/clusters/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/realms/customer-portal/branding/login';
const options = {
method: 'PUT',
headers: {
'API-Version': '2026-06-01.beta',
'API-Key': '<API-Key>',
'Content-Type': 'application/json'
},
body: '{"primary_color":"#1a73e8","background_color":"#1a73e8","logo_url":"https://example.com","favicon_url":"https://example.com","font_url":"https://example.com","font_family":"example","apply_to_account_console":true,"apply_to_admin_console":true,"registration_enabled":true,"remember_me_enabled":true,"forgot_password_enabled":true,"terms_of_service_url":"https://example.com","privacy_policy_url":"https://example.com","show_powered_by":true,"sso":{"enabled":true,"layout":"vertical","display_style":"logo_only","button_size":"small"},"internationalization":{"enabled":true,"default_locale":"example","supported_locales":["example"],"language_selector_style":"dropdown","language_selector_position":"top_right","language_selection_mode":"automatic_with_selector"}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}curl --request PUT \
--url http://localhost:8000/clusters/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/realms/customer-portal/branding/login \
--header 'API-Key: <API-Key>' \
--header 'API-Version: 2026-06-01.beta' \
--header 'Content-Type: application/json' \
--data '{ "primary_color": "#1a73e8", "background_color": "#1a73e8", "logo_url": "https://example.com", "favicon_url": "https://example.com", "font_url": "https://example.com", "font_family": "example", "apply_to_account_console": true, "apply_to_admin_console": true, "registration_enabled": true, "remember_me_enabled": true, "forgot_password_enabled": true, "terms_of_service_url": "https://example.com", "privacy_policy_url": "https://example.com", "show_powered_by": true, "sso": { "enabled": true, "layout": "vertical", "display_style": "logo_only", "button_size": "small" }, "internationalization": { "enabled": true, "default_locale": "example", "supported_locales": [ "example" ], "language_selector_style": "dropdown", "language_selector_position": "top_right", "language_selection_mode": "automatic_with_selector" } }'Creates or replaces the login page branding for a realm. Triggers asynchronous theme generation and deployment; poll the status field to confirm completion.
Required scope: branding: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
CSS hex color code.
Example
#1a73e8CSS hex color code.
Example
#1a73e8CSS font-family name used with font_url: letters, digits, spaces, hyphens and underscores only. Omitted means unchanged.
Apply the login branding to the realm’s account console. Omitted means unchanged.
Apply the login branding to the realm’s admin console. Omitted means unchanged.
Sets the realm’s own self-registration setting (Keycloak registrationAllowed). Omitted means unchanged: unlike the other fields, leaving it out does not reset it to a default.
object
Show identity provider buttons on the login page.
Login page internationalization settings.
object
IETF BCP 47 language tag used as the default locale.
Locales available to users. Must include default_locale.
Responses
Section titled “Responses”The request has succeeded.
Login page branding configuration for a Keycloak realm.
object
Keycloak realm name (not ID). Must start with a letter; allows letters, digits, and hyphens.
Primary accent color applied to buttons and interactive elements.
CSS hex color code.
URL of the logo displayed on the login page.
URL of a custom web font.
CSS font-family name used with font_url, for example Inter.
Whether the realm’s account console uses the login branding.
Whether the realm’s admin console uses the login branding.
The realm’s current Keycloak login theme, read live from the realm. Every branding save installs the theme under a new name, so read it from here rather than pinning it in realm configuration. Absent when the realm uses Keycloak’s default theme.
The realm’s own self-registration setting (Keycloak registrationAllowed), read live from the realm. It is the same field the realm API exposes as registration_allowed; branding keeps no copy of it.
Display a ‘Powered by Skycloak’ badge in the footer.
object
Show identity provider buttons on the login page.
Login page internationalization settings.
object
IETF BCP 47 language tag used as the default locale.
Locales available to users. Must include default_locale.
Timestamp of the most recent successful deployment to Keycloak.
Example
{
"realm": "customer-portal",
"primary_color": "#1a73e8",
"background_color": "#1a73e8",
"sso": {
"layout": "vertical",
"display_style": "logo_only",
"button_size": "small"
},
"internationalization": {
"language_selector_style": "dropdown",
"language_selector_position": "top_right",
"language_selection_mode": "automatic_with_selector"
},
"status": "applying"
}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"
}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"
}