Keycloak Client Role Mappings API

The Client Role Mappings API from Keycloak — 9 operation(s) for client role mappings.

GitHub OpenAPI

Operations 15

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}/groups/{group-id}/role-mappings/clients/{client-id} List a group's client-level role mappings · Get client-level role mappings for the user or group, and the app #
Ask an LLM
“Which roles are mapped to a particular group on a client?”
“Can I see the client-level roles assigned to a group?”
Tell an agent
List client-level role mappings for group {group} on client {client} in realm {realm}.
Show the roles group {group} has on client {client} in {realm}.
POST /admin/realms/{realm}/groups/{group-id}/role-mappings/clients/{client-id} Map client-level roles to a group · Add client-level roles to the user or group role mapping #
Ask an LLM
“How do I give a group roles on a client?”
“Can I add client-level roles to a group?”
Tell an agent
Map roles to group {group} on client {client} in realm {realm}.
Grant group {group} client-level roles on {client} in {realm}.
DELETE /admin/realms/{realm}/groups/{group-id}/role-mappings/clients/{client-id} Unmap client-level roles from a group · Delete client-level roles from user or group role mapping #
Ask an LLM
“How do I remove roles from a group on a client?”
“Can I revoke a group's client-level roles?”
Tell an agent destructive · confirm first
Unmap roles from group {group} on client {client} in realm {realm}.
Revoke group {group}'s client-level roles on {client} in {realm}.
GET /admin/realms/{realm}/groups/{group-id}/role-mappings/clients/{client-id}/available List roles available to a group on a client · Get available client-level roles that can be mapped to the user or group #
Ask an LLM
“What roles can I map to a group on a client?”
“Which client-level roles are available for a group?”
Tell an agent
List available client-level roles for group {group} on client {client} in realm {realm}.
Show roles I can assign group {group} on {client} in {realm}.
GET /admin/realms/{realm}/groups/{group-id}/role-mappings/clients/{client-id}/composite List a group's effective client-level roles · Get effective client-level role mappings This recurses any composite roles #
Ask an LLM
“What roles does a group actually have on a client, including composites?”
“Can I get the effective client-level role mappings for a group?”
Tell an agent
Get effective client-level role mappings for group {group} on client {client} in realm {realm}.
Show group {group}'s composite roles on {client} in {realm}, with brief {brief}.
GET /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/clients/{client-id} List a group's client-level role mappings in an organization · Get client-level role mappings for the user or group, and the app #
Ask an LLM
“Which roles are mapped to a group in an organization on a client?”
“Can I see a group's client-level roles within an organization?”
Tell an agent
List client-level role mappings for group {group} on client {client} in organization {org} of realm {realm}.
Show the roles group {group} has on {client} in org {org} in {realm}.
POST /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/clients/{client-id} Assign client roles to an organization group · Add client-level roles to the user or group role mapping #
Ask an LLM
“How do I give an organization group a role in a client?”
“Can I map several client roles to an organization group?”
Tell an agent
Assign client {client} roles to organization group {group} in realm {realm}, org {org}.
Map roles from client {client} to org group {group}, realm {realm}, org {org}.
DELETE /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/clients/{client-id} Remove client roles from an organization group · Delete client-level roles from user or group role mapping #
Ask an LLM
“How do I revoke a client role from an organization group?”
“Can I take client role mappings off an org group?”
Tell an agent destructive · confirm first
Remove client {client} roles from organization group {group} in realm {realm}, org {org}.
Unmap roles from client {client} on org group {group}, realm {realm}, org {org}.
GET /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/clients/{client-id}/available List client roles available for an organization group · Get available client-level roles that can be mapped to the user or group #
Ask an LLM
“Which client roles can I assign to an organization group?”
“What unassigned client roles are available to an org group?”
Tell an agent
List available client {client} roles for organization group {group} in realm {realm}, org {org}.
Show roles I could map to org group {group}, realm {realm}, org {org}, client {client}.
GET /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/clients/{client-id}/composite See effective client roles on an organization group · Get effective client-level role mappings This recurses any composite roles #
Ask an LLM
“What client roles does an organization group have, including composite roles?”
“Are composite roles expanded when I check an org group's client roles?”
Tell an agent
Show composable client roles on organization group {group} in realm {realm}, org {org}, client {client}.
Expand composite roles for org group {group}, realm {realm}, org {org}, client {client} and return brief {brief}.
GET /admin/realms/{realm}/users/{user-id}/role-mappings/clients/{client-id} List a user's client-level role mappings · Get client-level role mappings for the user or group, and the app #
Ask an LLM
“Which roles are mapped to a particular user on a client?”
“Can I see the client-level roles assigned to a user?”
Tell an agent
List client-level role mappings for user {user} on client {client} in realm {realm}.
Show the roles user {user} has on client {client} in {realm}.
POST /admin/realms/{realm}/users/{user-id}/role-mappings/clients/{client-id} Map client-level roles to a user · Add client-level roles to the user or group role mapping #
Ask an LLM
“How do I give a user roles on a client?”
“Can I add client-level roles to a user?”
Tell an agent
Map roles to user {user} on client {client} in realm {realm}.
Grant user {user} client-level roles on {client} in {realm}.
DELETE /admin/realms/{realm}/users/{user-id}/role-mappings/clients/{client-id} Unmap client-level roles from a user · Delete client-level roles from user or group role mapping #
Ask an LLM
“How do I remove roles from a user on a client?”
“Can I revoke a user's client-level roles?”
Tell an agent destructive · confirm first
Unmap roles from user {user} on client {client} in realm {realm}.
Revoke user {user}'s client-level roles on {client} in {realm}.
GET /admin/realms/{realm}/users/{user-id}/role-mappings/clients/{client-id}/available List roles available to a user on a client · Get available client-level roles that can be mapped to the user or group #
Ask an LLM
“What roles can I map to a user on a client?”
“Which client-level roles are available for a user?”
Tell an agent
List available client-level roles for user {user} on client {client} in realm {realm}.
Show roles I can assign user {user} on {client} in {realm}.
GET /admin/realms/{realm}/users/{user-id}/role-mappings/clients/{client-id}/composite List a user's effective client-level roles · Get effective client-level role mappings This recurses any composite roles #
Ask an LLM
“What roles does a user actually have on a client, including composites?”
“Can I get the effective client-level role mappings for a user?”
Tell an agent
Get effective client-level role mappings for user {user} on client {client} in realm {realm}.
Show user {user}'s composite roles on {client} in {realm}, with brief {brief}.

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-client-role-mappings-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-client-role-mappings-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Keycloak Admin REST Client Role Mappings API
  description: This is a REST API reference for the Keycloak Admin REST API.
  version: '1.0'
