Skip to content

Upload a password blacklist file

POST
/clusters/{cluster_id}/password-blacklist-files
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=@file

Uploads 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

cluster_id
required
string format: uuid
API-Version
required
string
Allowed values: 2026-06-01.beta
Media typemultipart/form-data
object
name
required

Name of the file on the cluster. Letters, digits, dot, dash and underscore only, up to 255 characters, and unique on the cluster.

string
apply_now

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.

boolean
file
required

The file content, one password per line. Up to 25 MB.

string format: binary

The request has succeeded and a new resource has been created as a result.

Media typeapplication/json

A password blacklist file kept for a dedicated cluster. Files cannot be changed: new content needs a new name.

object
name
required

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>).

string
>= 1 characters <= 255 characters /^([A-Za-z0-9_-][A-Za-z0-9._-]*|\.[A-Za-z0-9_-][A-Za-z0-9._-]*|\.\.[A-Za-z0-9._-]+)$/
size
required

Size of the file in bytes.

integer format: int64
sha256
required

Hex-encoded SHA-256 of the file content.

string
status
required
string
Allowed values: waiting_for_restart delivering ready failed
created_at
required
string format: date-time
updated_at
required
string format: date-time

Example

{
  "status": "waiting_for_restart"
}

The server could not understand the request due to invalid syntax.

Media typeapplication/problem+json

RFC 9457 Problem Details object.

object
type
required
string format: uri
title
required
string
status
required
integer
detail
required
string
instance
string format: uri

Example generated

{
  "type": "https://example.com",
  "title": "example",
  "status": 1,
  "detail": "example",
  "instance": "https://example.com"
}

Access is unauthorized.

Media typeapplication/problem+json

RFC 9457 Problem Details object.

object
type
required
string format: uri
title
required
string
status
required
integer
detail
required
string
instance
string format: uri

Example generated

{
  "type": "https://example.com",
  "title": "example",
  "status": 1,
  "detail": "example",
  "instance": "https://example.com"
}

Access is forbidden.

Media typeapplication/problem+json

RFC 9457 Problem Details object.

object
type
required
string format: uri
title
required
string
status
required
integer
detail
required
string
instance
string format: uri

Example generated

{
  "type": "https://example.com",
  "title": "example",
  "status": 1,
  "detail": "example",
  "instance": "https://example.com"
}

The server cannot find the requested resource.

Media typeapplication/problem+json

RFC 9457 Problem Details object.

object
type
required
string format: uri
title
required
string
status
required
integer
detail
required
string
instance
string format: uri

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.

Media typeapplication/problem+json

RFC 9457 Problem Details object.

object
type
required
string format: uri
title
required
string
status
required
integer
detail
required
string
instance
string format: uri

Example generated

{
  "type": "https://example.com",
  "title": "example",
  "status": 1,
  "detail": "example",
  "instance": "https://example.com"
}

The file is larger than the upload limit.

Media typeapplication/problem+json

RFC 9457 Problem Details object.

object
type
required
string format: uri
title
required
string
status
required
integer
detail
required
string
instance
string format: uri

Example generated

{
  "type": "https://example.com",
  "title": "example",
  "status": 1,
  "detail": "example",
  "instance": "https://example.com"
}

Client error

Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
detail
required
string
instance
string format: uri
errors
required
Array<object>
>= 1 items
object
field
required
string
detail
required
string
code
string
value

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

Media typeapplication/problem+json

RFC 9457 Problem Details object.

object
type
required
string format: uri
title
required
string
status
required
integer
detail
required
string
instance
string format: uri

Example generated

{
  "type": "https://example.com",
  "title": "example",
  "status": 1,
  "detail": "example",
  "instance": "https://example.com"
}
Retry-After
integer
RateLimit-Limit
integer
RateLimit-Remaining
integer
RateLimit-Reset
integer
X-RateLimit-Limit-Second
integer
X-RateLimit-Remaining-Second
integer
X-RateLimit-Limit-Minute
integer
X-RateLimit-Remaining-Minute
integer
X-RateLimit-Limit-Hour
integer
X-RateLimit-Remaining-Hour
integer
X-RateLimit-Limit-Day
integer
X-RateLimit-Remaining-Day
integer

Server error

Media typeapplication/problem+json

RFC 9457 Problem Details object.

object
type
required
string format: uri
title
required
string
status
required
integer
detail
required
string
instance
string format: uri

Example generated

{
  "type": "https://example.com",
  "title": "example",
  "status": 1,
  "detail": "example",
  "instance": "https://example.com"
}

Server error

Media typeapplication/problem+json

RFC 9457 Problem Details object.

object
type
required
string format: uri
title
required
string
status
required
integer
detail
required
string
instance
string format: uri

Example generated

{
  "type": "https://example.com",
  "title": "example",
  "status": 1,
  "detail": "example",
  "instance": "https://example.com"
}