Keycloak Role Mapper API

The Role Mapper API from Keycloak — 12 operation(s) for role mapper.

GitHub OpenAPI

Operations 18

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 List a group's role mappings · Get role mappings #
Ask an LLM
“Which roles are mapped to a particular group?”
“Can I see a group's realm and client role mappings together?”
Tell an agent
List role mappings for group {group} in realm {realm}.
Show every role assigned to group {group} in realm {realm}.
GET /admin/realms/{realm}/groups/{group-id}/role-mappings/realm Get realm roles for a group · Get realm-level role mappings #
Ask an LLM
“Which roles are assigned to a group in my realm?”
“Can I see a group's realm-level roles?”
Tell an agent
Get realm-level roles for group {group} in realm {realm}.
List roles assigned to group {group}.
POST /admin/realms/{realm}/groups/{group-id}/role-mappings/realm Add realm roles to a group · Add realm-level role mappings to the user #
Ask an LLM
“How do I give a group a realm role?”
“Can I map several realm roles to a group at once?”
Tell an agent
Add realm-level roles to group {group} in realm {realm}.
Grant group {group} these realm roles in realm {realm}.
DELETE /admin/realms/{realm}/groups/{group-id}/role-mappings/realm Remove realm roles from a group · Delete realm-level role mappings #
Ask an LLM
“How do I take a realm role away from a group?”
“Can I revoke several realm roles from a group in one call?”
Tell an agent destructive · confirm first
Remove realm-level roles from group {group} in realm {realm}.
Revoke group {group}'s realm roles in realm {realm}.
GET /admin/realms/{realm}/groups/{group-id}/role-mappings/realm/available List realm roles available to a group · Get realm-level roles that can be mapped #
Ask an LLM
“Which realm roles can I map to a group?”
“What roles are still free to assign to a group?”
Tell an agent
List realm roles available to group {group} in realm {realm}.
Show unassigned realm roles I could give group {group} in realm {realm}.
GET /admin/realms/{realm}/groups/{group-id}/role-mappings/realm/composite Get effective realm roles for a group · Get effective realm-level role mappings This will recurse all composite roles… #
Ask an LLM
“Taking a group's composite roles into account, what roles does it have?”
“Which roles does a group inherit through roles it is assigned to?”
Tell an agent
Get effective realm roles for group {group} in realm {realm}.
Show inherited roles of group {group}, composing composite roles.
GET /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings Get all role mappings for a group · Get role mappings #
Ask an LLM
“What roles are mapped on a group across realms and client scopes?”
“Can I get every role mapping on a group at once?”
Tell an agent
Get all role mappings for group {group} in organization {org} of realm {realm}.
List every role mapping on group {group}.
GET /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/realm Get realm roles for a group · Get realm-level role mappings #
Ask an LLM
“Which realm roles are assigned to a group in an organization?”
“Can I see only the realm-level roles mapped on a group?”
Tell an agent
Get realm-level roles for group {group} in organization {org} of realm {realm}.
Show only the realm roles of group {group}.
POST /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/realm Assign realm roles to a group · Add realm-level role mappings to the user #
Ask an LLM
“Can I give a group additional realm roles?”
“How do I map a new realm role onto a group?”
Tell an agent
Add realm roles to group {group} in organization {org} of realm {realm}.
Assign a new realm role to group {group}.
DELETE /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/realm Remove realm roles from a group · Delete realm-level role mappings #
Ask an LLM
“Can I take a realm role away from a group?”
“How do I unmap a realm role from a group?”
Tell an agent destructive · confirm first
Remove realm roles from group {group} in organization {org} of realm {realm}.
Unassign a realm role from group {group}.
GET /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/realm/available List unassigned realm roles for a group · Get realm-level roles that can be mapped #
Ask an LLM
“Which realm roles can still be mapped onto a group?”
“Can I see the realm roles a group has no role mapping on yet?”
Tell an agent
Get unassigned realm roles for group {group} in organization {org} of realm {realm}.
List realm roles available to give to group {group}.
GET /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/realm/composite Get effective realm roles of an organization group · Get effective realm-level role mappings This will recurse all composite roles… #
Ask an LLM
“What realm roles does an organization's group effectively hold once composite roles are expanded?”
“Can I see the full inherited realm role set for a group inside an organization?”
Tell an agent
Get effective realm roles, including composites, for group {group} in organization {org} of realm {realm}.
Expand composite realm roles for organization {org} group {group} in realm {realm}, with full attributes if {brief} is false.
GET /admin/realms/{realm}/users/{user-id}/role-mappings List a user's role mappings · Get role mappings #
Ask an LLM
“Which roles are mapped to a particular user?”
“Can I see a user's realm and client role mappings together?”
Tell an agent
List role mappings for user {user} in realm {realm}.
Show every role assigned to user {user} in realm {realm}.
GET /admin/realms/{realm}/users/{user-id}/role-mappings/realm Get realm roles for a user · Get realm-level role mappings #
Ask an LLM
“What roles does a user have at the realm level?”
“Can I get a user's realm-level roles?”
Tell an agent
Get realm-level roles for user {user} in realm {realm}.
List roles assigned to user {user}.
POST /admin/realms/{realm}/users/{user-id}/role-mappings/realm Add realm roles to a user · Add realm-level role mappings to the user #
Ask an LLM
“How do I give a user a realm role?”
“Can I map several realm roles to a user at once?”
Tell an agent
Add realm-level roles to user {user} in realm {realm}.
Grant user {user} these realm roles in realm {realm}.
DELETE /admin/realms/{realm}/users/{user-id}/role-mappings/realm Remove realm roles from a user · Delete realm-level role mappings #
Ask an LLM
“How do I take a realm role away from a user?”
“Can I revoke several realm roles from a user in one call?”
Tell an agent destructive · confirm first
Remove realm-level roles from user {user} in realm {realm}.
Revoke user {user}'s realm roles in realm {realm}.
GET /admin/realms/{realm}/users/{user-id}/role-mappings/realm/available List realm roles available to a user · Get realm-level roles that can be mapped #
Ask an LLM
“Which realm roles can I map to a user?”
“What roles are still free to assign to a user?”
Tell an agent
List realm roles available to user {user} in realm {realm}.
Show unassigned realm roles I could give user {user} in realm {realm}.
GET /admin/realms/{realm}/users/{user-id}/role-mappings/realm/composite Get effective realm roles for a user · Get effective realm-level role mappings This will recurse all composite roles… #
Ask an LLM
“Taking a user's composite roles into account, what roles does the user hold?”
“Which roles does a user get through roles they are assigned to?”
Tell an agent
Get effective realm roles for user {user} in realm {realm}.
Show inherited roles of user {user}, composing composite roles.

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-role-mapper-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-role-mapper-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Keycloak Admin REST Role Mapper API
  description: This is a REST API reference for the Keycloak Admin REST API.
  version: '1.0'
