Skycloak Client Roles API

The Client Roles API from Skycloak — 2 operation(s) for client roles.

GitHub OpenAPI

Operations 5

GET /clusters/{cluster_id}/realms/{realm_name}/clients/{client_id}/roles List client roles #
POST /clusters/{cluster_id}/realms/{realm_name}/clients/{client_id}/roles Create a client role #
GET /clusters/{cluster_id}/realms/{realm_name}/clients/{client_id}/roles/{role_name} Get a client role #
PATCH /clusters/{cluster_id}/realms/{realm_name}/clients/{client_id}/roles/{role_name} Update a client role #
DELETE /clusters/{cluster_id}/realms/{realm_name}/clients/{client_id}/roles/{role_name} Delete a client role #

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/skycloak-io:skycloak-io-client-roles-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

skycloak-io-client-roles-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Skycloak Public Client Roles API
  version: '2026-03-01'
  contact:
    name: Skycloak Support
    url: https://support.skycloak.io
  license:
    name: Proprietary
  description: Programmatic management of Keycloak infrastructure on the Skycloak platform.
servers:
- url: http://localhost:8000
  description: Local development
  variables: {}
tags:
- name: Client Roles
paths:
  /clusters/{cluster_id}/realms/{realm_name}/clients/{client_id}/roles:
    get:
      operationId: listClientRoles
      summary: List client roles
      description: 'Returns the roles defined on the specified client.


        Required scope: `client-roles:read`'
      parameters:
      - name: cluster_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/ClusterId'
      - name: realm_name
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/RealmName'
      - name: client_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/RealmClientRef'
      - $ref: '#/components/parameters/CommonParameters'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ClientRole'
        '401':
          description: Access is unauthorized.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '403':
          description: Access is forbidden.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: The server cannot find the requested resource.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: Client error
          headers:
            Retry-After:
              required: false
              schema:
                type: integer
            RateLimit-Limit:
              required: false
              schema:
                type: integer
            RateLimit-Remaining:
              required: false
              schema:
                type: integer
            RateLimit-Reset:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Second:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Second:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Minute:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Minute:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Hour:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Hour:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Day:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Day:
              required: false
              schema:
                type: integer
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '500':
          description: Server error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '501':
          description: Server error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      tags:
      - Client Roles
      security:
      - ApiKeyAuth: []
      x-scopes:
      - client-roles:read
    post:
      operationId: createClientRole
      summary: Create a client role
      description: 'Creates a new role on the specified client.


        Required scope: `client-roles:write`'
      parameters:
      - name: cluster_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/ClusterId'
      - name: realm_name
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/RealmName'
      - name: client_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/RealmClientRef'
      - $ref: '#/components/parameters/CommonParameters'
      responses:
        '201':
          description: The request has succeeded and a new resource has been created as a result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientRole'
        '401':
          description: Access is unauthorized.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '403':
          description: Access is forbidden.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: The server cannot find the requested resource.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '409':
          description: The request conflicts with the current state of the server.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '422':
          description: Client error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ValidationErrorBody'
        '429':
          description: Client error
          headers:
            Retry-After:
              required: false
              schema:
                type: integer
            RateLimit-Limit:
              required: false
              schema:
                type: integer
            RateLimit-Remaining:
              required: false
              schema:
                type: integer
            RateLimit-Reset:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Second:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Second:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Minute:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Minute:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Hour:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Hour:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Day:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Day:
              required: false
              schema:
                type: integer
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '500':
          description: Server error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '501':
          description: Server error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      tags:
      - Client Roles
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateClientRoleRequest'
      security:
      - ApiKeyAuth: []
      x-scopes:
      - client-roles:write
  /clusters/{cluster_id}/realms/{realm_name}/clients/{client_id}/roles/{role_name}:
    get:
      operationId: getClientRole
      summary: Get a client role
      description: 'Returns a single role defined on the specified client.


        Required scope: `client-roles:read`'
      parameters:
      - name: cluster_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/ClusterId'
      - name: realm_name
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/RealmName'
      - name: client_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/RealmClientRef'
      - name: role_name
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/RealmRoleName'
      - $ref: '#/components/parameters/CommonParameters'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientRole'
        '401':
          description: Access is unauthorized.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '403':
          description: Access is forbidden.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: The server cannot find the requested resource.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: Client error
          headers:
            Retry-After:
              required: false
              schema:
                type: integer
            RateLimit-Limit:
              required: false
              schema:
                type: integer
            RateLimit-Remaining:
              required: false
              schema:
                type: integer
            RateLimit-Reset:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Second:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Second:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Minute:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Minute:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Hour:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Hour:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Day:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Day:
              required: false
              schema:
                type: integer
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '500':
          description: Server error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '501':
          description: Server error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      tags:
      - Client Roles
      security:
      - ApiKeyAuth: []
      x-scopes:
      - client-roles:read
    patch:
      operationId: updateClientRole
      summary: Update a client role
      description: 'Updates the role''s name or description. The role stays on the same client, and renaming it does not affect existing assignments.


        Required scope: `client-roles:write`'
      parameters:
      - name: cluster_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/ClusterId'
      - name: realm_name
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/RealmName'
      - name: client_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/RealmClientRef'
      - name: role_name
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/RealmRoleName'
      - $ref: '#/components/parameters/CommonParameters'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientRole'
        '401':
          description: Access is unauthorized.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '403':
          description: Access is forbidden.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: The server cannot find the requested resource.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '409':
          description: The request conflicts with the current state of the server.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '422':
          description: Client error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ValidationErrorBody'
        '429':
          description: Client error
          headers:
            Retry-After:
              required: false
              schema:
                type: integer
            RateLimit-Limit:
              required: false
              schema:
                type: integer
            RateLimit-Remaining:
              required: false
              schema:
                type: integer
            RateLimit-Reset:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Second:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Second:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Minute:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Minute:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Hour:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Hour:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Day:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Day:
              required: false
              schema:
                type: integer
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '500':
          description: Server error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '501':
          description: Server error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      tags:
      - Client Roles
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateClientRoleRequest'
      security:
      - ApiKeyAuth: []
      x-scopes:
      - client-roles:write
    delete:
      operationId: deleteClientRole
      summary: Delete a client role
      description: 'Deletes the role from the client and removes all its user and group assignments.


        Required scope: `client-roles:write`'
      parameters:
      - name: cluster_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/ClusterId'
      - name: realm_name
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/RealmName'
      - name: client_id
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/RealmClientRef'
      - name: role_name
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/RealmRoleName'
      - $ref: '#/components/parameters/CommonParameters'
      responses:
        '204':
          description: There is no content to send for this request, but the headers may be useful.
        '401':
          description: Access is unauthorized.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '403':
          description: Access is forbidden.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '404':
          description: The server cannot find the requested resource.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '429':
          description: Client error
          headers:
            Retry-After:
              required: false
              schema:
                type: integer
            RateLimit-Limit:
              required: false
              schema:
                type: integer
            RateLimit-Remaining:
              required: false
              schema:
                type: integer
            RateLimit-Reset:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Second:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Second:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Minute:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Minute:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Hour:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Hour:
              required: false
              schema:
                type: integer
            X-RateLimit-Limit-Day:
              required: false
              schema:
                type: integer
            X-RateLimit-Remaining-Day:
              required: false
              schema:
                type: integer
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '500':
          description: Server error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '501':
          description: Server error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
      tags:
      - Client Roles
      security:
      - ApiKeyAuth: []
      x-scopes:
      - client-roles:write
