Replace the cluster's feature flags
const url = 'http://localhost:8000/clusters/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/features';
const options = {
method: 'PUT',
headers: {
'API-Version': '2026-06-01.beta',
'API-Key': '<API-Key>',
'Content-Type': 'application/json'
},
body: '{"features":["token-exchange"],"apply_now":false}'
};
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/features \
--header 'API-Key: <API-Key>' \
--header 'API-Version: 2026-06-01.beta' \
--header 'Content-Type: application/json' \
--data '{ "features": [ "token-exchange" ], "apply_now": false }'Replaces the cluster’s whole set of enabled feature flags; flags left out are turned off. Flags that only Skycloak can set are left as they are. A change restarts Keycloak, and the response says so.
When the cluster has a maintenance window the change stays pending until the window opens. Set apply_now
to restart at once. A cluster without a maintenance window applies the change at once. A request that leaves
the set as it was restarts nothing, unless a change is still pending: the response then reports that change, and
apply_now restarts at once. A cluster that is updating for another reason is reported the same way.
Returns 422 when a flag is unknown or the cluster’s Keycloak version is below the flag’s minimum version,
403 when a trial workspace has not been approved to change flags, and 409 when the cluster is not
available.
Required scope: clusters:write
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Replaces the cluster’s whole set of enabled feature flags.
object
The complete set of enabled feature flags. Flags missing from the list are turned off. Flags that only Skycloak can set and that are already on the cluster are ignored; other flags outside the list from GET /cluster-features are refused.
Restart Keycloak at once instead of waiting for the cluster’s maintenance window. Has no effect on a cluster without a maintenance window, which always applies at once. Defaults to false.
Example
{
"features": [
"token-exchange"
],
"apply_now": false
}Responses
Section titled “Responses”The request has succeeded.
Outcome of replacing a cluster’s feature flags.
object
The enabled feature flags after the change.
True when the change restarts Keycloak, including a change from an earlier request that is still pending. False when the request left the set as it was and nothing is pending.
Whether the restart is pending for the maintenance window or applying now. Absent when nothing restarts.
object
Where a Keycloak feature flag change stands.
When the maintenance window next opens. Present for a pending change whose window could be resolved.
Customer-facing description of how disruptive the restart is for this cluster’s size. Absent when nothing restarts.
Example
{
"change": {
"state": "pending"
}
}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 request conflicts with the current state of the server.
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"
}