tags:
- name: Role Mapper
paths:
  /admin/realms/{realm}/groups/{group-id}/role-mappings:
    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
    get:
      tags:
      - Role Mapper
      summary: Get role mappings
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MappingsRepresentation'
        '403':
          description: Forbidden
      operationId: getAdminRealmsByRealmGroupsByGroupIdRoleMappings
      x-operation-id-source: derived
  /admin/realms/{realm}/groups/{group-id}/role-mappings/realm:
    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
    get:
      tags:
      - Role Mapper
      summary: Get realm-level role mappings
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoleRepresentation'
        '403':
          description: Forbidden
      operationId: getAdminRealmsByRealmGroupsByGroupIdRoleMappingsRealm
      x-operation-id-source: derived
    post:
      tags:
      - Role Mapper
      summary: Add realm-level role mappings to the user
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/RoleRepresentation'
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
      operationId: postAdminRealmsByRealmGroupsByGroupIdRoleMappingsRealm
      x-operation-id-source: derived
    delete:
      tags:
      - Role Mapper
      summary: Delete realm-level role mappings
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/RoleRepresentation'
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
      operationId: deleteAdminRealmsByRealmGroupsByGroupIdRoleMappingsRealm
      x-operation-id-source: derived
  /admin/realms/{realm}/groups/{group-id}/role-mappings/realm/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
    get:
      tags:
      - Role Mapper
      summary: Get realm-level roles that can be mapped
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoleRepresentation'
        '403':
          description: Forbidden
      operationId: getAdminRealmsByRealmGroupsByGroupIdRoleMappingsRealmAvailable
      x-operation-id-source: derived
  /admin/realms/{realm}/groups/{group-id}/role-mappings/realm/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
    get:
      tags:
      - Role Mapper
      summary: Get effective realm-level role mappings This will recurse all composite roles…
      parameters:
      - name: briefRepresentation
        in: query
        description: if false, return roles with their attributes
        schema:
          default: true
          type: boolean
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoleRepresentation'
        '403':
          description: Forbidden
      operationId: getAdminRealmsByRealmGroupsByGroupIdRoleMappingsRealmComposite
      x-operation-id-source: derived
  /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings:
    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
    get:
      tags:
      - Role Mapper
      summary: Get role mappings
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MappingsRepresentation'
        '403':
          description: Forbidden
      operationId: getAdminRealmsByRealmOrganizationsByOrgIdGroupsByGroupIdRoleMappings
      x-operation-id-source: derived
  /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/realm:
    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
    get:
      tags:
      - Role Mapper
      summary: Get realm-level role mappings
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoleRepresentation'
        '403':
          description: Forbidden
      operationId: getAdminRealmsByRealmOrganizationsByOrgIdGroupsByGroupIdRoleMappingsRealm
      x-operation-id-source: derived
    post:
      tags:
      - Role Mapper
      summary: Add realm-level role mappings to the user
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/RoleRepresentation'
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
      operationId: postAdminRealmsByRealmOrganizationsByOrgIdGroupsByGroupIdRoleMappingsRealm
      x-operation-id-source: derived
    delete:
      tags:
      - Role Mapper
      summary: Delete realm-level role mappings
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/RoleRepresentation'
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
      operationId: deleteAdminRealmsByRealmOrganizationsByOrgIdGroupsByGroupIdRoleMappingsRealm
      x-operation-id-source: derived
  /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/realm/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
    get:
      tags:
      - Role Mapper
      summary: Get realm-level roles that can be mapped
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoleRepresentation'
        '403':
          description: Forbidden
      operationId: getAdminRealmsByRealmOrganizationsByOrgIdGroupsByGroupIdRoleMappingsRealmAvailable
      x-operation-id-source: derived
  /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/realm/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
    get:
      tags:
      - Role Mapper
      summary: Get effective realm-level role mappings This will recurse all composite roles…
      parameters:
      - name: briefRepresentation
        in: query
        description: if false, return roles with their attributes
        schema:
          default: true
          type: boolean
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoleRepresentation'
        '403':
          description: Forbidden
      operationId: getAdminRealmsByRealmOrganizationsByOrgIdGroupsByGroupIdRoleMappingsRealmComposite
      x-operation-id-source: derived
  /admin/realms/{realm}/users/{user-id}/role-mappings:
    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
    get:
      tags:
      - Role Mapper
      summary: Get role mappings
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MappingsRepresentation'
        '403':
          description: Forbidden
      operationId: getAdminRealmsByRealmUsersByUserIdRoleMappings
      x-operation-id-source: derived
  /admin/realms/{realm}/users/{user-id}/role-mappings/realm:
    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
    get:
      tags:
      - Role Mapper
      summary: Get realm-level role mappings
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoleRepresentation'
        '403':
          description: Forbidden
      operationId: getAdminRealmsByRealmUsersByUserIdRoleMappingsRealm
      x-operation-id-source: derived
    post:
      tags:
      - Role Mapper
      summary: Add realm-level role mappings to the user
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/RoleRepresentation'
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
      operationId: postAdminRealmsByRealmUsersByUserIdRoleMappingsRealm
      x-operation-id-source: derived
    delete:
      tags:
      - Role Mapper
      summary: Delete realm-level role mappings
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/RoleRepresentation'
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
      operationId: deleteAdminRealmsByRealmUsersByUserIdRoleMappingsRealm
      x-operation-id-source: derived
  /admin/realms/{realm}/users/{user-id}/role-mappings/realm/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
    get:
      tags:
      - Role Mapper
      summary: Get realm-level roles that can be mapped
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoleRepresentation'
        '403':
          description: Forbidden
      operationId: getAdminRealmsByRealmUsersByUserIdRoleMappingsRealmAvailable
      x-operation-id-source: derived
  /admin/realms/{realm}/users/{user-id}/role-mappings/realm/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
    get:
      tags:
      - Role Mapper
      summary: Get effective realm-level role mappings This will recurse all composite roles…
      parameters:
      - name: briefRepresentation
        in: query
        description: if false, return roles with their attributes
        schema:
          default: true
          type: boolean
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RoleRepresentation'
        '403':
          description: Forbidden
      operationId: getAdminRealmsByRealmUsersByUserIdRoleMappingsRealmComposite
      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
    ClientMappingsRepresentation:
      type: object
      properties:
        id:
          type: string
        client:
          type: string
        mappings:
          type: array
          items:
            $ref: '#/components/schemas/RoleRepresentation'
    MappingsRepresentation:
      type: object
      properties:
        realmMappings:
          type: array
          items:
            $ref: '#/components/schemas/RoleRepresentation'
        clientMappings:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/ClientMappingsRepresentation'