Upload a password blacklist file
const url = 'http://localhost:8000/clusters/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/password-blacklist-files';
const form = new FormData();
form.append('name', 'example');
form.append('apply_now', 'true');
form.append('file', 'file');
const options = {
method: 'POST',
headers: {'API-Version': '2026-06-01.beta', 'API-Key': '<API-Key>'}
};
options.body = form;
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}curl --request POST \
--url http://localhost:8000/clusters/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/password-blacklist-files \
--header 'API-Key: <API-Key>' \
--header 'API-Version: 2026-06-01.beta' \
--header 'Content-Type: multipart/form-data' \
--form name=example \
--form apply_now=true \
--form file=@fileUploads a password blacklist file to a dedicated cluster, for Keycloak’s passwordBlacklist(<name>) realm password policy.
Shared trial realms need a dedicated cluster first.
The first file on a cluster adds a small persistent folder to the Keycloak pods, which takes a restart. By default the restart
waits for the cluster’s maintenance window and the file shows waiting_for_restart until then. Set apply_now to restart at once.
Later files on a cluster that already has the folder need no restart.
Files cannot be changed after upload: new content needs a new name. A cluster holds at most 10 files of up to 25 MB each. Maximum body size is 25 MB plus the multipart overhead.
Once the file is ready, set the realm password policy passwordBlacklist(<name>) to use it.
Required scope: clusters:password-blacklists: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”object
Name of the file on the cluster. Letters, digits, dot, dash and underscore only, up to 255 characters, and unique on the cluster.
When true, the restart that adds the folder runs at once instead of in the maintenance window. Sent as a plain-text multipart field (true or false). Defaults to false. It only matters for the first file on a cluster, or while an earlier file is still waiting for the restart. It is refused with 422 when applying now is not available for the cluster.
The file content, one password per line. Up to 25 MB.
Responses
Section titled “Responses”The request has succeeded and a new resource has been created as a result.
A password blacklist file kept for a dedicated cluster. Files cannot be changed: new content needs a new name.
object
Name of a password blacklist file: letters, digits, dot, dash and underscore, up to 255 characters. It is the name a realm password policy refers to, as in passwordBlacklist(<name>).
Size of the file in bytes.
Hex-encoded SHA-256 of the file content.
Example
{
"status": "waiting_for_restart"
}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"
}The file is larger than the upload limit.
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"
}