components:
  schemas:
    ErrorBody:
      type: object
      required:
      - type
      - title
      - status
      - detail
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        instance:
          type: string
          format: uri
      description: RFC 9457 Problem Details object.
    Versions:
      type: string
      enum:
      - 2026-06-01.beta
    ValidationErrorBody:
      type: object
      required:
      - type
      - title
      - status
      - detail
      - errors
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        instance:
          type: string
          format: uri
        errors:
          type: array
          items:
            $ref: '#/components/schemas/FieldError'
          minItems: 1
    CreateClientRoleRequest:
      type: object
      required:
      - name
      properties:
        name:
          allOf:
          - $ref: '#/components/schemas/RealmRoleName'
          example: invoices-read
        description:
          type: string
          maxLength: 255
          example: Read invoices
      description: Request body for creating a client role.
      example:
        name: invoices-read
        description: Read invoices
    FieldError:
      type: object
      required:
      - field
      - detail
      properties:
        field:
          type: string
        detail:
          type: string
        code:
          type: string
        value: {}
    ClusterId:
      type: string
      format: uuid
    RealmRoleName:
      type: string
      minLength: 1
      maxLength: 255
      pattern: ^[A-Za-z0-9._:@-]+$
      description: Role name.
      example: admin
    ClientRole:
      type: object
      required:
      - name
      - client_id
      - client_uuid
      properties:
        id:
          type: string
          description: Keycloak identifier of the role.
          example: 9a1f0f0e-1b2c-4d3e-8f5a-6b7c8d9e0f11
        name:
          allOf:
          - $ref: '#/components/schemas/RealmRoleName'
          example: invoices-read
        description:
          type:
          - string
          - 'null'
          description: Human-friendly role description, when available.
          example: Read invoices
        composite:
          type: boolean
          description: Whether this role is composed from other roles.
          example: false
        client_id:
          type: string
          description: OAuth `client_id` of the client the role belongs to.
          example: storefront
        client_uuid:
          type: string
          description: Internal Keycloak UUID of the client the role belongs to.
          example: 3f4a1c2e-5b6d-4e7f-8a9b-0c1d2e3f4a5b
      description: Public representation of a role defined on a single client.
      example:
        id: 9a1f0f0e-1b2c-4d3e-8f5a-6b7c8d9e0f11
        name: invoices-read
        description: Read invoices
        composite: false
        client_id: storefront
        client_uuid: 3f4a1c2e-5b6d-4e7f-8a9b-0c1d2e3f4a5b
    RealmClientRef:
      type: string
      minLength: 1
      maxLength: 255
      description: 'Reference to a client in the realm: either its OAuth `client_id` or its internal Keycloak UUID. Both forms resolve to the same client.'
      example: storefront
    RealmName:
      type: string
      minLength: 1
      maxLength: 63
      pattern: ^[a-zA-Z][a-zA-Z0-9-]*$
      description: Keycloak realm name (not ID). Must start with a letter; allows letters, digits, and hyphens.
      example: customer-portal
    UpdateClientRoleRequest:
      type: object
      properties:
        name:
          allOf:
          - $ref: '#/components/schemas/RealmRoleName'
          example: invoices-reader
        description:
          type: string
          maxLength: 255
          example: Read and export invoices
      description: Patch request for updating a client role. At least one field should be provided.
      example:
        description: Read and export invoices
  parameters:
    CommonParameters:
      name: API-Version
      in: header
      required: true
      schema:
        $ref: '#/components/schemas/Versions'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: API-Key