Keycloak Users API

Manage users within a realm

GitHub OpenAPI
Business capability
Identity & Access Management BC-620.20

Operations 34

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/{realm}/users List users in a realm · Get users Returns a stream of users, filtered according to query parameters #
Ask an LLM
“How do I list all users in a Keycloak realm?”
“Can I list only the users who have verified emails?”
Tell an agent
List all users in realm {realm}.
List users in {realm} with verified email {emailVerified}.
POST /admin/realms/{realm}/users Create a user in a realm · Create a new user Username must be unique #
Ask an LLM
“How do I create a new user in a realm?”
“Can I set a username, email and password when creating a user?”
Tell an agent
Create a user {username} in realm {realm}.
Add a new user {username} with email {email} to {realm}.
GET /admin/realms/{realm}/users/count Count users in a realm · Returns the number of users that match the given criteria #
Ask an LLM
“How many users are in a realm?”
“Can I count only enabled users?”
Tell an agent
Count the users in realm {realm}.
Count enabled users in {realm}.
GET /admin/realms/{realm}/users/profile Get the user profile configuration · Get admin realms by realm users profile #
Ask an LLM
“What attributes are included in the user profile?”
“How do I see the user profile metadata?”
Tell an agent
Show the user profile configuration for realm {realm}.
Get the user profile metadata of {realm}.
PUT /admin/realms/{realm}/users/profile Set the user profile configuration · Replace admin realms by realm users profile #
Ask an LLM
“How do I change which attributes are on the user profile?”
“Can I set the user profile metadata?”
Tell an agent
Set the user profile attributes in {realm} to {attributes}.
Update the user profile metadata of {realm} to {unmanagedAttributePolicy}.
GET /admin/realms/{realm}/users/profile/metadata Get user profile metadata · Get admin realms by realm users profile metadata #
Ask an LLM
“What does the user profile metadata contain?”
“How do I read the user profile metadata of a realm?”
Tell an agent
Get the user profile metadata for realm {realm}.
Show the user profile metadata of {realm}.
GET /admin/realms/{realm}/users/{user-id} Get a user's profile · Get representation of the user #
Ask an LLM
“How do I read one user's profile?”
“Can I include the user profile metadata in a user read?”
Tell an agent
Get user {user-id} in realm {realm}.
Show user {user-id} in {realm} with profile metadata {userProfileMetadata}.
PUT /admin/realms/{realm}/users/{user-id} Update a user's profile · Update the user #
Ask an LLM
“How do I update a user's email or name?”
“Can I change a user's enabled status?”
Tell an agent
Update user {user-id} in {realm} with email {email}.
Set enabled to {enabled} for user {user-id} in {realm}.
DELETE /admin/realms/{realm}/users/{user-id} Delete a user · Delete the user #
Ask an LLM
“How do I delete a user from a realm?”
“Can I remove a user by ID?”
Tell an agent destructive · confirm first
Delete user {user-id} from realm {realm}.
Remove user {user-id} in {realm}.
GET /admin/realms/{realm}/users/{user-id}/configured-user-storage-credential-types List credential types from user storage · Return credential types, which are provided by the user storage where user is… #
Ask an LLM
“Which credential types are configured for a user backed by user storage?”
“Why does a local user return no configured credential types?”
Tell an agent
List configured credential types for user {user-id} in {realm}.
Show the credential types user {user-id} in {realm} gets from user storage.
GET /admin/realms/{realm}/users/{user-id}/consents List a user's client consents · Get consents granted by the user #
Ask an LLM
“Which clients has a user consented to?”
“Can I see a user's granted client consents?”
Tell an agent
List the consents granted by user {user-id} in {realm}.
Show which clients user {user-id} in {realm} has consented to.
DELETE /admin/realms/{realm}/users/{user-id}/consents/{client} Revoke a user's consent to a client · Revoke consent and offline tokens for particular client from user #
Ask an LLM
“How do I revoke a user's consent to a particular client?”
“Can I remove a user's offline tokens for one client?”
Tell an agent destructive · confirm first
Revoke user {user-id}'s consent to client {client} in {realm}.
Remove the consent and offline tokens for client {client} from user {user-id} in {realm}.
GET /admin/realms/{realm}/users/{user-id}/credentials List a user's credentials · Get admin realms by realm users by user id credentials #
Ask an LLM
“What credentials does a user have?”
“Can I see a user's stored passwords and OTPs?”
Tell an agent
List the credentials of user {user-id} in {realm}.
Show the stored credentials for user {user-id} in {realm}.
DELETE /admin/realms/{realm}/users/{user-id}/credentials/{credentialId} Remove a user's credential · Remove a credential for a user #
Ask an LLM
“How do I remove one credential from a user?”
“Can I delete a stored password by its ID?”
Tell an agent destructive · confirm first
Remove credential {credentialId} from user {user-id} in {realm}.
Delete stored credential {credentialId} of user {user-id} in {realm}.
POST /admin/realms/{realm}/users/{user-id}/credentials/{credentialId}/moveAfter/{newPreviousCredentialId} Move a user's credential behind another · Move a credential to a position behind another credential #
Ask an LLM
“How do I reorder a user's credentials?”
“Can I put a credential right after another one?”
Tell an agent
Move credential {credentialId} of user {user-id} in {realm} right after credential {newPreviousCredentialId}.
Reposition credential {credentialId} for user {user-id} in {realm} behind {newPreviousCredentialId}.
POST /admin/realms/{realm}/users/{user-id}/credentials/{credentialId}/moveToFirst Move a user's credential to the top · Move a credential to a first position in the credentials list of the user #
Ask an LLM
“How do I make one credential the first one a user has?”
“Can I put a credential at the very top of the list?”
Tell an agent
Move credential {credentialId} of user {user-id} in {realm} to the first position.
Put credential {credentialId} at the top of user {user-id}'s credential list in {realm}.
PUT /admin/realms/{realm}/users/{user-id}/credentials/{credentialId}/userLabel Rename a user's credential label · Update a credential label for a user #
Ask an LLM
“How do I change the label shown for a credential?”
“Can I rename a stored password?”
Tell an agent
Set the user label of credential {credentialId} for user {user-id} in {realm}.
Rename credential {credentialId} of user {user-id} in {realm}.
PUT /admin/realms/{realm}/users/{user-id}/disable-credential-types Disable a user's credentials of a given type · Disable all credentials for a user of a specific type #
Ask an LLM
“How do I turn off all of a user's credentials of one type in Keycloak?”
“Can I disable a user's configured credentials without deleting the user?”
Tell an agent destructive · confirm first
Disable the credential types for user {user} in realm {realm}.
Turn off the configured credentials of user {user} in {realm}.
PUT /admin/realms/{realm}/users/{user-id}/execute-actions-email Send a user an email with required actions · Send an email to the user with a link they can click to execute particular… #
Ask an LLM
“How do I send a user an email to reset their password?”
“Can I include a redirect URI in the action email?”
Tell an agent
Send an email with required actions to user {user-id} in {realm}.
Email user {user-id} in {realm} a link to complete actions, redirecting to {redirect_uri}.
GET /admin/realms/{realm}/users/{user-id}/federated-identity List a user's social logins · Get social logins associated with the user #
Ask an LLM
“Which social logins are linked to a user?”
“Can I see a user's federated identities?”
Tell an agent
List the social logins for user {user-id} in {realm}.
Show the federated identities of user {user-id} in {realm}.
POST /admin/realms/{realm}/users/{user-id}/federated-identity/{provider} Link a social login to a user · Add a social login provider to the user #
Ask an LLM
“How do I connect a Google or Facebook login to a user?”
“Can I link a federated identity provider to an existing user?”
Tell an agent
Link {provider} to user {user} in realm {realm}.
Add social login {provider} for user {user} in {realm} with identity {identity}.
DELETE /admin/realms/{realm}/users/{user-id}/federated-identity/{provider} Remove a social login from a user · Remove a social login provider from user #
Ask an LLM
“How do I unlink a social login from a user?”
“Can I disconnect a federated identity provider from a user?”
Tell an agent destructive · confirm first
Remove {provider} from user {user} in realm {realm}.
Unlink social login {provider} for user {user} in {realm}.
GET /admin/realms/{realm}/users/{user-id}/groups List a user's groups · Get admin realms by realm users by user id groups #
Ask an LLM
“Which groups is a user a member of?”
“Can I search a user's group memberships?”
Tell an agent
List groups for user {user} in realm {realm}.
Find groups user {user} belongs to in {realm} matching {search}.
GET /admin/realms/{realm}/users/{user-id}/groups/count Count a user's groups · Get admin realms by realm users by user id groups count #
Ask an LLM
“How many groups is a user in?”
“Can I get just the group count for a user?”
Tell an agent
Count groups for user {user} in realm {realm}.
Tell me how many groups user {user} is in within {realm}.
PUT /admin/realms/{realm}/users/{user-id}/groups/{groupId} Replace a user's group membership · Replace admin realms by realm users by user id groups by group id #
Ask an LLM
“How do I set exactly which group a user belongs to?”
“Can I overwrite a user's group membership with one group?”
Tell an agent
Set user {user} in realm {realm} to group {group}.
Replace user {user}'s group membership with {group} in {realm}.
DELETE /admin/realms/{realm}/users/{user-id}/groups/{groupId} Remove a user from a group · Delete admin realms by realm users by user id groups by group id #
Ask an LLM
“How do I take a user out of one group?”
“Can I remove a single group membership from a user?”
Tell an agent destructive · confirm first
Remove user {user} from group {group} in realm {realm}.
Take user {user} out of group {group} in {realm}.
POST /admin/realms/{realm}/users/{user-id}/impersonation Impersonate a user · Impersonate the user #
Ask an LLM
“How do I log in as another user?”
“Can I impersonate a user to test their access?”
Tell an agent
Impersonate user {user} in realm {realm}.
Log in as user {user} in {realm} as an admin.
POST /admin/realms/{realm}/users/{user-id}/logout End all sessions for a user · Remove all user sessions associated with the user Also send notification to all… #
Ask an LLM
“How do I force a user to log out everywhere?”
“Can I clear every session a user has?”
Tell an agent destructive · confirm first
Log out user {user} in realm {realm} from all devices.
End all sessions for user {user} in {realm}.
GET /admin/realms/{realm}/users/{user-id}/offline-sessions/{clientUuid} Get a user's offline sessions for a client · Get offline sessions associated with the user and client #
Ask an LLM
“Which offline sessions does a user have for a client?”
“Can I see a user's cached client sessions?”
Tell an agent
Get offline sessions for user {user} in realm {realm} with client {client}.
Show user {user}'s cached sessions for client {client} in {realm}.
PUT /admin/realms/{realm}/users/{user-id}/reset-password Set a user's password · Set up a new password for the user #
Ask an LLM
“How do I set a new password for a user?”
“Can I set a temporary password for a user?”
Tell an agent
Set a new password for user {user} in realm {realm}.
Set user {user}'s password in {realm} to {value}.
PUT /admin/realms/{realm}/users/{user-id}/reset-password-email Send a password reset email to a user · Send an email to the user with a link they can click to reset their password #
Ask an LLM
“How do I send a user a link to reset their password?”
“Can I send a password reset email from a specific client?”
Tell an agent
Send a password reset email to user {user} in realm {realm}.
Email user {user} a password reset link from client {client} in {realm}.
PUT /admin/realms/{realm}/users/{user-id}/send-verify-email Send a user email verification · Send an email-verification email to the user An email contains a link the user… #
Ask an LLM
“How do I resend a user's email verification?”
“Can I change how long an email verification link stays valid?”
Tell an agent
Send an email verification to user {user} in realm {realm}.
Send user {user} a verification email in {realm} valid for {lifespan} seconds.
GET /admin/realms/{realm}/users/{user-id}/sessions List a user's sessions · Get sessions associated with the user #
Ask an LLM
“Which sessions is a user currently logged in with?”
“Can I see a user's active sessions?”
Tell an agent
List sessions for user {user} in realm {realm}.
Show active sessions of user {user} in {realm}.
GET /admin/realms/{realm}/users/{user-id}/unmanagedAttributes Get a user's unmanaged attributes · Get admin realms by realm users by user id unmanaged attributes #
Ask an LLM
“What unmanaged attributes are stored on a user?”
“Can I read a user's unmanaged attributes?”
Tell an agent
Get unmanaged attributes for user {user} in realm {realm}.
Show the unmanaged attributes on user {user} in {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-users-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-users-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Keycloak Admin REST Users API
  description: This is a REST API reference for the Keycloak Admin REST API.
  version: '1.0'
tags:


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