tags:
- name: Client Role Mappings
paths:
  /admin/realms/{realm}/groups/{group-id}/role-mappings/clients/{client-id}:
    parameters:
    - name: realm
      in: path
      description: realm name (not id!)
      required: true
      schema:
        type: string
    - name: group-id
      in: path
      required: true
      schema:
        type: string
    - name: client-id
      in: path
      description: client id (not clientId!)
      required: true
      schema:
        type: string
    get:
      tags:
      - Client Role Mappings
      summary: Get client-level role mappings for the user or group, and the app
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoleRepresentation'
      operationId: getAdminRealmsByRealmGroupsByGroupIdRoleMappingsClientsByClientId
      x-operation-id-source: derived
    post:
      tags:
      - Client Role Mappings
      summary: Add client-level roles to the user or group role mapping
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/RoleRepresentation'
      responses:
        '204':
          description: No Content
      operationId: postAdminRealmsByRealmGroupsByGroupIdRoleMappingsClientsByClientId
      x-operation-id-source: derived
    delete:
      tags:
      - Client Role Mappings
      summary: Delete client-level roles from user or group role mapping
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/RoleRepresentation'
      responses:
        '204':
          description: No Content
      operationId: deleteAdminRealmsByRealmGroupsByGroupIdRoleMappingsClientsByClientId
      x-operation-id-source: derived
  /admin/realms/{realm}/groups/{group-id}/role-mappings/clients/{client-id}/available:
    parameters:
    - name: realm
      in: path
      description: realm name (not id!)
      required: true
      schema:
        type: string
    - name: group-id
      in: path
      required: true
      schema:
        type: string
    - name: client-id
      in: path
      description: client id (not clientId!)
      required: true
      schema:
        type: string
    get:
      tags:
      - Client Role Mappings
      summary: Get available client-level roles that can be mapped to the user or group
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoleRepresentation'
      operationId: getAdminRealmsByRealmGroupsByGroupIdRoleMappingsClientsByClientIdAvailable
      x-operation-id-source: derived
  /admin/realms/{realm}/groups/{group-id}/role-mappings/clients/{client-id}/composite:
    parameters:
    - name: realm
      in: path
      description: realm name (not id!)
      required: true
      schema:
        type: string
    - name: group-id
      in: path
      required: true
      schema:
        type: string
    - name: client-id
      in: path
      description: client id (not clientId!)
      required: true
      schema:
        type: string
    get:
      tags:
      - Client Role Mappings
      summary: Get effective client-level role mappings This recurses any composite roles
      parameters:
      - name: briefRepresentation
        in: query
        description: if false, return roles with their attributes
        schema:
          default: true
          type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoleRepresentation'
      operationId: getAdminRealmsByRealmGroupsByGroupIdRoleMappingsClientsByClientIdComposite
      x-operation-id-source: derived
  /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/clients/{client-id}:
    parameters:
    - name: realm
      in: path
      description: realm name (not id!)
      required: true
      schema:
        type: string
    - name: org-id
      in: path
      required: true
      schema:
        type: string
    - name: group-id
      in: path
      required: true
      schema:
        type: string
    - name: client-id
      in: path
      description: client id (not clientId!)
      required: true
      schema:
        type: string
    get:
      tags:
      - Client Role Mappings
      summary: Get client-level role mappings for the user or group, and the app
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoleRepresentation'
      operationId: getAdminRealmsByRealmOrganizationsByOrgIdGroupsByGroupIdRoleMappingsClientsByClientId
      x-operation-id-source: derived
    post:
      tags:
      - Client Role Mappings
      summary: Add client-level roles to the user or group role mapping
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/RoleRepresentation'
      responses:
        '204':
          description: No Content
      operationId: postAdminRealmsByRealmOrganizationsByOrgIdGroupsByGroupIdRoleMappingsClientsByClientId
      x-operation-id-source: derived
    delete:
      tags:
      - Client Role Mappings
      summary: Delete client-level roles from user or group role mapping
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/RoleRepresentation'
      responses:
        '204':
          description: No Content
      operationId: deleteAdminRealmsByRealmOrganizationsByOrgIdGroupsByGroupIdRoleMappingsClientsByClientId
      x-operation-id-source: derived
  /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/clients/{client-id}/available:
    parameters:
    - name: realm
      in: path
      description: realm name (not id!)
      required: true
      schema:
        type: string
    - name: org-id
      in: path
      required: true
      schema:
        type: string
    - name: group-id
      in: path
      required: true
      schema:
        type: string
    - name: client-id
      in: path
      description: client id (not clientId!)
      required: true
      schema:
        type: string
    get:
      tags:
      - Client Role Mappings
      summary: Get available client-level roles that can be mapped to the user or group
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoleRepresentation'
      operationId: getAdminRealmsByRealmOrganizationsByOrgIdGroupsByGroupIdRoleMappingsClientsByClientIdAvailable
      x-operation-id-source: derived
  /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/clients/{client-id}/composite:
    parameters:
    - name: realm
      in: path
      description: realm name (not id!)
      required: true
      schema:
        type: string
    - name: org-id
      in: path
      required: true
      schema:
        type: string
    - name: group-id
      in: path
      required: true
      schema:
        type: string
    - name: client-id
      in: path
      description: client id (not clientId!)
      required: true
      schema:
        type: string
    get:
      tags:
      - Client Role Mappings
      summary: Get effective client-level role mappings This recurses any composite roles
      parameters:
      - name: briefRepresentation
        in: query
        description: if false, return roles with their attributes
        schema:
          default: true
          type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoleRepresentation'
      operationId: getAdminRealmsByRealmOrganizationsByOrgIdGroupsByGroupIdRoleMappingsClientsByClientIdComposite
      x-operation-id-source: derived
  /admin/realms/{realm}/users/{user-id}/role-mappings/clients/{client-id}:
    parameters:
    - name: realm
      in: path
      description: realm name (not id!)
      required: true
      schema:
        type: string
    - name: user-id
      in: path
      required: true
      schema:
        type: string
    - name: client-id
      in: path
      description: client id (not clientId!)
      required: true
      schema:
        type: string
    get:
      tags:
      - Client Role Mappings
      summary: Get client-level role mappings for the user or group, and the app
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoleRepresentation'
      operationId: getAdminRealmsByRealmUsersByUserIdRoleMappingsClientsByClientId
      x-operation-id-source: derived
    post:
      tags:
      - Client Role Mappings
      summary: Add client-level roles to the user or group role mapping
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/RoleRepresentation'
      responses:
        '204':
          description: No Content
      operationId: postAdminRealmsByRealmUsersByUserIdRoleMappingsClientsByClientId
      x-operation-id-source: derived
    delete:
      tags:
      - Client Role Mappings
      summary: Delete client-level roles from user or group role mapping
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/RoleRepresentation'
      responses:
        '204':
          description: No Content
      operationId: deleteAdminRealmsByRealmUsersByUserIdRoleMappingsClientsByClientId
      x-operation-id-source: derived
  /admin/realms/{realm}/users/{user-id}/role-mappings/clients/{client-id}/available:
    parameters:
    - name: realm
      in: path
      description: realm name (not id!)
      required: true
      schema:
        type: string
    - name: user-id
      in: path
      required: true
      schema:
        type: string
    - name: client-id
      in: path
      description: client id (not clientId!)
      required: true
      schema:
        type: string
    get:
      tags:
      - Client Role Mappings
      summary: Get available client-level roles that can be mapped to the user or group
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoleRepresentation'
      operationId: getAdminRealmsByRealmUsersByUserIdRoleMappingsClientsByClientIdAvailable
      x-operation-id-source: derived
  /admin/realms/{realm}/users/{user-id}/role-mappings/clients/{client-id}/composite:
    parameters:
    - name: realm
      in: path
      description: realm name (not id!)
      required: true
      schema:
        type: string
    - name: user-id
      in: path
      required: true
      schema:
        type: string
    - name: client-id
      in: path
      description: client id (not clientId!)
      required: true
      schema:
        type: string
    get:
      tags:
      - Client Role Mappings
      summary: Get effective client-level role mappings This recurses any composite roles
      parameters:
      - name: briefRepresentation
        in: query
        description: if false, return roles with their attributes
        schema:
          default: true
          type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoleRepresentation'
      operationId: getAdminRealmsByRealmUsersByUserIdRoleMappingsClientsByClientIdComposite
      x-operation-id-source: derived
components:
  schemas:
    RoleRepresentation:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        scopeParamRequired:
          type: boolean
          deprecated: true
        composite:
          type: boolean
        composites:
          $ref: '#/components/schemas/Composites'
        clientRole:
          type: boolean
        containerId:
          type: string
        attributes:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    Composites:
      type: object
      properties:
        realm:
          uniqueItems: true
          type: array
          items:
            type: string
        client:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        application:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          deprecated: true