Skip to content

Keycloak Admin REST API API

by keycloak.local

Bearer tokenHTTPSDevelopment
Open documentation ↗

Overview

This is a REST API reference for the Keycloak Admin

Keycloak Admin REST API is a development API from keycloak.local. Requests are authenticated with a bearer token. It is served over HTTPS. Its OpenAPI description documents 281 endpoints.

At a glance

Authentication
Bearer token
HTTPS
Yes
CORS
Unknown
Category
Development
Base URL
http://keycloak.local
Version
1
Endpoints
281
Spec updated
2021-07-05

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "http://keycloak.local/" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch("http://keycloak.local/", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "http://keycloak.local/",
    headers={
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/Get themes, social providers, auth providers, and event listeners available on this server
POST/Import a realm Imports a realm from a full representation of that realm.
GET/{id}/nameNeed this for admin console to display simple name of provider when displaying client detail KEYCLOAK-4328
GET/{realm}Get the top-level representation of the realm It will not include nested information like User and Client representations.
PUT/{realm}Update the top-level information of the realm Any user, roles or client information in the representation will be ignored.
DELETE/{realm}Delete the realm
GET/{realm}/admin-eventsGet admin events Returns all admin events, or filters events based on URL query parameters listed here
DELETE/{realm}/admin-eventsDelete all admin events
DELETE/{realm}/attack-detection/brute-force/usersClear any user login failures for all users This can release temporary disabled users
GET/{realm}/attack-detection/brute-force/users/{userId}Get status of a username in brute force detection
DELETE/{realm}/attack-detection/brute-force/users/{userId}Clear any user login failures for the user This can release temporary disabled user
GET/{realm}/authentication/authenticator-providersGet authenticator providers Returns a list of authenticator providers.
GET/{realm}/authentication/client-authenticator-providersGet client authenticator providers Returns a list of client authenticator providers.
GET/{realm}/authentication/config-description/{providerId}Get authenticator provider’s configuration description
GET/{realm}/authentication/config/{id}Get authenticator configuration
PUT/{realm}/authentication/config/{id}Update authenticator configuration
DELETE/{realm}/authentication/config/{id}Delete authenticator configuration
POST/{realm}/authentication/executionsAdd new authentication execution
GET/{realm}/authentication/executions/{executionId}Get Single Execution
DELETE/{realm}/authentication/executions/{executionId}Delete execution
POST/{realm}/authentication/executions/{executionId}/configUpdate execution with new configuration
POST/{realm}/authentication/executions/{executionId}/lower-priorityLower execution’s priority
POST/{realm}/authentication/executions/{executionId}/raise-priorityRaise execution’s priority
GET/{realm}/authentication/flowsGet authentication flows Returns a list of authentication flows.
POST/{realm}/authentication/flowsCreate a new authentication flow
POST/{realm}/authentication/flows/{flowAlias}/copyCopy existing authentication flow under a new name The new name is given as 'newName' attribute of the passed JSON object
GET/{realm}/authentication/flows/{flowAlias}/executionsGet authentication executions for a flow
PUT/{realm}/authentication/flows/{flowAlias}/executionsUpdate authentication executions of a flow
POST/{realm}/authentication/flows/{flowAlias}/executions/executionAdd new authentication execution to a flow
POST/{realm}/authentication/flows/{flowAlias}/executions/flowAdd new flow with new execution to existing flow
GET/{realm}/authentication/flows/{id}Get authentication flow for id
PUT/{realm}/authentication/flows/{id}Update an authentication flow
DELETE/{realm}/authentication/flows/{id}Delete an authentication flow
GET/{realm}/authentication/form-action-providersGet form action providers Returns a list of form action providers.
GET/{realm}/authentication/form-providersGet form providers Returns a list of form providers.
GET/{realm}/authentication/per-client-config-descriptionGet configuration descriptions for all clients
POST/{realm}/authentication/register-required-actionRegister a new required actions
GET/{realm}/authentication/required-actionsGet required actions Returns a list of required actions.
GET/{realm}/authentication/required-actions/{alias}Get required action for alias
PUT/{realm}/authentication/required-actions/{alias}Update required action
DELETE/{realm}/authentication/required-actions/{alias}Delete required action
POST/{realm}/authentication/required-actions/{alias}/lower-priorityLower required action’s priority
POST/{realm}/authentication/required-actions/{alias}/raise-priorityRaise required action’s priority
GET/{realm}/authentication/unregistered-required-actionsGet unregistered required actions Returns a list of unregistered required actions.
POST/{realm}/clear-keys-cacheClear cache of external public keys (Public keys of clients or Identity providers)
POST/{realm}/clear-realm-cacheClear realm cache
POST/{realm}/clear-user-cacheClear user cache
POST/{realm}/client-description-converterBase path for importing clients under this realm.
GET/{realm}/client-registration-policy/providersBase path for retrieve providers with the configProperties properly filled
GET/{realm}/client-scopesGet client scopes belonging to the realm Returns a list of client scopes belonging to the realm
POST/{realm}/client-scopesCreate a new client scope Client Scope’s name must be unique!
GET/{realm}/client-scopes/{id1}/protocol-mappers/models/{id2}Get mapper by id
PUT/{realm}/client-scopes/{id1}/protocol-mappers/models/{id2}Update the mapper
DELETE/{realm}/client-scopes/{id1}/protocol-mappers/models/{id2}Delete the mapper
GET/{realm}/client-scopes/{id}Get representation of the client scope
PUT/{realm}/client-scopes/{id}Update the client scope
DELETE/{realm}/client-scopes/{id}Delete the client scope
POST/{realm}/client-scopes/{id}/protocol-mappers/add-modelsCreate multiple mappers
GET/{realm}/client-scopes/{id}/protocol-mappers/modelsGet mappers
POST/{realm}/client-scopes/{id}/protocol-mappers/modelsCreate a mapper
GET/{realm}/client-scopes/{id}/protocol-mappers/protocol/{protocol}Get mappers by name for a specific protocol
GET/{realm}/client-scopes/{id}/scope-mappingsGet all scope mappings for the client
GET/{realm}/client-scopes/{id}/scope-mappings/clients/{client}Get the roles associated with a client’s scope Returns roles for the client.
POST/{realm}/client-scopes/{id}/scope-mappings/clients/{client}Add client-level roles to the client’s scope
DELETE/{realm}/client-scopes/{id}/scope-mappings/clients/{client}Remove client-level roles from the client’s scope.
GET/{realm}/client-scopes/{id}/scope-mappings/clients/{client}/availableThe available client-level roles Returns the roles for the client that can be associated with the client’s scope
GET/{realm}/client-scopes/{id}/scope-mappings/clients/{client}/compositeGet effective client roles Returns the roles for the client that are associated with the client’s scope.
GET/{realm}/client-scopes/{id}/scope-mappings/realmGet realm-level roles associated with the client’s scope
POST/{realm}/client-scopes/{id}/scope-mappings/realmAdd a set of realm-level roles to the client’s scope
DELETE/{realm}/client-scopes/{id}/scope-mappings/realmRemove a set of realm-level roles from the client’s scope
GET/{realm}/client-scopes/{id}/scope-mappings/realm/availableGet realm-level roles that are available to attach to this client’s scope
GET/{realm}/client-scopes/{id}/scope-mappings/realm/compositeGet effective realm-level roles associated with the client’s scope What this does is recurse any composite roles associated with the client’s scope and adds
GET/{realm}/client-session-statsGet client session stats Returns a JSON map.
GET/{realm}/clientsGet clients belonging to the realm Returns a list of clients belonging to the realm
POST/{realm}/clientsCreate a new client Client’s client_id must be unique!
GET/{realm}/clients-initial-access—
POST/{realm}/clients-initial-accessCreate a new initial access token.
DELETE/{realm}/clients-initial-access/{id}—
GET/{realm}/clients/{id1}/protocol-mappers/models/{id2}Get mapper by id
PUT/{realm}/clients/{id1}/protocol-mappers/models/{id2}Update the mapper
DELETE/{realm}/clients/{id1}/protocol-mappers/models/{id2}Delete the mapper
GET/{realm}/clients/{id}Get representation of the client
PUT/{realm}/clients/{id}Update the client
DELETE/{realm}/clients/{id}Delete the client
GET/{realm}/clients/{id}/certificates/{attr}Get key info
POST/{realm}/clients/{id}/certificates/{attr}/downloadGet a keystore file for the client, containing private key and public certificate
POST/{realm}/clients/{id}/certificates/{attr}/generateGenerate a new certificate with new key pair
POST/{realm}/clients/{id}/certificates/{attr}/generate-and-downloadGenerate a new keypair and certificate, and get the private key file Generates a keypair and certificate and serves the private key in a specified keystore fo
POST/{realm}/clients/{id}/certificates/{attr}/uploadUpload certificate and eventually private key
POST/{realm}/clients/{id}/certificates/{attr}/upload-certificateUpload only certificate, not private key
GET/{realm}/clients/{id}/client-secretGet the client secret
POST/{realm}/clients/{id}/client-secretGenerate a new secret for the client
GET/{realm}/clients/{id}/default-client-scopesGet default client scopes.
PUT/{realm}/clients/{id}/default-client-scopes/{clientScopeId}—
DELETE/{realm}/clients/{id}/default-client-scopes/{clientScopeId}—
GET/{realm}/clients/{id}/evaluate-scopes/generate-example-access-tokenCreate JSON with payload of example access token
GET/{realm}/clients/{id}/evaluate-scopes/protocol-mappersReturn list of all protocol mappers, which will be used when generating tokens issued for particular client.
GET/{realm}/clients/{id}/evaluate-scopes/scope-mappings/{roleContainerId}/grantedGet effective scope mapping of all roles of particular role container, which this client is defacto allowed to have in the accessToken issued for him.
GET/{realm}/clients/{id}/evaluate-scopes/scope-mappings/{roleContainerId}/not-grantedGet roles, which this client doesn’t have scope for and can’t have them in the accessToken issued for him.
GET/{realm}/clients/{id}/installation/providers/{providerId}—

Showing the first 100 of 281 endpoints; the full list is in the documentation.

Questions

Does the Keycloak Admin REST API API need an API key?

Yes. The Keycloak Admin REST API API uses Bearer token authentication; the documentation explains how to get credentials.

Does the Keycloak Admin REST API API support HTTPS?

Yes, the Keycloak Admin REST API API is served over HTTPS.

How many endpoints does the Keycloak Admin REST API API have?

Its OpenAPI description lists 281 endpoints in version 1. The first 100 are shown on this page.

What are alternatives to the Keycloak Admin REST API API?

Other Development APIs include Cloudflare, Azure DevOps, IPify, App Store Connect API, StackExchange.

Compare alternatives →

Listed from APIs.guru (CC0).