Keycloak Client Role Mappings API

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

Operations 15

GET /admin/realms/{realm}/groups/{group-id}/role-mappings/clients/{client-id} Get client-level role mappings for the user or group, and the app #
POST /admin/realms/{realm}/groups/{group-id}/role-mappings/clients/{client-id} Add client-level roles to the user or group role mapping #
DELETE /admin/realms/{realm}/groups/{group-id}/role-mappings/clients/{client-id} Delete client-level roles from user or group role mapping #
GET /admin/realms/{realm}/groups/{group-id}/role-mappings/clients/{client-id}/available Get available client-level roles that can be mapped to the user or group #
GET /admin/realms/{realm}/groups/{group-id}/role-mappings/clients/{client-id}/composite Get effective client-level role mappings This recurses any composite roles #
GET /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/clients/{client-id} Get client-level role mappings for the user or group, and the app #
POST /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/clients/{client-id} Add client-level roles to the user or group role mapping #
DELETE /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/clients/{client-id} Delete client-level roles from user or group role mapping #
GET /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/clients/{client-id}/available Get available client-level roles that can be mapped to the user or group #
GET /admin/realms/{realm}/organizations/{org-id}/groups/{group-id}/role-mappings/clients/{client-id}/composite Get effective client-level role mappings This recurses any composite roles #
GET /admin/realms/{realm}/users/{user-id}/role-mappings/clients/{client-id} Get client-level role mappings for the user or group, and the app #
POST /admin/realms/{realm}/users/{user-id}/role-mappings/clients/{client-id} Add client-level roles to the user or group role mapping #
DELETE /admin/realms/{realm}/users/{user-id}/role-mappings/clients/{client-id} Delete client-level roles from user or group role mapping #
GET /admin/realms/{realm}/users/{user-id}/role-mappings/clients/{client-id}/available Get available client-level roles that can be mapped to the user or group #
GET /admin/realms/{realm}/users/{user-id}/role-mappings/clients/{client-id}/composite Get effective client-level role mappings This recurses any 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-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. 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