Keycloak Realms Admin API

The Realms Admin API from Keycloak — 28 operation(s) for realms admin.

GitHub OpenAPI

Operations 45

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /admin/realms List accessible realms · Get accessible realms Returns a list of accessible realms. #
Ask an LLM
“Which Keycloak realms can I administer?”
“Can I get a brief representation of each realm?”
Tell an agent
List all accessible realms.
Show realms with brief representation {brief}.
POST /admin/realms Import a realm · Import a realm. Imports a realm from a full representation of that realm #
Ask an LLM
“How do I import a realm from a full representation?”
“Is a realm name required to be unique when importing?”
Tell an agent
Import a realm from its full representation.
Create a new realm from a full realm import.
GET /admin/realms/{realm} Get a realm's top-level representation · Get the top-level representation of the realm It will not include nested… #
Ask an LLM
“What top-level settings does a realm have?”
“Can I read a realm's basic configuration without its nested resources?”
Tell an agent
Get the top-level representation of realm {realm}.
Show basic settings for realm {realm}.
PUT /admin/realms/{realm} Update a realm's top-level settings · Update the top-level information of the realm Any user, roles or client… #
Ask an LLM
“How do I change a realm's session timeouts or password policy?”
“Can I update top-level realm attributes without touching users or clients?”
Tell an agent
Update realm {realm} with display name {displayName}.
Set the session timeout for realm {realm} to {ssoSessionMaxLifespan}.
DELETE /admin/realms/{realm} Delete a realm · Delete the realm #
Ask an LLM
“How do I delete a realm?”
“Can I remove a realm I no longer need?”
Tell an agent destructive · confirm first
Delete realm {realm}.
Remove the {realm} realm.
GET /admin/realms/{realm}/admin-events List a realm's admin events · Get admin events Returns all admin events, or filters events based on URL query… #
Ask an LLM
“Who changed what in my realm recently?”
“Can I filter a realm's admin events by user or date?”
Tell an agent
List admin events for realm {realm}.
Show admin events in realm {realm} between {dateFrom} and {dateTo}.
DELETE /admin/realms/{realm}/admin-events Clear a realm's admin events · Delete all admin events #
Ask an LLM
“How do I clear all admin events from a realm?”
“Can I wipe the admin event log for a realm?”
Tell an agent destructive · confirm first
Clear all admin events for realm {realm}.
Delete the admin event log of realm {realm}.
POST /admin/realms/{realm}/client-description-converter Convert client descriptions for a realm · Base path for importing clients under this realm #
Ask an LLM
“How do I convert client descriptions into a format a realm can import?”
“Can I use the client description converter for a realm?”
Tell an agent
Convert client descriptions for realm {realm}.
Run the client description converter on realm {realm}.
GET /admin/realms/{realm}/client-policies/policies List client policies and global policies · Get admin realms by realm client policies policies #
Ask an LLM
“How do I list client policies for a realm?”
“Can I include global policies along with realm client policies?”
Tell an agent
List client policies for realm {realm}.
Show realm {realm} client policies including global policies: {includeGlobalPolicies}.
PUT /admin/realms/{realm}/client-policies/policies Replace a realm's client policies · Replace admin realms by realm client policies policies #
Ask an LLM
“How do I replace all client policies in a realm?”
“Can I set global client policies at the realm level?”
Tell an agent
Replace client policies in realm {realm} with {policies}.
Set realm {realm} client policies to {policies} and global policies to {global}.
GET /admin/realms/{realm}/client-policies/profiles List client policy profiles and global profiles · Get admin realms by realm client policies profiles #
Ask an LLM
“How do I list the client policy profiles available to a realm?”
“Can I include global client policy profiles in the list?”
Tell an agent
List client policy profiles for realm {realm}.
Show realm {realm} policy profiles including global profiles: {includeGlobalProfiles}.
PUT /admin/realms/{realm}/client-policies/profiles Replace a realm's client policy profiles · Replace admin realms by realm client policies profiles #
Ask an LLM
“How do I replace all client policy profiles in a realm?”
“Can I set global client policy profiles at the realm level?”
Tell an agent
Replace client policy profiles in realm {realm} with {profiles}.
Set realm {realm} client policy profiles to {profiles} and global profiles to {global}.
GET /admin/realms/{realm}/client-session-stats Get active client session counts · Get client session stats Returns a JSON map #
Ask an LLM
“How many active sessions does each client in my realm have?”
“Which clients are currently in use?”
Tell an agent
Get client session stats for realm {realm}.
Show active session counts per client in realm {realm}.
GET /admin/realms/{realm}/client-types List client types in a realm · List all client types available in the current realm #
Ask an LLM
“What client types are available in my realm?”
“Can I see the attributes each client type sets?”
Tell an agent
List client types for realm {realm}.
Show realm {realm} client types and their attributes.
PUT /admin/realms/{realm}/client-types Update a realm's client types · Update a client type #
Ask an LLM
“How do I update a realm-level client type?”
“Can I change the attributes a client type sets in my realm?”
Tell an agent
Update client types in realm {realm} with {types}.
Replace realm {realm} client types with {types} and global client types with {global}.
GET /admin/realms/{realm}/credential-registrators List credential registrators in a realm · Get admin realms by realm credential registrators #
Ask an LLM
“Which credential registrators are configured in my realm?”
“What credential types can users register?”
Tell an agent
List credential registrators for realm {realm}.
Show the credential registrators in realm {realm}.
GET /admin/realms/{realm}/default-default-client-scopes List default client scopes in a realm · Get realm default client scopes. Only name and ids are returned #
Ask an LLM
“Which client scopes are included by default in my realm?”
“Can I see only the names and IDs of default client scopes?”
Tell an agent
List default client scopes for realm {realm}.
Show realm {realm} default client scopes with names and IDs.
PUT /admin/realms/{realm}/default-default-client-scopes/{clientScopeId} Add a client scope to a realm's defaults · Replace admin realms by realm default default client scopes by client scope id #
Ask an LLM
“How do I add a client scope to a realm's default client scopes?”
“Can I include a client scope in every new client of a realm?”
Tell an agent
Add client scope {clientScopeId} to default client scopes of realm {realm}.
Make realm {realm} include client scope {clientScopeId} by default.
DELETE /admin/realms/{realm}/default-default-client-scopes/{clientScopeId} Remove a client scope from a realm's defaults · Delete admin realms by realm default default client scopes by client scope id #
Ask an LLM
“How do I stop a client scope from being included by default in a realm?”
“Can I remove a default client scope from a realm?”
Tell an agent destructive · confirm first
Remove client scope {clientScopeId} from default client scopes of realm {realm}.
Stop realm {realm} from including client scope {clientScopeId} by default.
GET /admin/realms/{realm}/default-groups List default groups in a realm · Get group hierarchy. Only name and ids are returned #
Ask an LLM
“Which groups are included by default in my realm?”
“Can I see only the names and IDs of default groups?”
Tell an agent
List default groups for realm {realm}.
Show realm {realm} default groups with names and IDs.
PUT /admin/realms/{realm}/default-groups/{groupId} Make a group a default group · Replace admin realms by realm default groups by group id #
Ask an LLM
“How do I make a group a default group in a realm?”
“Can I set which groups new users are added to by default?”
Tell an agent
Make group {groupId} a default group in realm {realm}.
Set default group {groupId} for realm {realm}.
DELETE /admin/realms/{realm}/default-groups/{groupId} Remove a group from default groups · Delete admin realms by realm default groups by group id #
Ask an LLM
“How do I stop a group from being a default group?”
“Can I remove a group from the default group list?”
Tell an agent destructive · confirm first
Remove group {groupId} from default groups in realm {realm}.
Stop default group {groupId} in realm {realm}.
GET /admin/realms/{realm}/default-optional-client-scopes List optional client scopes · Get realm optional client scopes. Only name and ids are returned #
Ask an LLM
“Which optional client scopes are set on a realm?”
“What client scopes are optional for a realm?”
Tell an agent
List the optional client scopes on realm {realm}.
Show optional client scopes for realm {realm}.
PUT /admin/realms/{realm}/default-optional-client-scopes/{clientScopeId} Set a client scope as optional · Replace admin realms by realm default optional client scopes by client scope id #
Ask an LLM
“How do I make a client scope optional on a realm?”
“Can I replace the optional client scopes for a realm?”
Tell an agent
Set client scope {clientScopeId} as optional on realm {realm}.
Make optional client scope {clientScopeId} the only optional scope for realm {realm}.
DELETE /admin/realms/{realm}/default-optional-client-scopes/{clientScopeId} Remove a client scope from optional · Delete admin realms by realm default optional client scopes by client scope id #
Ask an LLM
“How do I stop a client scope from being optional?”
“Can I remove one optional client scope from a realm?”
Tell an agent destructive · confirm first
Remove client scope {clientScopeId} from optional client scopes in realm {realm}.
Stop optional client scope {clientScopeId} on realm {realm}.
GET /admin/realms/{realm}/events List realm login and admin events · Get events Returns all events, or filters them based on URL query parameters… #
Ask an LLM
“What login and admin events happened in a realm?”
“Can I filter realm events by user, IP or type?”
Tell an agent
List events in realm {realm}.
Show realm {realm} events for user {user}.
DELETE /admin/realms/{realm}/events Delete all event logs for a realm · Delete all events #
Ask an LLM
“How do I clear every event log recorded for a realm?”
“Can I wipe a realm's event history?”
Tell an agent destructive · confirm first
Delete all event logs for realm {realm}.
Purge the event history of realm {realm}.
GET /admin/realms/{realm}/events/config Get realm event settings · Get the events provider configuration Returns JSON object with events provider… #
Ask an LLM
“Which event types are enabled in a realm?”
“What event listeners and expiration are configured for a realm?”
Tell an agent
Show the event configuration for realm {realm}.
Get enabled event types and listeners for realm {realm}.
PUT /admin/realms/{realm}/events/config Update realm event settings · Replace admin realms by realm events config #
Ask an LLM
“How do I turn on admin events or change event expiration?”
“Can I change which event types a realm logs?”
Tell an agent
Enable admin events in realm {realm} with events enabled {eventsEnabled}.
Set event expiration to {eventsExpiration} milliseconds in realm {realm}.
GET /admin/realms/{realm}/group-by-path/{path} Look up a group by its path · Get admin realms by realm group by path by path #
Ask an LLM
“How do I find a group by its path in a realm?”
“Can I resolve a group path to its group?”
Tell an agent
Get the group at path {path} in realm {realm}.
Look up group {path} in realm {realm}.
GET /admin/realms/{realm}/localization List a realm's localization locales · Get admin realms by realm localization #
Ask an LLM
“Which languages are supported by a realm's localization?”
“What localization locales exist for a realm?”
Tell an agent
List localization locales for realm {realm}.
Show supported languages in realm {realm} localization.
GET /admin/realms/{realm}/localization/{locale} Get a realm's localization for one language · Get admin realms by realm localization by locale #
Ask an LLM
“How do I read the localized strings for one language in a realm?”
“Can I get a realm's localization fallback behavior for a locale?”
Tell an agent
Get localization for locale {locale} in realm {realm}.
Show realm {realm} localization for {locale} with fallback {useRealmDefaultLocaleFallback}.
POST /admin/realms/{realm}/localization/{locale} Import localization for a language · Import localization from uploaded JSON file #
Ask an LLM
“How do I import a JSON localization file for a language?”
“Can I add a new language to a realm's localization?”
Tell an agent
Import localization for locale {locale} in realm {realm}.
Load the {locale} localization JSON file into realm {realm}.
DELETE /admin/realms/{realm}/localization/{locale} Delete a realm's localization for a language · Delete admin realms by realm localization by locale #
Ask an LLM
“How do I remove a language from a realm's localization?”
“Can I delete localization for one locale?”
Tell an agent destructive · confirm first
Delete localization for locale {locale} in realm {realm}.
Remove the {locale} localization from realm {realm}.
GET /admin/realms/{realm}/localization/{locale}/{key} Get one localized string · Get admin realms by realm localization by locale by key #
Ask an LLM
“How do I read a single localized string for a language?”
“Can I fetch one key's translation in a realm's localization?”
Tell an agent
Get the {locale} translation of key {key} in realm {realm}.
Show localized string {key} for {locale} in realm {realm}.
PUT /admin/realms/{realm}/localization/{locale}/{key} Replace a localized string · Replace admin realms by realm localization by locale by key #
Ask an LLM
“How do I change a single localized string in a language?”
“Can I overwrite one key's translation in a realm's localization?”
Tell an agent
Replace the {locale} translation of key {key} in realm {realm}.
Update localized string {key} for {locale} in realm {realm}.
DELETE /admin/realms/{realm}/localization/{locale}/{key} Delete a localized string · Delete admin realms by realm localization by locale by key #
Ask an LLM
“How do I remove a single localized string?”
“Can I delete one key's translation from a realm's localization?”
Tell an agent destructive · confirm first
Delete the {locale} translation of key {key} in realm {realm}.
Remove localized string {key} for {locale} in realm {realm}.
POST /admin/realms/{realm}/logout-all Log out all users in a realm · Removes all user sessions #
Ask an LLM
“How do I force every user out of a realm?”
“Can I invalidate all sessions in a realm at once?”
Tell an agent destructive · confirm first
Log out all users in realm {realm}.
Invalidate every session in realm {realm}.
POST /admin/realms/{realm}/partial-export Export part of a realm to JSON · Partial export of existing realm into a JSON file #
Ask an LLM
“How do I export only clients or groups from a realm?”
“Can I create a partial JSON export of a realm?”
Tell an agent
Export only clients from realm {realm}.
Export realm {realm} with clients {exportClients} and groups {exportGroupsAndRoles}.
POST /admin/realms/{realm}/partialImport Import part of a realm from JSON · Partial import from a JSON file to an existing realm #
Ask an LLM
“How do I import only clients or groups into an existing realm?”
“Can I load a partial JSON export back into a realm?”
Tell an agent
Import partial JSON into realm {realm}.
Load only clients and groups from a JSON file into realm {realm}.
POST /admin/realms/{realm}/push-revocation Push the revocation policy to clients · Push the realm's revocation policy to any client that has an admin url… #
Ask an LLM
“How do I push the current revocation policy to every client that has an admin URL?”
“Can I force a client to invalidate a session right away?”
Tell an agent
Push the revocation policy for realm {realm} to all clients with an admin URL.
Invalidate the session on every client that has an admin URL for realm {realm}.
DELETE /admin/realms/{realm}/sessions/{session} Invalidate one user session · Remove a specific user session #
Ask an LLM
“How do I log out a single user from one browser session?”
“Can I invalidate a session on a client that has an admin URL?”
Tell an agent destructive · confirm first
Remove session {session} from realm {realm}.
Invalidate session {session} on realm {realm} for offline {isOffline}.
POST /admin/realms/{realm}/testSMTPConnection Test the realm's SMTP connection · Test SMTP connection with current logged in user #
Ask an LLM
“How do I check that email sending works in my realm?”
“Can I test the SMTP settings with the current user's credentials?”
Tell an agent
Test the SMTP connection for realm {realm}.
Send a test email with SMTP config {config} in realm {realm}.
GET /admin/realms/{realm}/users-management-permissions Get users management permissions · Get admin realms by realm users management permissions #
Ask an LLM
“Which users management permissions are enabled in my realm?”
“What scope permissions does user management have?”
Tell an agent
Get users management permissions for realm {realm}.
Show the enabled users management permissions in realm {realm}.
PUT /admin/realms/{realm}/users-management-permissions Replace users management permissions · Replace admin realms by realm users management permissions #
Ask an LLM
“How do I change which users management permissions are enabled?”
“Can I set the scope permissions for user management?”
Tell an agent
Replace users management permissions in realm {realm} with enabled {enabled}.
Set scope permissions {scopePermissions} for user management in realm {realm}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/keycloak:keycloak-realms-admin-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

keycloak-realms-admin-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Keycloak Admin REST Realms Admin API
  description: This is a REST API reference for the Keycloak Admin REST API.
  version: '1.0'
tags:


# --- truncated at 32 KB (85 KB total) ---
# Full source: https://artifacts.apis.io/keycloak/openapi/keycloak-realms-admin-api-openapi.yml