Skip to content

Create a realm

POST
/clusters/{cluster_id}/realms
curl --request POST \
  --url http://localhost:8000/clusters/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/realms \
  --header 'API-Key: <API-Key>' \
  --header 'API-Version: 2026-06-01.beta' \
  --header 'Content-Type: application/json' \
  --data '{ "name": "customer-portal", "display_name": "Customer Portal" }'

Creates a new realm in the specified cluster. The cluster must be in the available state.

Required scope: realms:write

cluster_id
required
string format: uuid
API-Version
required
string
Allowed values: 2026-06-01.beta
Media typeapplication/json

Request body for creating a realm. If display_name is omitted, the realm name is used.

object
name
required
string
>= 1 characters <= 63 characters /^[a-zA-Z][a-zA-Z0-9-]*$/

Example

customer-portal
display_name

Human-friendly name for the realm. Defaults to name when omitted.

string
>= 1 characters <= 255 characters

Example

Customer Portal
apply_default_branding

Whether to apply Skycloak’s default login branding to the new realm. Defaults to true when omitted, so the realm serves the Skycloak look instead of the stock Keycloak login page. Set to false to leave the realm’s themes untouched. Branding can always be applied or reset later from the realm’s Branding page.

boolean
default: true

Example

true

Example

{
  "name": "customer-portal",
  "display_name": "Customer Portal"
}

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

Media typeapplication/json

Realm details returned when a realm is created.

object
id
required
string format: uuid
name
required
string
>= 1 characters <= 63 characters /^[a-zA-Z][a-zA-Z0-9-]*$/
display_name
required
string
>= 1 characters <= 255 characters
enabled
required

Whether users can sign in to this realm.

boolean
ssl_required
required

Keycloak SSL requirement. Maps directly to Keycloak’s sslRequired realm setting.

string
Allowed values: external all none
registration_allowed
required

Whether self-registration is open to anyone.

boolean
registration_email_as_username
required

Whether email addresses are used as usernames during registration.

boolean
login_with_email_allowed
required

Whether users can sign in with their email address instead of username.

boolean
duplicate_emails_allowed
required

Whether multiple accounts may share the same email address.

boolean
created_at

Time when the realm was created, when available.

string format: date-time
default_branding_applied

Whether Skycloak’s default login branding was applied to the realm as part of this create. false when apply_default_branding was set to false, and also when the branding step failed: the realm is created either way, and branding can be applied from the realm’s Branding page.

boolean

Example

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "customer-portal",
  "display_name": "Customer Portal",
  "enabled": true,
  "ssl_required": "external",
  "registration_allowed": false,
  "registration_email_as_username": false,
  "login_with_email_allowed": true,
  "duplicate_emails_allowed": false,
  "default_branding_applied": true
}

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"
}

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"
}