From 90e6c7a69af9ed417f4320176fd4ea1250c75dc3 Mon Sep 17 00:00:00 2001 From: Alexander Korolev Date: Sat, 30 Mar 2024 12:12:54 +0100 Subject: [PATCH] Download openapi.json, removed old gen functions, simplified modes for update.ts (#99) * Download openapi.json, removed old gen functions, simplified modes for update.ts * set particular version in actions * require version 1.60 of Rust * require version 1.63 of Rust * require version 1.65 of Rust * require version 1.74 of Rust --- .github/workflows/rust.yml | 3 +- Cargo.toml | 2 +- README.md | 4 +- {docs => api}/openapi.json | 0 docker/Dockerfile.docs | 21 - docs/rest-api.html | 35323 ----------------------------------- examples/common/mod.rs | 433 - examples/gen.rs | 337 - examples/openapi.rs | 14 +- examples/stream.toml | 91 - src/lib.rs | 4 +- templates/README.md | 4 +- update.sh | 132 - update.ts | 163 +- 14 files changed, 93 insertions(+), 36438 deletions(-) rename {docs => api}/openapi.json (100%) delete mode 100644 docker/Dockerfile.docs delete mode 100644 docs/rest-api.html delete mode 100644 examples/common/mod.rs delete mode 100644 examples/gen.rs delete mode 100644 examples/stream.toml delete mode 100755 update.sh diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d54fa2f..a5bfbdb 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -15,7 +15,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@1.74.0 - name: Build run: cargo build --verbose - name: Run tests diff --git a/Cargo.toml b/Cargo.toml index e2c70c9..edf5a3d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ homepage = "https://github.com/kilork/keycloak" keywords = ["api", "async", "keycloak", "rest"] license = "Unlicense OR MIT" repository = "https://github.com/kilork/keycloak" -rust-version = "1.58" +rust-version = "1.74" [features] default = ["tags-all"] diff --git a/README.md b/README.md index 239821a..bfcc83b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Default flags: `tags-all`. ## Usage -Requires Rust version >= `1.58.0`. +Requires Rust version >= `1.74.0`. Add dependency to Cargo.toml: @@ -102,5 +102,5 @@ Example: official version `13.0.1` is `13.0.100` for crate version. `13.0.102` m To update current version use provided [update.ts](./update.ts) `deno` script: ```sh -deno run --allow-env=KEYCLOAK_RUST_VERSION,KEYCLOAK_VERSION,KEYCLOAK_RUST_MAJOR_VERSION --allow-read=Cargo.toml --allow-write=Cargo.toml,docs/rest-api.html,src/types.rs,src/rest/generated_rest.rs --allow-net=keycloak.org,www.keycloak.org --allow-run=cargo,docker,gh,git,handlebars-magic update.ts +deno run --allow-env=KEYCLOAK_RUST_VERSION,KEYCLOAK_VERSION,KEYCLOAK_RUST_MAJOR_VERSION --allow-read=Cargo.toml --allow-write=Cargo.toml,api/openapi.json,src/types.rs,src/rest/generated_rest.rs --allow-net=keycloak.org,www.keycloak.org --allow-run=cargo,gh,git,handlebars-magic update.ts ``` diff --git a/docs/openapi.json b/api/openapi.json similarity index 100% rename from docs/openapi.json rename to api/openapi.json diff --git a/docker/Dockerfile.docs b/docker/Dockerfile.docs deleted file mode 100644 index b3f9283..0000000 --- a/docker/Dockerfile.docs +++ /dev/null @@ -1,21 +0,0 @@ -FROM eclipse-temurin:17 as build-prepare - -RUN apt-get update && apt-get install -y git maven - -FROM build-prepare as build - -ARG VERSION=22.0.5 - -RUN --mount=type=cache,target=/root/.m2/ git clone \ - --config core.symlinks=true \ - --depth 1 \ - --branch ${VERSION} \ - https://github.com/keycloak/keycloak.git && \ - cd /keycloak && \ - ./mvnw -pl quarkus/deployment,quarkus/dist -am -DskipTests clean install && \ - cd services && \ - mvn -s ../maven-settings.xml -Pjboss-release -DskipTests clean package - -FROM scratch - -COPY --from=build /keycloak/services/target/apidocs-rest/swagger/apidocs/openapi.json . \ No newline at end of file diff --git a/docs/rest-api.html b/docs/rest-api.html deleted file mode 100644 index 7e30580..0000000 --- a/docs/rest-api.html +++ /dev/null @@ -1,35323 +0,0 @@ - - - - - - - - - -Keycloak Admin REST API - - - - - -
-
-

Overview

-
-
-

This is a REST API reference for the Keycloak Admin REST API.

-
-
-

Version information

-
-

Version: 1.0

-
-
-
-

URI scheme

-
-
-
{base url}/admin/realms
-
-
- -
-
-
-
-

Resources

-
-
-

Attack Detection

-
-

DELETE /admin/realms/{realm}/attack-detection/brute-force/users

-
-

Clear any user login failures for all users This can release temporary disabled users

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

DELETE /admin/realms/{realm}/attack-detection/brute-force/users/{userId}

-
-

Clear any user login failures for the user This can release temporary disabled user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

userId
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/attack-detection/brute-force/users/{userId}

-
-

Get status of a username in brute force detection

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

userId
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

Map[<<>>]

-
-
-
-
-

Authentication Management

-
-

GET /admin/realms/{realm}/authentication/authenticator-providers

-
-

Get authenticator providers Returns a stream of authenticator providers.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[[AnyType]]

-
-
-
-

GET /admin/realms/{realm}/authentication/client-authenticator-providers

-
-

Get client authenticator providers Returns a stream of client authenticator providers.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[[AnyType]]

-
-
-
-

GET /admin/realms/{realm}/authentication/config-description/{providerId}

-
-

Get authenticator provider’s configuration description

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

providerId
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

AuthenticatorConfigInfoRepresentation

-
-
-
-

DELETE /admin/realms/{realm}/authentication/config/{id}

-
-

Delete authenticator configuration

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

Configuration id

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/authentication/config/{id}

-
-

Get authenticator configuration

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

Configuration id

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

AuthenticatorConfigRepresentation

-
-
-
-

PUT /admin/realms/{realm}/authentication/config/{id}

-
-

Update authenticator configuration

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

Configuration id

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

AuthenticatorConfigRepresentation
-optional

AuthenticatorConfigRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

POST /admin/realms/{realm}/authentication/config

-
-

Create new authenticator configuration

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

AuthenticatorConfigRepresentation
-optional

AuthenticatorConfigRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/authentication/executions/{executionId}/config/{id}

-
-

Get execution’s configuration

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

executionId
-required

Execution id

null

id
-required

Configuration id

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

AuthenticatorConfigRepresentation

-
-
-
-

POST /admin/realms/{realm}/authentication/executions/{executionId}/config

-
-

Update execution with new configuration

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

executionId
-required

Execution id

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

AuthenticatorConfigRepresentation
-optional

AuthenticatorConfigRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

DELETE /admin/realms/{realm}/authentication/executions/{executionId}

-
-

Delete execution

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

executionId
-required

Execution id

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/authentication/executions/{executionId}

-
-

Get Single Execution

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

executionId
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

POST /admin/realms/{realm}/authentication/executions/{executionId}/lower-priority

-
-

Lower execution’s priority

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

executionId
-required

Execution id

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

POST /admin/realms/{realm}/authentication/executions/{executionId}/raise-priority

-
-

Raise execution’s priority

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

executionId
-required

Execution id

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

POST /admin/realms/{realm}/authentication/executions

-
-

Add new authentication execution

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

AuthenticationExecutionRepresentation
-optional

AuthenticationExecutionRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

POST /admin/realms/{realm}/authentication/flows/{flowAlias}/copy

-
-

Copy existing authentication flow under a new name The new name is given as 'newName' attribute of the passed JSON object

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

flowAlias
-required

name of the existing authentication flow

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

request_body
-optional

[string]

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

POST /admin/realms/{realm}/authentication/flows/{flowAlias}/executions/execution

-
-

Add new authentication execution to a flow

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

flowAlias
-required

Alias of parent flow

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

request_body
-optional

[string]

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

POST /admin/realms/{realm}/authentication/flows/{flowAlias}/executions/flow

-
-

Add new flow with new execution to existing flow

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

flowAlias
-required

Alias of parent authentication flow

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

request_body
-optional

[string]

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/authentication/flows/{flowAlias}/executions

-
-

Get authentication executions for a flow

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

flowAlias
-required

Flow alias

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

PUT /admin/realms/{realm}/authentication/flows/{flowAlias}/executions

-
-

Update authentication executions of a Flow

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

flowAlias
-required

Flow alias

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

AuthenticationExecutionInfoRepresentation
-optional

AuthenticationExecutionInfoRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/authentication/flows

-
-

Get authentication flows Returns a stream of authentication flows.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[AuthenticationFlowRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/authentication/flows/{id}

-
-

Delete an authentication flow

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

Flow id

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/authentication/flows/{id}

-
-

Get authentication flow for id

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

Flow id

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

AuthenticationFlowRepresentation

-
-
-
-

PUT /admin/realms/{realm}/authentication/flows/{id}

-
-

Update an authentication flow

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

AuthenticationFlowRepresentation
-optional

AuthenticationFlowRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

POST /admin/realms/{realm}/authentication/flows

-
-

Create a new authentication flow

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

AuthenticationFlowRepresentation
-optional

AuthenticationFlowRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/authentication/form-action-providers

-
-

Get form action providers Returns a stream of form action providers.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[[AnyType]]

-
-
-
-

GET /admin/realms/{realm}/authentication/form-providers

-
-

Get form providers Returns a stream of form providers.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[[AnyType]]

-
-
-
-

GET /admin/realms/{realm}/authentication/per-client-config-description

-
-

Get configuration descriptions for all clients

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

Map[ConfigPropertyRepresentation]

-
-
-
-

POST /admin/realms/{realm}/authentication/register-required-action

-
-

Register a new required actions

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

request_body
-optional

[string]

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

DELETE /admin/realms/{realm}/authentication/required-actions/{alias}

-
-

Delete required action

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

alias
-required

Alias of required action

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/authentication/required-actions/{alias}

-
-

Get required action for alias

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

alias
-required

Alias of required action

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

RequiredActionProviderRepresentation

-
-
-
-

POST /admin/realms/{realm}/authentication/required-actions/{alias}/lower-priority

-
-

Lower required action’s priority

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

alias
-required

Alias of required action

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

PUT /admin/realms/{realm}/authentication/required-actions/{alias}

-
-

Update required action

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

alias
-required

Alias of required action

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RequiredActionProviderRepresentation
-optional

RequiredActionProviderRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

POST /admin/realms/{realm}/authentication/required-actions/{alias}/raise-priority

-
-

Raise required action’s priority

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

alias
-required

Alias of required action

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

GET /admin/realms/{realm}/authentication/required-actions

-
-

Get required actions Returns a stream of required actions.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RequiredActionProviderRepresentation]

-
-
-
-

GET /admin/realms/{realm}/authentication/unregistered-required-actions

-
-

Get unregistered required actions Returns a stream of unregistered required actions.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[[string]]

-
-
-
-
-

Client Attribute Certificate

-
-

POST /admin/realms/{realm}/clients/{id}/certificates/{attr}/download

-
-

Get a keystore file for the client, containing private key and public certificate

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

attr
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

KeyStoreConfig
-optional

KeyStoreConfig

-
-
-
-
Content Type
-
-
    -
  • -

    application/octet-stream

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

[File]

-
-
-
-

POST /admin/realms/{realm}/clients/{id}/certificates/{attr}/generate-and-download

-
-

Generate a new keypair and certificate, and get the private key file Generates a keypair and certificate and serves the private key in a specified keystore format. Only generated public certificate is saved in Keycloak DB - the private key is not.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

attr
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

KeyStoreConfig
-optional

KeyStoreConfig

-
-
-
-
Content Type
-
-
    -
  • -

    application/octet-stream

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

[File]

-
-
-
-

POST /admin/realms/{realm}/clients/{id}/certificates/{attr}/generate

-
-

Generate a new certificate with new key pair

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

attr
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

CertificateRepresentation

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/certificates/{attr}

-
-

Get key info

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

attr
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

CertificateRepresentation

-
-
-
-

POST /admin/realms/{realm}/clients/{id}/certificates/{attr}/upload-certificate

-
-

Upload only certificate, not private key

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

attr
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

CertificateRepresentation

-
-
-
-

POST /admin/realms/{realm}/clients/{id}/certificates/{attr}/upload

-
-

Upload certificate and eventually private key

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

attr
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

CertificateRepresentation

-
-
-
-
-

Client Initial Access

-
-

GET /admin/realms/{realm}/clients-initial-access

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[ClientInitialAccessPresentation]

-
-
-
-

DELETE /admin/realms/{realm}/clients-initial-access/{id}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

POST /admin/realms/{realm}/clients-initial-access

-
-

Create a new initial access token.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ClientInitialAccessCreatePresentation
-optional

ClientInitialAccessCreatePresentation

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ClientInitialAccessPresentation

-
-
-
-
-

Client Registration Policy

-
-

GET /admin/realms/{realm}/client-registration-policy/providers

-
-

Base path for retrieve providers with the configProperties properly filled

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[ComponentTypeRepresentation]

-
-
-
-
-

Client Role Mappings

-
-

GET /admin/realms/{realm}/groups/{id}/role-mappings/clients/{client}/available

-
-

Get available client-level roles that can be mapped to the user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

GET /admin/realms/{realm}/groups/{id}/role-mappings/clients/{client}/composite

-
-

Get effective client-level role mappings This recurses any composite roles

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

if false, return roles with their attributes

true

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/groups/{id}/role-mappings/clients/{client}

-
-

Delete client-level roles from user role mapping

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/groups/{id}/role-mappings/clients/{client}

-
-

Get client-level role mappings for the user, and the app

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

POST /admin/realms/{realm}/groups/{id}/role-mappings/clients/{client}

-
-

Add client-level roles to the user role mapping

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

GET /admin/realms/{realm}/users/{id}/role-mappings/clients/{client}/available

-
-

Get available client-level roles that can be mapped to the user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

GET /admin/realms/{realm}/users/{id}/role-mappings/clients/{client}/composite

-
-

Get effective client-level role mappings This recurses any composite roles

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

if false, return roles with their attributes

true

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/users/{id}/role-mappings/clients/{client}

-
-

Delete client-level roles from user role mapping

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/users/{id}/role-mappings/clients/{client}

-
-

Get client-level role mappings for the user, and the app

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

POST /admin/realms/{realm}/users/{id}/role-mappings/clients/{client}

-
-

Add client-level roles to the user role mapping

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-
-

Client Scopes

-
-

GET /admin/realms/{realm}/client-scopes

-
-

Get client scopes belonging to the realm Returns a list of client scopes belonging to the realm

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[ClientScopeRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/client-scopes/{id}

-
-

Delete the client scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/client-scopes/{id}

-
-

Get representation of the client scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ClientScopeRepresentation

-
-
-
-

PUT /admin/realms/{realm}/client-scopes/{id}

-
-

Update the client scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ClientScopeRepresentation
-optional

ClientScopeRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

POST /admin/realms/{realm}/client-scopes

-
-

Create a new client scope Client Scope’s name must be unique!

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ClientScopeRepresentation
-optional

ClientScopeRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/client-templates

-
-

Get client scopes belonging to the realm Returns a list of client scopes belonging to the realm

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[ClientScopeRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/client-templates/{id}

-
-

Delete the client scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/client-templates/{id}

-
-

Get representation of the client scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ClientScopeRepresentation

-
-
-
-

PUT /admin/realms/{realm}/client-templates/{id}

-
-

Update the client scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ClientScopeRepresentation
-optional

ClientScopeRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

POST /admin/realms/{realm}/client-templates

-
-

Create a new client scope Client Scope’s name must be unique!

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ClientScopeRepresentation
-optional

ClientScopeRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-
-

Clients

-
-

GET /admin/realms/{realm}/clients

-
-

Get clients belonging to the realm.

-
-
-
Description
-
-

If a client can’t be retrieved from the storage due to a problem with the underlying storage, it is silently removed from the returned list. This ensures that concurrent modifications to the list don’t prevent callers from retrieving this list.

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

clientId
-optional

filter by clientId

null

first
-optional

the first result

null

max
-optional

the max results to return

null

q
-optional

null

search
-optional

whether this is a search query or a getClientById query

false

viewableOnly
-optional

filter clients that cannot be viewed in full by admin

false

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[ClientRepresentation]

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/client-secret

-
-

Get the client secret

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

CredentialRepresentation

-
-
-
-

POST /admin/realms/{realm}/clients/{id}/client-secret

-
-

Generate a new secret for the client

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

CredentialRepresentation

-
-
-
-

DELETE /admin/realms/{realm}/clients/{id}/client-secret/rotated

-
-

Invalidate the rotated secret for the client

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/client-secret/rotated

-
-

Get the rotated client secret

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

CredentialRepresentation

-
-
-
-

DELETE /admin/realms/{realm}/clients/{id}/default-client-scopes/{clientScopeId}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

clientScopeId
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

PUT /admin/realms/{realm}/clients/{id}/default-client-scopes/{clientScopeId}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

clientScopeId
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/default-client-scopes

-
-

Get default client scopes. Only name and ids are returned.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[ClientScopeRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/clients/{id}

-
-

Delete the client

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/evaluate-scopes/generate-example-access-token

-
-

Create JSON with payload of example access token

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

scope
-optional

null

userId
-optional

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

AccessToken

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/evaluate-scopes/generate-example-id-token

-
-

Create JSON with payload of example id token

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

scope
-optional

null

userId
-optional

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

IDToken

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/evaluate-scopes/generate-example-userinfo

-
-

Create JSON with payload of example user info

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

scope
-optional

null

userId
-optional

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

Map[<<>>]

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/evaluate-scopes/protocol-mappers

-
-

Return list of all protocol mappers, which will be used when generating tokens issued for particular client.

-
-
-
Description
-
-

This means protocol mappers assigned to this client directly and protocol mappers assigned to all client scopes of this client.

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

scope
-optional

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[ProtocolMapperEvaluationRepresentation]

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/evaluate-scopes/scope-mappings/{roleContainerId}/granted

-
-

Get effective scope mapping of all roles of particular role container, which this client is defacto allowed to have in the accessToken issued for him.

-
-
-
Description
-
-

This contains scope mappings, which this client has directly, as well as scope mappings, which are granted to all client scopes, which are linked with this client.

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

roleContainerId
-required

either realm name OR client UUID

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

scope
-optional

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/evaluate-scopes/scope-mappings/{roleContainerId}/not-granted

-
-

Get roles, which this client doesn’t have scope for and can’t have them in the accessToken issued for him.

-
-
-
Description
-
-

Defacto all the other roles of particular role container, which are not in {@link #getGrantedScopeMappings()}

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

roleContainerId
-required

either realm name OR client UUID

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

scope
-optional

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

GET /admin/realms/{realm}/clients/{id}

-
-

Get representation of the client

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ClientRepresentation

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/installation/providers/{providerId}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

providerId
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/management/permissions

-
-

Return object stating whether client Authorization permissions have been initialized or not and a reference

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ManagementPermissionReference

-
-
-
-

PUT /admin/realms/{realm}/clients/{id}/management/permissions

-
-

Return object stating whether client Authorization permissions have been initialized or not and a reference

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ManagementPermissionReference
-optional

ManagementPermissionReference

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ManagementPermissionReference

-
-
-
-

DELETE /admin/realms/{realm}/clients/{id}/nodes/{node}

-
-

Unregister a cluster node from the client

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

node
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

POST /admin/realms/{realm}/clients/{id}/nodes

-
-

Register a cluster node with the client Manually register cluster node to this client - usually it’s not needed to call this directly as adapter should handle by sending registration request to Keycloak

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

request_body
-optional

[string]

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/offline-session-count

-
-

Get application offline session count Returns a number of offline user sessions associated with this client { \"count\": number }

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

Map[[long]]

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/offline-sessions

-
-

Get offline sessions for client Returns a list of offline user sessions associated with this client

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

first
-optional

Paging offset

null

max
-optional

Maximum results size (defaults to 100)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[UserSessionRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/clients/{id}/optional-client-scopes/{clientScopeId}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

clientScopeId
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

PUT /admin/realms/{realm}/clients/{id}/optional-client-scopes/{clientScopeId}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

clientScopeId
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/optional-client-scopes

-
-

Get optional client scopes. Only name and ids are returned.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[ClientScopeRepresentation]

-
-
-
-

POST /admin/realms/{realm}/clients/{id}/push-revocation

-
-

Push the client’s revocation policy to its admin URL If the client has an admin URL, push revocation policy to it.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

GlobalRequestResult

-
-
-
-

PUT /admin/realms/{realm}/clients/{id}

-
-

Update the client

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ClientRepresentation
-optional

ClientRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

POST /admin/realms/{realm}/clients/{id}/registration-access-token

-
-

Generate a new registration access token for the client

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ClientRepresentation

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/service-account-user

-
-

Get a user dedicated to the service account

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

UserRepresentation

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/session-count

-
-

Get application session count Returns a number of user sessions associated with this client { \"count\": number }

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

Map[[long]]

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/test-nodes-available

-
-

Test if registered cluster nodes are available Tests availability by sending 'ping' request to all cluster nodes.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

GlobalRequestResult

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/user-sessions

-
-

Get user sessions for client Returns a list of user sessions associated with this client

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

first
-optional

Paging offset

null

max
-optional

Maximum results size (defaults to 100)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[UserSessionRepresentation]

-
-
-
-

POST /admin/realms/{realm}/clients

-
-

Create a new client Client’s client_id must be unique!

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ClientRepresentation
-optional

ClientRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-
-

Component

-
-

GET /admin/realms/{realm}/components

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

name
-optional

null

parent
-optional

null

type
-optional

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[ComponentRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/components/{id}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/components/{id}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ComponentRepresentation

-
-
-
-

PUT /admin/realms/{realm}/components/{id}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ComponentRepresentation
-optional

ComponentRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/components/{id}/sub-component-types

-
-

List of subcomponent types that are available to configure for a particular parent component.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

type
-optional

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[ComponentTypeRepresentation]

-
-
-
-

POST /admin/realms/{realm}/components

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ComponentRepresentation
-optional

ComponentRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-
-

Groups

-
-

GET /admin/realms/{realm}/groups/count

-
-

Returns the groups counts.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

search
-optional

null

top
-optional

false

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

Map[[long]]

-
-
-
-

GET /admin/realms/{realm}/groups

-
-

Get group hierarchy. Only name and ids are returned.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

true

exact
-optional

false

first
-optional

null

max
-optional

null

populateHierarchy
-optional

true

q
-optional

null

search
-optional

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[GroupRepresentation]

-
-
-
-

GET /admin/realms/{realm}/groups/{id}/children

-
-

Return a paginated list of subgroups that have a parent group corresponding to the group on the URL

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

false

first
-optional

null

max
-optional

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[GroupRepresentation]

-
-
-
-

POST /admin/realms/{realm}/groups/{id}/children

-
-

Set or create child.

-
-
-
Description
-
-

This will just set the parent if it exists. Create it and set the parent if the group doesn’t exist.

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

GroupRepresentation
-optional

GroupRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

DELETE /admin/realms/{realm}/groups/{id}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/groups/{id}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

GroupRepresentation

-
-
-
-

GET /admin/realms/{realm}/groups/{id}/management/permissions

-
-

Return object stating whether client Authorization permissions have been initialized or not and a reference

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ManagementPermissionReference

-
-
-
-

PUT /admin/realms/{realm}/groups/{id}/management/permissions

-
-

Return object stating whether client Authorization permissions have been initialized or not and a reference

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ManagementPermissionReference
-optional

ManagementPermissionReference

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ManagementPermissionReference

-
-
-
-

GET /admin/realms/{realm}/groups/{id}/members

-
-

Get users Returns a stream of users, filtered according to query parameters

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

Only return basic information (only guaranteed to return id, username, created, first and last name, email, enabled state, email verification state, federation link, and access. Note that it means that namely user attributes, required actions, and not before are not returned.)

null

first
-optional

Pagination offset

null

max
-optional

Maximum results size (defaults to 100)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[UserRepresentation]

-
-
-
-

PUT /admin/realms/{realm}/groups/{id}

-
-

Update group, ignores subgroups.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

GroupRepresentation
-optional

GroupRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

POST /admin/realms/{realm}/groups

-
-

create or add a top level realm groupSet or create child.

-
-
-
Description
-
-

This will update the group and set the parent if it exists. Create it and set the parent if the group doesn’t exist.

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

GroupRepresentation
-optional

GroupRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-
-

Identity Providers

-
-

POST /admin/realms/{realm}/identity-provider/import-config

-
-

Import identity provider from JSON body

-
-
-
Description
-
-

Import identity provider from uploaded JSON file

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

request_body
-optional

[AnyType]

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

Map[[string]]

-
-
-
-

DELETE /admin/realms/{realm}/identity-provider/instances/{alias}

-
-

Delete the identity provider

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

alias
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/identity-provider/instances/{alias}/export

-
-

Export public broker configuration for identity provider

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

alias
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

format
-optional

Format to use

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/identity-provider/instances/{alias}

-
-

Get the identity provider

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

alias
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

IdentityProviderRepresentation

-
-
-
-

GET /admin/realms/{realm}/identity-provider/instances/{alias}/management/permissions

-
-

Return object stating whether client Authorization permissions have been initialized or not and a reference

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

alias
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ManagementPermissionReference

-
-
-
-

PUT /admin/realms/{realm}/identity-provider/instances/{alias}/management/permissions

-
-

Return object stating whether client Authorization permissions have been initialized or not and a reference

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

alias
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ManagementPermissionReference
-optional

ManagementPermissionReference

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ManagementPermissionReference

-
-
-
-

GET /admin/realms/{realm}/identity-provider/instances/{alias}/mapper-types

-
-

Get mapper types for identity provider

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

alias
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    */*

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

Map[IdentityProviderMapperTypeRepresentation]

-
-
-
-

GET /admin/realms/{realm}/identity-provider/instances/{alias}/mappers

-
-

Get mappers for identity provider

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

alias
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[IdentityProviderMapperRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/identity-provider/instances/{alias}/mappers/{id}

-
-

Delete a mapper for the identity provider

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

alias
-required

null

id
-required

Mapper id

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/identity-provider/instances/{alias}/mappers/{id}

-
-

Get mapper by id for the identity provider

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

alias
-required

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

IdentityProviderMapperRepresentation

-
-
-
-

PUT /admin/realms/{realm}/identity-provider/instances/{alias}/mappers/{id}

-
-

Update a mapper for the identity provider

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

alias
-required

null

id
-required

Mapper id

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

IdentityProviderMapperRepresentation
-optional

IdentityProviderMapperRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

POST /admin/realms/{realm}/identity-provider/instances/{alias}/mappers

-
-

Add a mapper to identity provider

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

alias
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

IdentityProviderMapperRepresentation
-optional

IdentityProviderMapperRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

PUT /admin/realms/{realm}/identity-provider/instances/{alias}

-
-

Update the identity provider

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

alias
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

IdentityProviderRepresentation
-optional

IdentityProviderRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/identity-provider/instances

-
-

List identity providers

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

Boolean which defines whether brief representations are returned (default: false)

null

first
-optional

Pagination offset

null

max
-optional

Maximum results size (defaults to 100)

null

search
-optional

Filter specific providers by name. Search can be prefix (name*), contains (name) or exact (&quot;name&quot;). Default prefixed.

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[IdentityProviderRepresentation]

-
-
-
-

POST /admin/realms/{realm}/identity-provider/instances

-
-

Create a new identity provider

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

IdentityProviderRepresentation
-optional

IdentityProviderRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/identity-provider/providers/{provider_id}

-
-

Get the identity provider factory for that provider id

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

provider_id
-required

The provider id to get the factory

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

[Object]

-
-
-
-
-

Key

-
-

GET /admin/realms/{realm}/keys

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

KeysMetadataRepresentation

-
-
-
-
-

Protocol Mappers

-
-

POST /admin/realms/{realm}/client-scopes/{id}/protocol-mappers/add-models

-
-

Create multiple mappers

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ProtocolMapperRepresentation
-optional

ProtocolMapperRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

GET /admin/realms/{realm}/client-scopes/{id}/protocol-mappers/models

-
-

Get mappers

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[ProtocolMapperRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/client-scopes/{id}/protocol-mappers/models/{id}

-
-

Delete the mapper

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

Mapper id

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/client-scopes/{id}/protocol-mappers/models/{id}

-
-

Get mapper by id

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

Mapper id

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ProtocolMapperRepresentation

-
-
-
-

PUT /admin/realms/{realm}/client-scopes/{id}/protocol-mappers/models/{id}

-
-

Update the mapper

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

Mapper id

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ProtocolMapperRepresentation
-optional

ProtocolMapperRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

POST /admin/realms/{realm}/client-scopes/{id}/protocol-mappers/models

-
-

Create a mapper

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ProtocolMapperRepresentation
-optional

ProtocolMapperRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/client-scopes/{id}/protocol-mappers/protocol/{protocol}

-
-

Get mappers by name for a specific protocol

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

protocol
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[ProtocolMapperRepresentation]

-
-
-
-

POST /admin/realms/{realm}/client-templates/{id}/protocol-mappers/add-models

-
-

Create multiple mappers

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ProtocolMapperRepresentation
-optional

ProtocolMapperRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

GET /admin/realms/{realm}/client-templates/{id}/protocol-mappers/models

-
-

Get mappers

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[ProtocolMapperRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/client-templates/{id}/protocol-mappers/models/{id}

-
-

Delete the mapper

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

Mapper id

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/client-templates/{id}/protocol-mappers/models/{id}

-
-

Get mapper by id

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

Mapper id

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ProtocolMapperRepresentation

-
-
-
-

PUT /admin/realms/{realm}/client-templates/{id}/protocol-mappers/models/{id}

-
-

Update the mapper

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

Mapper id

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ProtocolMapperRepresentation
-optional

ProtocolMapperRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

POST /admin/realms/{realm}/client-templates/{id}/protocol-mappers/models

-
-

Create a mapper

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ProtocolMapperRepresentation
-optional

ProtocolMapperRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/client-templates/{id}/protocol-mappers/protocol/{protocol}

-
-

Get mappers by name for a specific protocol

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

protocol
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[ProtocolMapperRepresentation]

-
-
-
-

POST /admin/realms/{realm}/clients/{id}/protocol-mappers/add-models

-
-

Create multiple mappers

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ProtocolMapperRepresentation
-optional

ProtocolMapperRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/protocol-mappers/models

-
-

Get mappers

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[ProtocolMapperRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/clients/{id}/protocol-mappers/models/{id}

-
-

Delete the mapper

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

Mapper id

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/protocol-mappers/models/{id}

-
-

Get mapper by id

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

Mapper id

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ProtocolMapperRepresentation

-
-
-
-

PUT /admin/realms/{realm}/clients/{id}/protocol-mappers/models/{id}

-
-

Update the mapper

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

Mapper id

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ProtocolMapperRepresentation
-optional

ProtocolMapperRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

POST /admin/realms/{realm}/clients/{id}/protocol-mappers/models

-
-

Create a mapper

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ProtocolMapperRepresentation
-optional

ProtocolMapperRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/protocol-mappers/protocol/{protocol}

-
-

Get mappers by name for a specific protocol

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

protocol
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[ProtocolMapperRepresentation]

-
-
-
-
-

Realms Admin

-
-

GET /admin/realms

-
-

Get accessible realms Returns a list of accessible realms. The list is filtered based on what realms the caller is allowed to view.

-
-
-
Parameters
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

false

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RealmRepresentation]

-
-
-
-

POST /admin/realms

-
-

Import a realm. Imports a realm from a full representation of that realm.

-
-
-
Description
-
-

Realm name must be unique.

-
-
-
-
Parameters
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

body
-optional

[file]

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

DELETE /admin/realms/{realm}/admin-events

-
-

Delete all admin events

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/admin-events

-
-

Get admin events Returns all admin events, or filters events based on URL query parameters listed here

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

authClient
-optional

null

authIpAddress
-optional

null

authRealm
-optional

null

authUser
-optional

user id

null

dateFrom
-optional

null

dateTo
-optional

null

first
-optional

null

max
-optional

Maximum results size (defaults to 100)

null

operationTypes
-optional

[String]

null

resourcePath
-optional

null

resourceTypes
-optional

[String]

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[AdminEventRepresentation]

-
-
-
-

POST /admin/realms/{realm}/client-description-converter

-
-

Base path for importing clients under this realm.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

body
-optional

[string]

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ClientRepresentation

-
-
-
-

GET /admin/realms/{realm}/client-policies/policies

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ClientPoliciesRepresentation

-
-
-
-

PUT /admin/realms/{realm}/client-policies/policies

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ClientPoliciesRepresentation
-optional

ClientPoliciesRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/client-policies/profiles

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

include-global-profiles
-optional

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ClientProfilesRepresentation

-
-
-
-

PUT /admin/realms/{realm}/client-policies/profiles

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ClientProfilesRepresentation
-optional

ClientProfilesRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/client-session-stats

-
-

Get client session stats Returns a JSON map.

-
-
-
Description
-
-

The key is the client id, the value is the number of sessions that currently are active with that client. Only clients that actually have a session associated with them will be in this map.

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[[string]]

-
-
-
-

GET /admin/realms/{realm}/credential-registrators

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[[string]]

-
-
-
-

DELETE /admin/realms/{realm}/default-default-client-scopes/{clientScopeId}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

clientScopeId
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

PUT /admin/realms/{realm}/default-default-client-scopes/{clientScopeId}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

clientScopeId
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/default-default-client-scopes

-
-

Get realm default client scopes. Only name and ids are returned.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[ClientScopeRepresentation]

-
-
-
-

GET /admin/realms/{realm}/default-groups

-
-

Get group hierarchy. Only name and ids are returned.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[GroupRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/default-groups/{groupId}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

groupId
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

PUT /admin/realms/{realm}/default-groups/{groupId}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

groupId
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

DELETE /admin/realms/{realm}/default-optional-client-scopes/{clientScopeId}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

clientScopeId
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

PUT /admin/realms/{realm}/default-optional-client-scopes/{clientScopeId}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

clientScopeId
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/default-optional-client-scopes

-
-

Get realm optional client scopes. Only name and ids are returned.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[ClientScopeRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}

-
-

Delete the realm

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/events/config

-
-

Get the events provider configuration Returns JSON object with events provider configuration

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

RealmEventsConfigRepresentation

-
-
-
-

PUT /admin/realms/{realm}/events/config

-
-
Description
-
-

Update the events provider Change the events provider and/or its configuration

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RealmEventsConfigRepresentation
-optional

RealmEventsConfigRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

DELETE /admin/realms/{realm}/events

-
-

Delete all events

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/events

-
-

Get events Returns all events, or filters them based on URL query parameters listed here

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

client
-optional

App or oauth client name

null

dateFrom
-optional

From date

null

dateTo
-optional

To date

null

first
-optional

Paging offset

null

ipAddress
-optional

IP Address

null

max
-optional

Maximum results size (defaults to 100)

null

type
-optional

The types of events to return [String]

null

user
-optional

User id

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[EventRepresentation]

-
-
-
-

GET /admin/realms/{realm}

-
-

Get the top-level representation of the realm It will not include nested information like User and Client representations.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

RealmRepresentation

-
-
-
-

GET /admin/realms/{realm}/group-by-path/{path}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

path
-required

PathSegment

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

GroupRepresentation

-
-
-
-

GET /admin/realms/{realm}/localization

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[[string]]

-
-
-
-

DELETE /admin/realms/{realm}/localization/{locale}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

locale
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/localization/{locale}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

locale
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

useRealmDefaultLocaleFallback
-optional

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

Map[[string]]

-
-
-
-

DELETE /admin/realms/{realm}/localization/{locale}/{key}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

key
-required

null

locale
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/localization/{locale}/{key}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

key
-required

null

locale
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    text/plain

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

[String]

-
-
-
-

PUT /admin/realms/{realm}/localization/{locale}/{key}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

key
-required

null

locale
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

body
-optional

[string]

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

POST /admin/realms/{realm}/localization/{locale}

-
-

Import localization from uploaded JSON file

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

locale
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

request_body
-optional

[string]

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

POST /admin/realms/{realm}/logout-all

-
-

Removes all user sessions.

-
-
-
Description
-
-

Any client that has an admin url will also be told to invalidate any sessions they have.

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

GlobalRequestResult

-
-
-
-

POST /admin/realms/{realm}/partial-export

-
-

Partial export of existing realm into a JSON file.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

exportClients
-optional

null

exportGroupsAndRoles
-optional

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

POST /admin/realms/{realm}/partialImport

-
-

Partial import from a JSON file to an existing realm.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

body
-optional

[file]

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

POST /admin/realms/{realm}/push-revocation

-
-

Push the realm’s revocation policy to any client that has an admin url associated with it.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

GlobalRequestResult

-
-
-
-

PUT /admin/realms/{realm}

-
-

Update the top-level information of the realm Any user, roles or client information in the representation will be ignored.

-
-
-
Description
-
-

This will only update top-level attributes of the realm.

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RealmRepresentation
-optional

RealmRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

DELETE /admin/realms/{realm}/sessions/{session}

-
-

Remove a specific user session.

-
-
-
Description
-
-

Any client that has an admin url will also be told to invalidate this particular session.

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

session
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

POST /admin/realms/{realm}/testSMTPConnection

-
-

Test SMTP connection with current logged in user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

request_body
-optional

[string]

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/users-management-permissions

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ManagementPermissionReference

-
-
-
-

PUT /admin/realms/{realm}/users-management-permissions

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ManagementPermissionReference
-optional

ManagementPermissionReference

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ManagementPermissionReference

-
-
-
-
-

Role Mapper

-
-

GET /admin/realms/{realm}/groups/{id}/role-mappings

-
-

Get role mappings

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

MappingsRepresentation

-
-
-
-

GET /admin/realms/{realm}/groups/{id}/role-mappings/realm/available

-
-

Get realm-level roles that can be mapped

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

GET /admin/realms/{realm}/groups/{id}/role-mappings/realm/composite

-
-

Get effective realm-level role mappings This will recurse all composite roles to get the result.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

if false, return roles with their attributes

true

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/groups/{id}/role-mappings/realm

-
-

Delete realm-level role mappings

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/groups/{id}/role-mappings/realm

-
-

Get realm-level role mappings

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

POST /admin/realms/{realm}/groups/{id}/role-mappings/realm

-
-

Add realm-level role mappings to the user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

GET /admin/realms/{realm}/users/{id}/role-mappings

-
-

Get role mappings

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

MappingsRepresentation

-
-
-
-

GET /admin/realms/{realm}/users/{id}/role-mappings/realm/available

-
-

Get realm-level roles that can be mapped

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

GET /admin/realms/{realm}/users/{id}/role-mappings/realm/composite

-
-

Get effective realm-level role mappings This will recurse all composite roles to get the result.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

if false, return roles with their attributes

true

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/users/{id}/role-mappings/realm

-
-

Delete realm-level role mappings

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/users/{id}/role-mappings/realm

-
-

Get realm-level role mappings

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

POST /admin/realms/{realm}/users/{id}/role-mappings/realm

-
-

Add realm-level role mappings to the user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-
-

Roles

-
-

GET /admin/realms/{realm}/clients/{id}/roles

-
-

Get all roles for the realm or client

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

true

first
-optional

null

max
-optional

null

search
-optional

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

POST /admin/realms/{realm}/clients/{id}/roles

-
-

Create a new role for the realm or client

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/roles/{role-name}/composites/clients/{clientUuid}

-
-

Get client-level roles for the client that are in the role’s composite

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

clientUuid
-required

null

role-name
-required

role's name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/clients/{id}/roles/{role-name}/composites

-
-

Remove roles from the role’s composite

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

role-name
-required

role's name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/roles/{role-name}/composites

-
-

Get composites of the role

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

role-name
-required

role's name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

POST /admin/realms/{realm}/clients/{id}/roles/{role-name}/composites

-
-

Add a composite to the role

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

role-name
-required

role's name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/roles/{role-name}/composites/realm

-
-

Get realm-level roles of the role’s composite

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

role-name
-required

role's name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/clients/{id}/roles/{role-name}

-
-

Delete a role by name

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

role-name
-required

role's name (not id!)

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/roles/{role-name}

-
-

Get a role by name

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

role-name
-required

role's name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

RoleRepresentation

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/roles/{role-name}/groups

-
-

Returns a stream of groups that have the specified role name

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

role-name
-required

the role name.

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

if false, return a full representation of the {@code GroupRepresentation} objects.

true

first
-optional

first result to return. Ignored if negative or {@code null}.

null

max
-optional

maximum number of results to return. Ignored if negative or {@code null}.

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[GroupRepresentation]

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/roles/{role-name}/management/permissions

-
-

Return object stating whether role Authorization permissions have been initialized or not and a reference

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

role-name
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ManagementPermissionReference

-
-
-
-

PUT /admin/realms/{realm}/clients/{id}/roles/{role-name}/management/permissions

-
-

Return object stating whether role Authorization permissions have been initialized or not and a reference

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

role-name
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ManagementPermissionReference
-optional

ManagementPermissionReference

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ManagementPermissionReference

-
-
-
-

PUT /admin/realms/{realm}/clients/{id}/roles/{role-name}

-
-

Update a role by name

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

role-name
-required

role's name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/roles/{role-name}/users

-
-

Returns a stream of users that have the specified role name.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

role-name
-required

the role name.

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

first
-optional

first result to return. Ignored if negative or {@code null}.

null

max
-optional

maximum number of results to return. Ignored if negative or {@code null}.

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[UserRepresentation]

-
-
-
-

GET /admin/realms/{realm}/roles

-
-

Get all roles for the realm or client

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

true

first
-optional

null

max
-optional

null

search
-optional

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

POST /admin/realms/{realm}/roles

-
-

Create a new role for the realm or client

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/roles/{role-name}/composites/clients/{clientUuid}

-
-

Get client-level roles for the client that are in the role’s composite

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

clientUuid
-required

null

role-name
-required

role's name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/roles/{role-name}/composites

-
-

Remove roles from the role’s composite

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-name
-required

role's name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/roles/{role-name}/composites

-
-

Get composites of the role

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-name
-required

role's name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

POST /admin/realms/{realm}/roles/{role-name}/composites

-
-

Add a composite to the role

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-name
-required

role's name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

GET /admin/realms/{realm}/roles/{role-name}/composites/realm

-
-

Get realm-level roles of the role’s composite

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-name
-required

role's name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/roles/{role-name}

-
-

Delete a role by name

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-name
-required

role's name (not id!)

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/roles/{role-name}

-
-

Get a role by name

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-name
-required

role's name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

RoleRepresentation

-
-
-
-

GET /admin/realms/{realm}/roles/{role-name}/groups

-
-

Returns a stream of groups that have the specified role name

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-name
-required

the role name.

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

if false, return a full representation of the {@code GroupRepresentation} objects.

true

first
-optional

first result to return. Ignored if negative or {@code null}.

null

max
-optional

maximum number of results to return. Ignored if negative or {@code null}.

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[GroupRepresentation]

-
-
-
-

GET /admin/realms/{realm}/roles/{role-name}/management/permissions

-
-

Return object stating whether role Authorization permissions have been initialized or not and a reference

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-name
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ManagementPermissionReference

-
-
-
-

PUT /admin/realms/{realm}/roles/{role-name}/management/permissions

-
-

Return object stating whether role Authorization permissions have been initialized or not and a reference

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-name
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ManagementPermissionReference
-optional

ManagementPermissionReference

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ManagementPermissionReference

-
-
-
-

PUT /admin/realms/{realm}/roles/{role-name}

-
-

Update a role by name

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-name
-required

role's name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/roles/{role-name}/users

-
-

Returns a stream of users that have the specified role name.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-name
-required

the role name.

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

first
-optional

first result to return. Ignored if negative or {@code null}.

null

max
-optional

maximum number of results to return. Ignored if negative or {@code null}.

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[UserRepresentation]

-
-
-
-
-

Roles (by ID)

-
-

GET /admin/realms/{realm}/roles-by-id/{role-id}/composites/clients/{clientUuid}

-
-

Get client-level roles for the client that are in the role’s composite

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

clientUuid
-required

null

role-id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/roles-by-id/{role-id}/composites

-
-

Remove a set of roles from the role’s composite

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-id
-required

Role id

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/roles-by-id/{role-id}/composites

-
-

Get role’s children Returns a set of role’s children provided the role is a composite.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

first
-optional

null

max
-optional

null

search
-optional

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

POST /admin/realms/{realm}/roles-by-id/{role-id}/composites

-
-

Make the role a composite role by associating some child roles

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

GET /admin/realms/{realm}/roles-by-id/{role-id}/composites/realm

-
-

Get realm-level roles that are in the role’s composite

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/roles-by-id/{role-id}

-
-

Delete the role

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-id
-required

id of role

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/roles-by-id/{role-id}

-
-

Get a specific role’s representation

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-id
-required

id of role

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

RoleRepresentation

-
-
-
-

GET /admin/realms/{realm}/roles-by-id/{role-id}/management/permissions

-
-

Return object stating whether role Authorization permissions have been initialized or not and a reference

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ManagementPermissionReference

-
-
-
-

PUT /admin/realms/{realm}/roles-by-id/{role-id}/management/permissions

-
-

Return object stating whether role Authorization permissions have been initialized or not and a reference

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

ManagementPermissionReference
-optional

ManagementPermissionReference

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

ManagementPermissionReference

-
-
-
-

PUT /admin/realms/{realm}/roles-by-id/{role-id}

-
-

Update the role

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

role-id
-required

id of role

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-
-

Scope Mappings

-
-

GET /admin/realms/{realm}/client-scopes/{id}/scope-mappings/clients/{client}/available

-
-

The available client-level roles Returns the roles for the client that can be associated with the client’s scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

GET /admin/realms/{realm}/client-scopes/{id}/scope-mappings/clients/{client}/composite

-
-

Get effective client roles Returns the roles for the client that are associated with the client’s scope.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

if false, return roles with their attributes

true

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/client-scopes/{id}/scope-mappings/clients/{client}

-
-

Remove client-level roles from the client’s scope.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/client-scopes/{id}/scope-mappings/clients/{client}

-
-

Get the roles associated with a client’s scope Returns roles for the client.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

POST /admin/realms/{realm}/client-scopes/{id}/scope-mappings/clients/{client}

-
-

Add client-level roles to the client’s scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

GET /admin/realms/{realm}/client-scopes/{id}/scope-mappings

-
-

Get all scope mappings for the client

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

MappingsRepresentation

-
-
-
-

GET /admin/realms/{realm}/client-scopes/{id}/scope-mappings/realm/available

-
-

Get realm-level roles that are available to attach to this client’s scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

GET /admin/realms/{realm}/client-scopes/{id}/scope-mappings/realm/composite

-
-

Get effective realm-level roles associated with the client’s scope What this does is recurse any composite roles associated with the client’s scope and adds the roles to this lists.

-
-
-
Description
-
-

The method is really to show a comprehensive total view of realm-level roles associated with the client.

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

if false, return roles with their attributes

true

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/client-scopes/{id}/scope-mappings/realm

-
-

Remove a set of realm-level roles from the client’s scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/client-scopes/{id}/scope-mappings/realm

-
-

Get realm-level roles associated with the client’s scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

POST /admin/realms/{realm}/client-scopes/{id}/scope-mappings/realm

-
-

Add a set of realm-level roles to the client’s scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

GET /admin/realms/{realm}/client-templates/{id}/scope-mappings/clients/{client}/available

-
-

The available client-level roles Returns the roles for the client that can be associated with the client’s scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

GET /admin/realms/{realm}/client-templates/{id}/scope-mappings/clients/{client}/composite

-
-

Get effective client roles Returns the roles for the client that are associated with the client’s scope.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

if false, return roles with their attributes

true

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/client-templates/{id}/scope-mappings/clients/{client}

-
-

Remove client-level roles from the client’s scope.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/client-templates/{id}/scope-mappings/clients/{client}

-
-

Get the roles associated with a client’s scope Returns roles for the client.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

POST /admin/realms/{realm}/client-templates/{id}/scope-mappings/clients/{client}

-
-

Add client-level roles to the client’s scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

GET /admin/realms/{realm}/client-templates/{id}/scope-mappings

-
-

Get all scope mappings for the client

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

MappingsRepresentation

-
-
-
-

GET /admin/realms/{realm}/client-templates/{id}/scope-mappings/realm/available

-
-

Get realm-level roles that are available to attach to this client’s scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

GET /admin/realms/{realm}/client-templates/{id}/scope-mappings/realm/composite

-
-

Get effective realm-level roles associated with the client’s scope What this does is recurse any composite roles associated with the client’s scope and adds the roles to this lists.

-
-
-
Description
-
-

The method is really to show a comprehensive total view of realm-level roles associated with the client.

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

if false, return roles with their attributes

true

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/client-templates/{id}/scope-mappings/realm

-
-

Remove a set of realm-level roles from the client’s scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/client-templates/{id}/scope-mappings/realm

-
-

Get realm-level roles associated with the client’s scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

POST /admin/realms/{realm}/client-templates/{id}/scope-mappings/realm

-
-

Add a set of realm-level roles to the client’s scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/scope-mappings/clients/{client}/available

-
-

The available client-level roles Returns the roles for the client that can be associated with the client’s scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/scope-mappings/clients/{client}/composite

-
-

Get effective client roles Returns the roles for the client that are associated with the client’s scope.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

if false, return roles with their attributes

true

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/clients/{id}/scope-mappings/clients/{client}

-
-

Remove client-level roles from the client’s scope.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/scope-mappings/clients/{client}

-
-

Get the roles associated with a client’s scope Returns roles for the client.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

POST /admin/realms/{realm}/clients/{id}/scope-mappings/clients/{client}

-
-

Add client-level roles to the client’s scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/scope-mappings

-
-

Get all scope mappings for the client

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

MappingsRepresentation

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/scope-mappings/realm/available

-
-

Get realm-level roles that are available to attach to this client’s scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/scope-mappings/realm/composite

-
-

Get effective realm-level roles associated with the client’s scope What this does is recurse any composite roles associated with the client’s scope and adds the roles to this lists.

-
-
-
Description
-
-

The method is really to show a comprehensive total view of realm-level roles associated with the client.

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

if false, return roles with their attributes

true

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/clients/{id}/scope-mappings/realm

-
-

Remove a set of realm-level roles from the client’s scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/clients/{id}/scope-mappings/realm

-
-

Get realm-level roles associated with the client’s scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[RoleRepresentation]

-
-
-
-

POST /admin/realms/{realm}/clients/{id}/scope-mappings/realm

-
-

Add a set of realm-level roles to the client’s scope

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

RoleRepresentation
-optional

RoleRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-
-

Users

-
-

GET /admin/realms/{realm}/users/count

-
-

Returns the number of users that match the given criteria.

-
-
-
Description
-
-

It can be called in three different ways. 1. Don’t specify any criteria and pass {@code null}. The number of all users within that realm will be returned. <p> 2. If {@code search} is specified other criteria such as {@code last} will be ignored even though you set them. The {@code search} string will be matched against the first and last name, the username and the email of a user. <p> 3. If {@code search} is unspecified but any of {@code last}, {@code first}, {@code email} or {@code username} those criteria are matched against their respective fields on a user entity. Combined with a logical and.

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

email
-optional

email filter

null

emailVerified
-optional

null

enabled
-optional

Boolean representing if user is enabled or not

null

firstName
-optional

first name filter

null

lastName
-optional

last name filter

null

q
-optional

null

search
-optional

arbitrary search string for all the fields below. Default search behavior is prefix-based (e.g., foo or foo*). Use foo for infix search and &quot;foo&quot; for exact search.

null

username
-optional

username filter

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

[Integer]

-
-
-
-

GET /admin/realms/{realm}/users

-
-

Get users Returns a stream of users, filtered according to query parameters.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

Boolean which defines whether brief representations are returned (default: false)

null

email
-optional

A String contained in email, or the complete email, if param &quot;exact&quot; is true

null

emailVerified
-optional

whether the email has been verified

null

enabled
-optional

Boolean representing if user is enabled or not

null

exact
-optional

Boolean which defines whether the params &quot;last&quot;, &quot;first&quot;, &quot;email&quot; and &quot;username&quot; must match exactly

null

first
-optional

Pagination offset

null

firstName
-optional

A String contained in firstName, or the complete firstName, if param &quot;exact&quot; is true

null

idpAlias
-optional

The alias of an Identity Provider linked to the user

null

idpUserId
-optional

The userId at an Identity Provider linked to the user

null

lastName
-optional

A String contained in lastName, or the complete lastName, if param &quot;exact&quot; is true

null

max
-optional

Maximum results size (defaults to 100)

null

q
-optional

A query to search for custom attributes, in the format 'key1:value2 key2:value2'

null

search
-optional

A String contained in username, first or last name, or email. Default search behavior is prefix-based (e.g., foo or foo*). Use foo for infix search and &quot;foo&quot; for exact search.

null

username
-optional

A String contained in username, or the complete username, if param &quot;exact&quot; is true

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[UserRepresentation]

-
-
-
-

GET /admin/realms/{realm}/users/{id}/configured-user-storage-credential-types

-
-

Return credential types, which are provided by the user storage where user is stored.

-
-
-
Description
-
-

Returned values can contain for example \"password\", \"otp\" etc. This will always return empty list for \"local\" users, which are not backed by any user storage

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[[string]]

-
-
-
-

DELETE /admin/realms/{realm}/users/{id}/consents/{client}

-
-

Revoke consent and offline tokens for particular client from user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

client
-required

Client id

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/users/{id}/consents

-
-

Get consents granted by the user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[[AnyType]]

-
-
-
-

DELETE /admin/realms/{realm}/users/{id}/credentials/{credentialId}

-
-

Remove a credential for a user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

credentialId
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

POST /admin/realms/{realm}/users/{id}/credentials/{credentialId}/moveAfter/{newPreviousCredentialId}

-
-

Move a credential to a position behind another credential

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

credentialId
-required

The credential to move

null

newPreviousCredentialId
-required

The credential that will be the previous element in the list. If set to null, the moved credential will be the first element in the list.

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

POST /admin/realms/{realm}/users/{id}/credentials/{credentialId}/moveToFirst

-
-

Move a credential to a first position in the credentials list of the user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

credentialId
-required

The credential to move

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

PUT /admin/realms/{realm}/users/{id}/credentials/{credentialId}/userLabel

-
-

Update a credential label for a user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

credentialId
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

body
-optional

[string]

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

GET /admin/realms/{realm}/users/{id}/credentials

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[CredentialRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/users/{id}

-
-

Delete the user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

PUT /admin/realms/{realm}/users/{id}/disable-credential-types

-
-

Disable all credentials for a user of a specific type

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

string
-optional

[string]

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

PUT /admin/realms/{realm}/users/{id}/execute-actions-email

-
-

Send an email to the user with a link they can click to execute particular actions.

-
-
-
Description
-
-

An email contains a link the user can click to perform a set of required actions. The redirectUri and clientId parameters are optional. If no redirect is given, then there will be no link back to click after actions have completed. Redirect uri must be a valid uri for the particular clientId.

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

string
-optional

[string]

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

client_id
-optional

Client id

null

lifespan
-optional

Number of seconds after which the generated token expires

null

redirect_uri
-optional

Redirect uri

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/users/{id}/federated-identity

-
-

Get social logins associated with the user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[FederatedIdentityRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/users/{id}/federated-identity/{provider}

-
-

Remove a social login provider from user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

provider
-required

Social login provider id

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

POST /admin/realms/{realm}/users/{id}/federated-identity/{provider}

-
-

Add a social login provider to the user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

provider
-required

Social login provider id

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/users/{id}

-
-

Get representation of the user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

userProfileMetadata
-optional

Indicates if the user profile metadata should be added to the response

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

UserRepresentation

-
-
-
-

GET /admin/realms/{realm}/users/{id}/groups/count

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

search
-optional

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

Map[[long]]

-
-
-
-

GET /admin/realms/{realm}/users/{id}/groups

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

briefRepresentation
-optional

true

first
-optional

null

max
-optional

null

search
-optional

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[GroupRepresentation]

-
-
-
-

DELETE /admin/realms/{realm}/users/{id}/groups/{groupId}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

groupId
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

PUT /admin/realms/{realm}/users/{id}/groups/{groupId}

-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

groupId
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

POST /admin/realms/{realm}/users/{id}/impersonation

-
-

Impersonate the user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

Map[<<>>]

-
-
-
-

POST /admin/realms/{realm}/users/{id}/logout

-
-

Remove all user sessions associated with the user Also send notification to all clients that have an admin URL to invalidate the sessions for the particular user.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

201

Created

<<>>

-
-
-
-

GET /admin/realms/{realm}/users/{id}/offline-sessions/{clientUuid}

-
-

Get offline sessions associated with the user and client

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

clientUuid
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[UserSessionRepresentation]

-
-
-
-

PUT /admin/realms/{realm}/users/{id}

-
-

Update the user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

UserRepresentation
-optional

UserRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

PUT /admin/realms/{realm}/users/{id}/reset-password-email

-
-

Send an email to the user with a link they can click to reset their password.

-
-
-
Description
-
-

The redirectUri and clientId parameters are optional. The default for the redirect is the account client. This endpoint has been deprecated. Please use the execute-actions-email passing a list with UPDATE_PASSWORD within it.

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

client_id
-optional

client id

null

redirect_uri
-optional

redirect uri

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

PUT /admin/realms/{realm}/users/{id}/reset-password

-
-

Set up a new password for the user.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

CredentialRepresentation
-optional

CredentialRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

204

No Content

<<>>

-
-
-
-

PUT /admin/realms/{realm}/users/{id}/send-verify-email

-
-

Send an email-verification email to the user An email contains a link the user can click to verify their email address.

-
-
-
Description
-
-

The redirectUri and clientId parameters are optional. The default for the redirect is the account client.

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
Query Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

client_id
-optional

Client id

null

redirect_uri
-optional

Redirect uri

null

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/users/{id}/sessions

-
-

Get sessions associated with the user

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

id
-required

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

List[UserSessionRepresentation]

-
-
-
-

POST /admin/realms/{realm}/users

-
-

Create a new user Username must be unique.

-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

UserRepresentation
-optional

UserRepresentation

-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

<<>>

-
-
-
-

GET /admin/realms/{realm}/users/profile

-
-
Description
-
-

Get the configuration for the user profile

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

UPConfig

-
-
-
-

GET /admin/realms/{realm}/users/profile/metadata

-
-
Description
-
-

Get the UserProfileMetadata from the configuration

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

UserProfileMetadata

-
-
-
-

PUT /admin/realms/{realm}/users/profile

-
-
Description
-
-

Set the configuration for the user profile

-
-
-
-
Parameters
-
-
Path Parameters
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

realm
-required

realm name (not id!)

null

-
-
-
Body Parameter
- ------ - - - - - - - - - - - - - - - - -
NameDescriptionDefaultPattern

UPConfig
-optional

UPConfig

-
-
-
-
Content Type
-
-
    -
  • -

    application/json

    -
  • -
-
-
-
-
Responses
- ----- - - - - - - - - - - - - - - -
CodeMessageDatatype

200

OK

UPConfig

-
-
-
-
-
-
-

Definitions

-
-
-

Access

- ----- - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

roles
-optional

Set of [string]

verify_caller
-optional

Boolean

-
-
-

AccessToken

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

jti
-optional

String

exp
-optional

Long

int64

nbf
-optional

Long

int64

iat
-optional

Long

int64

iss
-optional

String

sub
-optional

String

typ
-optional

String

azp
-optional

String

otherClaims
-optional

Map of [AnyType]

nonce
-optional

String

auth_time
-optional

Long

int64

session_state
-optional

String

at_hash
-optional

String

c_hash
-optional

String

name
-optional

String

given_name
-optional

String

family_name
-optional

String

middle_name
-optional

String

nickname
-optional

String

preferred_username
-optional

String

profile
-optional

String

picture
-optional

String

website
-optional

String

email
-optional

String

email_verified
-optional

Boolean

gender
-optional

String

birthdate
-optional

String

zoneinfo
-optional

String

locale
-optional

String

phone_number
-optional

String

phone_number_verified
-optional

Boolean

address
-optional

AddressClaimSet

updated_at
-optional

Long

int64

claims_locales
-optional

String

acr
-optional

String

s_hash
-optional

String

authTime
-optional

Integer

int32

sid
-optional

String

trusted-certs
-optional

Set of [string]

allowed-origins
-optional

Set of [string]

realm_access
-optional

Access

resource_access
-optional

Map of Access

authorization
-optional

Authorization

cnf
-optional

Confirmation

scope
-optional

String

-
-
-

AddressClaimSet

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

formatted
-optional

String

street_address
-optional

String

locality
-optional

String

region
-optional

String

postal_code
-optional

String

country
-optional

String

-
-
-

AdminEventRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

time
-optional

Long

int64

realmId
-optional

String

authDetails
-optional

AuthDetailsRepresentation

operationType
-optional

String

resourceType
-optional

String

resourcePath
-optional

String

representation
-optional

String

error
-optional

String

-
-
-

ApplicationRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

clientId
-optional

String

description
-optional

String

rootUrl
-optional

String

adminUrl
-optional

String

baseUrl
-optional

String

surrogateAuthRequired
-optional

Boolean

enabled
-optional

Boolean

alwaysDisplayInConsole
-optional

Boolean

clientAuthenticatorType
-optional

String

secret
-optional

String

registrationAccessToken
-optional

String

defaultRoles
-optional

List of [string]

redirectUris
-optional

List of [string]

webOrigins
-optional

List of [string]

notBefore
-optional

Integer

int32

bearerOnly
-optional

Boolean

consentRequired
-optional

Boolean

standardFlowEnabled
-optional

Boolean

implicitFlowEnabled
-optional

Boolean

directAccessGrantsEnabled
-optional

Boolean

serviceAccountsEnabled
-optional

Boolean

oauth2DeviceAuthorizationGrantEnabled
-optional

Boolean

authorizationServicesEnabled
-optional

Boolean

directGrantsOnly
-optional

Boolean

publicClient
-optional

Boolean

frontchannelLogout
-optional

Boolean

protocol
-optional

String

attributes
-optional

Map of [string]

authenticationFlowBindingOverrides
-optional

Map of [string]

fullScopeAllowed
-optional

Boolean

nodeReRegistrationTimeout
-optional

Integer

int32

registeredNodes
-optional

Map of [integer]

int32

protocolMappers
-optional

List of ProtocolMapperRepresentation

clientTemplate
-optional

String

useTemplateConfig
-optional

Boolean

useTemplateScope
-optional

Boolean

useTemplateMappers
-optional

Boolean

defaultClientScopes
-optional

List of [string]

optionalClientScopes
-optional

List of [string]

authorizationSettings
-optional

ResourceServerRepresentation

access
-optional

Map of [boolean]

origin
-optional

String

name
-optional

String

claims
-optional

ApplicationRepresentation_claims

-
-
-

ApplicationRepresentationClaims

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

name
-optional

Boolean

username
-optional

Boolean

profile
-optional

Boolean

picture
-optional

Boolean

website
-optional

Boolean

email
-optional

Boolean

gender
-optional

Boolean

locale
-optional

Boolean

address
-optional

Boolean

phone
-optional

Boolean

-
-
-

AuthDetailsRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

realmId
-optional

String

clientId
-optional

String

userId
-optional

String

ipAddress
-optional

String

-
-
-

AuthenticationExecutionExportRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

authenticatorConfig
-optional

String

authenticator
-optional

String

authenticatorFlow
-optional

Boolean

requirement
-optional

String

priority
-optional

Integer

int32

autheticatorFlow
-optional

Boolean

flowAlias
-optional

String

userSetupAllowed
-optional

Boolean

-
-
-

AuthenticationExecutionInfoRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

requirement
-optional

String

displayName
-optional

String

alias
-optional

String

description
-optional

String

requirementChoices
-optional

List of [string]

configurable
-optional

Boolean

authenticationFlow
-optional

Boolean

providerId
-optional

String

authenticationConfig
-optional

String

flowId
-optional

String

level
-optional

Integer

int32

index
-optional

Integer

int32

-
-
-

AuthenticationExecutionRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

authenticatorConfig
-optional

String

authenticator
-optional

String

authenticatorFlow
-optional

Boolean

requirement
-optional

String

priority
-optional

Integer

int32

autheticatorFlow
-optional

Boolean

id
-optional

String

flowId
-optional

String

parentFlow
-optional

String

-
-
-

AuthenticationFlowRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

alias
-optional

String

description
-optional

String

providerId
-optional

String

topLevel
-optional

Boolean

builtIn
-optional

Boolean

authenticationExecutions
-optional

List of AuthenticationExecutionExportRepresentation

-
-
-

AuthenticatorConfigInfoRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

name
-optional

String

providerId
-optional

String

helpText
-optional

String

properties
-optional

List of ConfigPropertyRepresentation

-
-
-

AuthenticatorConfigRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

alias
-optional

String

config
-optional

Map of [string]

-
-
-

Authorization

- ----- - - - - - - - - - - - - - - -
NameTypeFormat

permissions
-optional

List of Permission

-
-
-

CertificateRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

privateKey
-optional

String

publicKey
-optional

String

certificate
-optional

String

kid
-optional

String

-
-
-

ClaimRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

name
-optional

Boolean

username
-optional

Boolean

profile
-optional

Boolean

picture
-optional

Boolean

website
-optional

Boolean

email
-optional

Boolean

gender
-optional

Boolean

locale
-optional

Boolean

address
-optional

Boolean

phone
-optional

Boolean

-
-
-

ClientInitialAccessCreatePresentation

- ----- - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

expiration
-optional

Integer

int32

count
-optional

Integer

int32

-
-
-

ClientInitialAccessPresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

token
-optional

String

timestamp
-optional

Integer

int32

expiration
-optional

Integer

int32

count
-optional

Integer

int32

remainingCount
-optional

Integer

int32

-
-
-

ClientMappingsRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

client
-optional

String

mappings
-optional

List of RoleRepresentation

-
-
-

ClientPoliciesRepresentation

- ----- - - - - - - - - - - - - - - -
NameTypeFormat

policies
-optional

List of ClientPolicyRepresentation

-
-
-

ClientPolicyConditionRepresentation

- ----- - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

condition
-optional

String

configuration
-optional

List

-
-
-

ClientPolicyExecutorRepresentation

- ----- - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

executor
-optional

String

configuration
-optional

List

-
-
-

ClientPolicyRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

name
-optional

String

description
-optional

String

enabled
-optional

Boolean

conditions
-optional

List of ClientPolicyConditionRepresentation

profiles
-optional

List of [string]

-
-
-

ClientProfileRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

name
-optional

String

description
-optional

String

executors
-optional

List of ClientPolicyExecutorRepresentation

-
-
-

ClientProfilesRepresentation

- ----- - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

profiles
-optional

List of ClientProfileRepresentation

globalProfiles
-optional

List of ClientProfileRepresentation

-
-
-

ClientRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

clientId
-optional

String

name
-optional

String

description
-optional

String

rootUrl
-optional

String

adminUrl
-optional

String

baseUrl
-optional

String

surrogateAuthRequired
-optional

Boolean

enabled
-optional

Boolean

alwaysDisplayInConsole
-optional

Boolean

clientAuthenticatorType
-optional

String

secret
-optional

String

registrationAccessToken
-optional

String

defaultRoles
-optional

List of [string]

redirectUris
-optional

List of [string]

webOrigins
-optional

List of [string]

notBefore
-optional

Integer

int32

bearerOnly
-optional

Boolean

consentRequired
-optional

Boolean

standardFlowEnabled
-optional

Boolean

implicitFlowEnabled
-optional

Boolean

directAccessGrantsEnabled
-optional

Boolean

serviceAccountsEnabled
-optional

Boolean

oauth2DeviceAuthorizationGrantEnabled
-optional

Boolean

authorizationServicesEnabled
-optional

Boolean

directGrantsOnly
-optional

Boolean

publicClient
-optional

Boolean

frontchannelLogout
-optional

Boolean

protocol
-optional

String

attributes
-optional

Map of [string]

authenticationFlowBindingOverrides
-optional

Map of [string]

fullScopeAllowed
-optional

Boolean

nodeReRegistrationTimeout
-optional

Integer

int32

registeredNodes
-optional

Map of [integer]

int32

protocolMappers
-optional

List of ProtocolMapperRepresentation

clientTemplate
-optional

String

useTemplateConfig
-optional

Boolean

useTemplateScope
-optional

Boolean

useTemplateMappers
-optional

Boolean

defaultClientScopes
-optional

List of [string]

optionalClientScopes
-optional

List of [string]

authorizationSettings
-optional

ResourceServerRepresentation

access
-optional

Map of [boolean]

origin
-optional

String

-
-
-

ClientScopeRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

name
-optional

String

description
-optional

String

protocol
-optional

String

attributes
-optional

Map of [string]

protocolMappers
-optional

List of ProtocolMapperRepresentation

-
-
-

ClientTemplateRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

name
-optional

String

description
-optional

String

protocol
-optional

String

fullScopeAllowed
-optional

Boolean

bearerOnly
-optional

Boolean

consentRequired
-optional

Boolean

standardFlowEnabled
-optional

Boolean

implicitFlowEnabled
-optional

Boolean

directAccessGrantsEnabled
-optional

Boolean

serviceAccountsEnabled
-optional

Boolean

publicClient
-optional

Boolean

frontchannelLogout
-optional

Boolean

attributes
-optional

Map of [string]

protocolMappers
-optional

List of ProtocolMapperRepresentation

-
-
-

ComponentExportRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

name
-optional

String

providerId
-optional

String

subType
-optional

String

subComponents
-optional

Map of [array]

config
-optional

Map of [array]

-
-
-

ComponentRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

name
-optional

String

providerId
-optional

String

providerType
-optional

String

parentId
-optional

String

subType
-optional

String

config
-optional

Map of [array]

-
-
-

ComponentTypeRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

helpText
-optional

String

properties
-optional

List of ConfigPropertyRepresentation

metadata
-optional

Map of [AnyType]

-
-
-

Composites

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

realm
-optional

Set of [string]

client
-optional

Map of [array]

application
-optional

Map of [array]

-
-
-

ConfigPropertyRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

name
-optional

String

label
-optional

String

helpText
-optional

String

type
-optional

String

defaultValue
-optional

oas_any_type_not_mapped

options
-optional

List of [string]

secret
-optional

Boolean

required
-optional

Boolean

readOnly
-optional

Boolean

-
-
-

Confirmation

- ----- - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

x5t#S256
-optional

String

jkt
-optional

String

-
-
-

CredentialRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

type
-optional

String

userLabel
-optional

String

createdDate
-optional

Long

int64

secretData
-optional

String

credentialData
-optional

String

priority
-optional

Integer

int32

value
-optional

String

temporary
-optional

Boolean

device
-optional

String

hashedSaltedValue
-optional

String

salt
-optional

String

hashIterations
-optional

Integer

int32

counter
-optional

Integer

int32

algorithm
-optional

String

digits
-optional

Integer

int32

period
-optional

Integer

int32

config
-optional

Map

-
-
-

DecisionStrategy

- ----- - - - - - - - -
NameTypeFormat
-
-
-

EnforcementMode

- ----- - - - - - - - -
NameTypeFormat
-
-
-

EventRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

time
-optional

Long

int64

type
-optional

String

realmId
-optional

String

clientId
-optional

String

userId
-optional

String

sessionId
-optional

String

ipAddress
-optional

String

error
-optional

String

details
-optional

Map of [string]

-
-
-

FederatedIdentityRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

identityProvider
-optional

String

userId
-optional

String

userName
-optional

String

-
-
-

GlobalRequestResult

- ----- - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

successRequests
-optional

List of [string]

failedRequests
-optional

List of [string]

-
-
-

GroupRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

name
-optional

String

path
-optional

String

parentId
-optional

String

subGroupCount
-optional

Long

int64

subGroups
-optional

List of GroupRepresentation

attributes
-optional

Map of [array]

realmRoles
-optional

List of [string]

clientRoles
-optional

Map of [array]

access
-optional

Map of [boolean]

-
-
-

IDToken

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

jti
-optional

String

exp
-optional

Long

int64

nbf
-optional

Long

int64

iat
-optional

Long

int64

iss
-optional

String

sub
-optional

String

typ
-optional

String

azp
-optional

String

otherClaims
-optional

Map of [AnyType]

nonce
-optional

String

auth_time
-optional

Long

int64

session_state
-optional

String

at_hash
-optional

String

c_hash
-optional

String

name
-optional

String

given_name
-optional

String

family_name
-optional

String

middle_name
-optional

String

nickname
-optional

String

preferred_username
-optional

String

profile
-optional

String

picture
-optional

String

website
-optional

String

email
-optional

String

email_verified
-optional

Boolean

gender
-optional

String

birthdate
-optional

String

zoneinfo
-optional

String

locale
-optional

String

phone_number
-optional

String

phone_number_verified
-optional

Boolean

address
-optional

AddressClaimSet

updated_at
-optional

Long

int64

claims_locales
-optional

String

acr
-optional

String

s_hash
-optional

String

authTime
-optional

Integer

int32

sid
-optional

String

-
-
-

IdentityProviderMapperRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

name
-optional

String

identityProviderAlias
-optional

String

identityProviderMapper
-optional

String

config
-optional

Map of [string]

-
-
-

IdentityProviderMapperTypeRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

name
-optional

String

category
-optional

String

helpText
-optional

String

properties
-optional

List of ConfigPropertyRepresentation

-
-
-

IdentityProviderRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

alias
-optional

String

displayName
-optional

String

internalId
-optional

String

providerId
-optional

String

enabled
-optional

Boolean

updateProfileFirstLoginMode
-optional

String

trustEmail
-optional

Boolean

storeToken
-optional

Boolean

addReadTokenRoleOnCreate
-optional

Boolean

authenticateByDefault
-optional

Boolean

linkOnly
-optional

Boolean

firstBrokerLoginFlowAlias
-optional

String

postBrokerLoginFlowAlias
-optional

String

config
-optional

Map of [string]

updateProfileFirstLogin
-optional

Boolean

-
-
-

InstallationAdapterConfig

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

realm
-optional

String

realm-public-key
-optional

String

auth-server-url
-optional

String

ssl-required
-optional

String

bearer-only
-optional

Boolean

resource
-optional

String

public-client
-optional

Boolean

verify-token-audience
-optional

Boolean

credentials
-optional

Map of [AnyType]

use-resource-role-mappings
-optional

Boolean

confidential-port
-optional

Integer

int32

policy-enforcer
-optional

PolicyEnforcerConfig

-
-
-

KeyMetadataRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

providerId
-optional

String

providerPriority
-optional

Long

int64

kid
-optional

String

status
-optional

String

type
-optional

String

algorithm
-optional

String

publicKey
-optional

String

certificate
-optional

String

use
-optional

KeyUse

validTo
-optional

Long

int64

-
-
-

KeyStoreConfig

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

realmCertificate
-optional

Boolean

storePassword
-optional

String

keyPassword
-optional

String

keyAlias
-optional

String

realmAlias
-optional

String

format
-optional

String

-
-
-

KeyUse

- ----- - - - - - - - -
NameTypeFormat
-
-
-

KeysMetadataRepresentation

- ----- - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

active
-optional

Map of [string]

keys
-optional

List of KeyMetadataRepresentation

-
-
-

Logic

- ----- - - - - - - - -
NameTypeFormat
-
-
-

ManagementPermissionReference

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

enabled
-optional

Boolean

resource
-optional

String

scopePermissions
-optional

Map of [string]

-
-
-

MappingsRepresentation

- ----- - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

realmMappings
-optional

List of RoleRepresentation

clientMappings
-optional

Map of ClientMappingsRepresentation

-
-
-

MethodConfig

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

method
-optional

String

scopes
-optional

List of [string]

scopes-enforcement-mode
-optional

ScopeEnforcementMode

-
-
-

OAuthClientRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

clientId
-optional

String

description
-optional

String

rootUrl
-optional

String

adminUrl
-optional

String

baseUrl
-optional

String

surrogateAuthRequired
-optional

Boolean

enabled
-optional

Boolean

alwaysDisplayInConsole
-optional

Boolean

clientAuthenticatorType
-optional

String

secret
-optional

String

registrationAccessToken
-optional

String

defaultRoles
-optional

List of [string]

redirectUris
-optional

List of [string]

webOrigins
-optional

List of [string]

notBefore
-optional

Integer

int32

bearerOnly
-optional

Boolean

consentRequired
-optional

Boolean

standardFlowEnabled
-optional

Boolean

implicitFlowEnabled
-optional

Boolean

directAccessGrantsEnabled
-optional

Boolean

serviceAccountsEnabled
-optional

Boolean

oauth2DeviceAuthorizationGrantEnabled
-optional

Boolean

authorizationServicesEnabled
-optional

Boolean

directGrantsOnly
-optional

Boolean

publicClient
-optional

Boolean

frontchannelLogout
-optional

Boolean

protocol
-optional

String

attributes
-optional

Map of [string]

authenticationFlowBindingOverrides
-optional

Map of [string]

fullScopeAllowed
-optional

Boolean

nodeReRegistrationTimeout
-optional

Integer

int32

registeredNodes
-optional

Map of [integer]

int32

protocolMappers
-optional

List of ProtocolMapperRepresentation

clientTemplate
-optional

String

useTemplateConfig
-optional

Boolean

useTemplateScope
-optional

Boolean

useTemplateMappers
-optional

Boolean

defaultClientScopes
-optional

List of [string]

optionalClientScopes
-optional

List of [string]

authorizationSettings
-optional

ResourceServerRepresentation

access
-optional

Map of [boolean]

origin
-optional

String

name
-optional

String

claims
-optional

ApplicationRepresentation_claims

-
-
-

PathCacheConfig

- ----- - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

max-entries
-optional

Integer

int32

lifespan
-optional

Long

int64

-
-
-

PathConfig

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

name
-optional

String

type
-optional

String

path
-optional

String

methods
-optional

List of MethodConfig

scopes
-optional

List of [string]

id
-optional

String

enforcement-mode
-optional

EnforcementMode

claim-information-point
-optional

Map of [map]

invalidated
-optional

Boolean

staticPath
-optional

Boolean

static
-optional

Boolean

-
-
-

PathSegment

- ----- - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

path
-optional

String

matrixParameters
-optional

Map of [array]

-
-
-

Permission

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

rsid
-optional

String

rsname
-optional

String

scopes
-optional

Set of [string]

claims
-optional

Map of [set]

-
-
-

PolicyEnforcementMode

- ----- - - - - - - - -
NameTypeFormat
-
-
-

PolicyEnforcerConfig

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

enforcement-mode
-optional

EnforcementMode

paths
-optional

List of PathConfig

path-cache
-optional

PathCacheConfig

lazy-load-paths
-optional

Boolean

on-deny-redirect-to
-optional

String

user-managed-access
-optional

Object

claim-information-point
-optional

Map of [map]

http-method-as-scope
-optional

Boolean

realm
-optional

String

auth-server-url
-optional

String

credentials
-optional

Map of [AnyType]

resource
-optional

String

-
-
-

PolicyRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

name
-optional

String

description
-optional

String

type
-optional

String

policies
-optional

Set of [string]

resources
-optional

Set of [string]

scopes
-optional

Set of [string]

logic
-optional

Logic

decisionStrategy
-optional

DecisionStrategy

owner
-optional

String

resourcesData
-optional

Set of ResourceRepresentation

scopesData
-optional

Set of ScopeRepresentation

config
-optional

Map of [string]

-
-
-

ProtocolMapperEvaluationRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

mapperId
-optional

String

mapperName
-optional

String

containerId
-optional

String

containerName
-optional

String

containerType
-optional

String

protocolMapper
-optional

String

-
-
-

ProtocolMapperRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

name
-optional

String

protocol
-optional

String

protocolMapper
-optional

String

consentRequired
-optional

Boolean

consentText
-optional

String

config
-optional

Map of [string]

-
-
-

PublishedRealmRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

realm
-optional

String

public_key
-optional

String

token-service
-optional

String

account-service
-optional

String

tokens-not-before
-optional

Integer

int32

-
-
-

RealmEventsConfigRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

eventsEnabled
-optional

Boolean

eventsExpiration
-optional

Long

int64

eventsListeners
-optional

List of [string]

enabledEventTypes
-optional

List of [string]

adminEventsEnabled
-optional

Boolean

adminEventsDetailsEnabled
-optional

Boolean

-
-
-

RealmRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

realm
-optional

String

displayName
-optional

String

displayNameHtml
-optional

String

notBefore
-optional

Integer

int32

defaultSignatureAlgorithm
-optional

String

revokeRefreshToken
-optional

Boolean

refreshTokenMaxReuse
-optional

Integer

int32

accessTokenLifespan
-optional

Integer

int32

accessTokenLifespanForImplicitFlow
-optional

Integer

int32

ssoSessionIdleTimeout
-optional

Integer

int32

ssoSessionMaxLifespan
-optional

Integer

int32

ssoSessionIdleTimeoutRememberMe
-optional

Integer

int32

ssoSessionMaxLifespanRememberMe
-optional

Integer

int32

offlineSessionIdleTimeout
-optional

Integer

int32

offlineSessionMaxLifespanEnabled
-optional

Boolean

offlineSessionMaxLifespan
-optional

Integer

int32

clientSessionIdleTimeout
-optional

Integer

int32

clientSessionMaxLifespan
-optional

Integer

int32

clientOfflineSessionIdleTimeout
-optional

Integer

int32

clientOfflineSessionMaxLifespan
-optional

Integer

int32

accessCodeLifespan
-optional

Integer

int32

accessCodeLifespanUserAction
-optional

Integer

int32

accessCodeLifespanLogin
-optional

Integer

int32

actionTokenGeneratedByAdminLifespan
-optional

Integer

int32

actionTokenGeneratedByUserLifespan
-optional

Integer

int32

oauth2DeviceCodeLifespan
-optional

Integer

int32

oauth2DevicePollingInterval
-optional

Integer

int32

enabled
-optional

Boolean

sslRequired
-optional

String

passwordCredentialGrantAllowed
-optional

Boolean

registrationAllowed
-optional

Boolean

registrationEmailAsUsername
-optional

Boolean

rememberMe
-optional

Boolean

verifyEmail
-optional

Boolean

loginWithEmailAllowed
-optional

Boolean

duplicateEmailsAllowed
-optional

Boolean

resetPasswordAllowed
-optional

Boolean

editUsernameAllowed
-optional

Boolean

userCacheEnabled
-optional

Boolean

realmCacheEnabled
-optional

Boolean

bruteForceProtected
-optional

Boolean

permanentLockout
-optional

Boolean

maxFailureWaitSeconds
-optional

Integer

int32

minimumQuickLoginWaitSeconds
-optional

Integer

int32

waitIncrementSeconds
-optional

Integer

int32

quickLoginCheckMilliSeconds
-optional

Long

int64

maxDeltaTimeSeconds
-optional

Integer

int32

failureFactor
-optional

Integer

int32

privateKey
-optional

String

publicKey
-optional

String

certificate
-optional

String

codeSecret
-optional

String

roles
-optional

RolesRepresentation

groups
-optional

List of GroupRepresentation

defaultRoles
-optional

List of [string]

defaultRole
-optional

RoleRepresentation

defaultGroups
-optional

List of [string]

requiredCredentials
-optional

Set of [string]

passwordPolicy
-optional

String

otpPolicyType
-optional

String

otpPolicyAlgorithm
-optional

String

otpPolicyInitialCounter
-optional

Integer

int32

otpPolicyDigits
-optional

Integer

int32

otpPolicyLookAheadWindow
-optional

Integer

int32

otpPolicyPeriod
-optional

Integer

int32

otpPolicyCodeReusable
-optional

Boolean

otpSupportedApplications
-optional

List of [string]

localizationTexts
-optional

Map of [map]

webAuthnPolicyRpEntityName
-optional

String

webAuthnPolicySignatureAlgorithms
-optional

List of [string]

webAuthnPolicyRpId
-optional

String

webAuthnPolicyAttestationConveyancePreference
-optional

String

webAuthnPolicyAuthenticatorAttachment
-optional

String

webAuthnPolicyRequireResidentKey
-optional

String

webAuthnPolicyUserVerificationRequirement
-optional

String

webAuthnPolicyCreateTimeout
-optional

Integer

int32

webAuthnPolicyAvoidSameAuthenticatorRegister
-optional

Boolean

webAuthnPolicyAcceptableAaguids
-optional

List of [string]

webAuthnPolicyExtraOrigins
-optional

List of [string]

webAuthnPolicyPasswordlessRpEntityName
-optional

String

webAuthnPolicyPasswordlessSignatureAlgorithms
-optional

List of [string]

webAuthnPolicyPasswordlessRpId
-optional

String

webAuthnPolicyPasswordlessAttestationConveyancePreference
-optional

String

webAuthnPolicyPasswordlessAuthenticatorAttachment
-optional

String

webAuthnPolicyPasswordlessRequireResidentKey
-optional

String

webAuthnPolicyPasswordlessUserVerificationRequirement
-optional

String

webAuthnPolicyPasswordlessCreateTimeout
-optional

Integer

int32

webAuthnPolicyPasswordlessAvoidSameAuthenticatorRegister
-optional

Boolean

webAuthnPolicyPasswordlessAcceptableAaguids
-optional

List of [string]

webAuthnPolicyPasswordlessExtraOrigins
-optional

List of [string]

clientProfiles
-optional

ClientProfilesRepresentation

clientPolicies
-optional

ClientPoliciesRepresentation

users
-optional

List of UserRepresentation

federatedUsers
-optional

List of UserRepresentation

scopeMappings
-optional

List of ScopeMappingRepresentation

clientScopeMappings
-optional

Map of [array]

clients
-optional

List of ClientRepresentation

clientScopes
-optional

List of ClientScopeRepresentation

defaultDefaultClientScopes
-optional

List of [string]

defaultOptionalClientScopes
-optional

List of [string]

browserSecurityHeaders
-optional

Map of [string]

smtpServer
-optional

Map of [string]

userFederationProviders
-optional

List of UserFederationProviderRepresentation

userFederationMappers
-optional

List of UserFederationMapperRepresentation

loginTheme
-optional

String

accountTheme
-optional

String

adminTheme
-optional

String

emailTheme
-optional

String

eventsEnabled
-optional

Boolean

eventsExpiration
-optional

Long

int64

eventsListeners
-optional

List of [string]

enabledEventTypes
-optional

List of [string]

adminEventsEnabled
-optional

Boolean

adminEventsDetailsEnabled
-optional

Boolean

identityProviders
-optional

List of IdentityProviderRepresentation

identityProviderMappers
-optional

List of IdentityProviderMapperRepresentation

protocolMappers
-optional

List of ProtocolMapperRepresentation

components
-optional

Map of [array]

internationalizationEnabled
-optional

Boolean

supportedLocales
-optional

Set of [string]

defaultLocale
-optional

String

authenticationFlows
-optional

List of AuthenticationFlowRepresentation

authenticatorConfig
-optional

List of AuthenticatorConfigRepresentation

requiredActions
-optional

List of RequiredActionProviderRepresentation

browserFlow
-optional

String

registrationFlow
-optional

String

directGrantFlow
-optional

String

resetCredentialsFlow
-optional

String

clientAuthenticationFlow
-optional

String

dockerAuthenticationFlow
-optional

String

attributes
-optional

Map of [string]

keycloakVersion
-optional

String

userManagedAccessAllowed
-optional

Boolean

social
-optional

Boolean

updateProfileOnInitialSocialLogin
-optional

Boolean

socialProviders
-optional

Map of [string]

applicationScopeMappings
-optional

Map of [array]

applications
-optional

List of ApplicationRepresentation

oauthClients
-optional

List of OAuthClientRepresentation

clientTemplates
-optional

List of ClientTemplateRepresentation

oAuth2DeviceCodeLifespan
-optional

Integer

int32

oAuth2DevicePollingInterval
-optional

Integer

int32

-
-
-

RequiredActionProviderRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

alias
-optional

String

name
-optional

String

providerId
-optional

String

enabled
-optional

Boolean

defaultAction
-optional

Boolean

priority
-optional

Integer

int32

config
-optional

Map of [string]

-
-
-

ResourceOwnerRepresentation

- ----- - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

name
-optional

String

-
-
-

ResourceRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-_optional

String

name
-optional

String

uris
-optional

Set of [string]

type
-optional

String

scopes
-optional

Set of ScopeRepresentation

icon_uri
-optional

String

owner
-optional

ResourceRepresentation_owner

ownerManagedAccess
-optional

Boolean

displayName
-optional

String

attributes
-optional

Map of [array]

uri
-optional

String

scopesUma
-optional

Set of ScopeRepresentation

-
-
-

ResourceRepresentationOwner

- ----- - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

name
-optional

String

-
-
-

ResourceServerRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

clientId
-optional

String

name
-optional

String

allowRemoteResourceManagement
-optional

Boolean

policyEnforcementMode
-optional

PolicyEnforcementMode

resources
-optional

List of ResourceRepresentation

policies
-optional

List of PolicyRepresentation

scopes
-optional

List of ScopeRepresentation

decisionStrategy
-optional

DecisionStrategy

-
-
-

RoleRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

name
-optional

String

description
-optional

String

scopeParamRequired
-optional

Boolean

composite
-optional

Boolean

composites
-optional

Composites

clientRole
-optional

Boolean

containerId
-optional

String

attributes
-optional

Map of [array]

-
-
-

RolesRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

realm
-optional

List of RoleRepresentation

client
-optional

Map of [array]

application
-optional

Map of [array]

-
-
-

ScopeEnforcementMode

- ----- - - - - - - - -
NameTypeFormat
-
-
-

ScopeMappingRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

self
-optional

String

client
-optional

String

clientTemplate
-optional

String

clientScope
-optional

String

roles
-optional

Set of [string]

-
-
-

ScopeRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

name
-optional

String

iconUri
-optional

String

policies
-optional

List of PolicyRepresentation

resources
-optional

List of ResourceRepresentation

displayName
-optional

String

-
-
-

SocialLinkRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

socialProvider
-optional

String

socialUserId
-optional

String

socialUsername
-optional

String

-
-
-

UPAttribute

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

name
-optional

String

displayName
-optional

String

validations
-optional

Map of [map]

annotations
-optional

Map of [AnyType]

required
-optional

UPAttributeRequired

permissions
-optional

UPAttributePermissions

selector
-optional

UPAttributeSelector

group
-optional

String

-
-
-

UPAttributePermissions

- ----- - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

view
-optional

Set of [string]

edit
-optional

Set of [string]

-
-
-

UPAttributeRequired

- ----- - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

roles
-optional

Set of [string]

scopes
-optional

Set of [string]

-
-
-

UPAttributeSelector

- ----- - - - - - - - - - - - - - - -
NameTypeFormat

scopes
-optional

Set of [string]

-
-
-

UPConfig

- ----- - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

attributes
-optional

List of UPAttribute

groups
-optional

List of UPGroup

-
-
-

UPGroup

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

name
-optional

String

displayHeader
-optional

String

displayDescription
-optional

String

annotations
-optional

Map of [AnyType]

-
-
-

UserConsentRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

clientId
-optional

String

grantedClientScopes
-optional

List of [string]

createdDate
-optional

Long

int64

lastUpdatedDate
-optional

Long

int64

grantedRealmRoles
-optional

List of [string]

-
-
-

UserFederationMapperRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

name
-optional

String

federationProviderDisplayName
-optional

String

federationMapperType
-optional

String

config
-optional

Map of [string]

-
-
-

UserFederationProviderRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

displayName
-optional

String

providerName
-optional

String

config
-optional

Map of [string]

priority
-optional

Integer

int32

fullSyncPeriod
-optional

Integer

int32

changedSyncPeriod
-optional

Integer

int32

lastSync
-optional

Integer

int32

-
-
-

UserProfileAttributeGroupMetadata

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-

UserProfileAttributeMetadata

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-

UserProfileMetadata

- ----- - - - - - - - - - - - - - - - - - - - - -
-
-

UserRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

self
-optional

String

id
-optional

String

origin
-optional

String

createdTimestamp
-optional

Long

int64

username
-optional

String

enabled
-optional

Boolean

totp
-optional

Boolean

emailVerified
-optional

Boolean

firstName
-optional

String

lastName
-optional

String

email
-optional

String

federationLink
-optional

String

serviceAccountClientId
-optional

String

attributes
-optional

Map of [array]

credentials
-optional

List of CredentialRepresentation

disableableCredentialTypes
-optional

Set of [string]

requiredActions
-optional

List of [string]

federatedIdentities
-optional

List of FederatedIdentityRepresentation

realmRoles
-optional

List of [string]

clientRoles
-optional

Map of [array]

clientConsents
-optional

List of UserConsentRepresentation

notBefore
-optional

Integer

int32

applicationRoles
-optional

Map of [array]

socialLinks
-optional

List of SocialLinkRepresentation

groups
-optional

List of [string]

access
-optional

Map of [boolean]

userProfileMetadata
-optional

UserProfileMetadata

-
-
-

UserSessionRepresentation

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeFormat

id
-optional

String

username
-optional

String

userId
-optional

String

ipAddress
-optional

String

start
-optional

Long

int64

lastAccess
-optional

Long

int64

rememberMe
-optional

Boolean

clients
-optional

Map of [string]

-
-
-
-
- - - \ No newline at end of file diff --git a/examples/common/mod.rs b/examples/common/mod.rs deleted file mode 100644 index 99b8b54..0000000 --- a/examples/common/mod.rs +++ /dev/null @@ -1,433 +0,0 @@ -use std::{collections::HashMap, rc::Rc, str::FromStr}; - -use heck::ToSnakeCase; - -pub struct StructType { - pub name: String, - pub is_camel_case: bool, - pub fields: Vec, -} - -pub struct EnumType { - pub name: String, - pub is_upper_case: bool, - pub fields: Vec, -} - -pub struct Field { - pub field_name: String, - pub original_field: String, - pub is_optional: bool, - pub is_array: bool, - pub field_case: FieldCase, - pub field_type: FieldType, -} - -#[derive(Debug, PartialEq, Eq)] -pub enum FieldCase { - CamelCase, - SnakeCase, - Custom, - Unknown, -} - -#[derive(Debug)] -pub enum FieldType { - Simple(String), - Registry(String), -} - -impl FieldType { - pub fn name(&self) -> String { - match self { - FieldType::Registry(name) | FieldType::Simple(name) => name.clone(), - } - } -} - -pub struct Parameter { - pub name: String, - pub is_optional: bool, - pub comment: Option, - pub kind: ParameterKind, - pub is_array: bool, - pub parameter_type: FieldType, -} - -#[derive(Debug)] -pub enum ParameterKind { - Path, - Query, - Body, - FormData, -} - -impl FromStr for ParameterKind { - type Err = String; - fn from_str(value: &str) -> std::result::Result::Err> { - match value { - "Path" => Ok(ParameterKind::Path), - "Query" => Ok(ParameterKind::Query), - "Body" => Ok(ParameterKind::Body), - "FormData" => Ok(ParameterKind::FormData), - _ => Err(format!("Unknown parameter kind: {}", value)), - } - } -} - -pub struct MethodStruct { - pub anchor: Option, - pub name: String, - pub comment: String, - pub path: String, - pub parameters: Vec>, - pub method: String, - pub response: ResponseType, - pub description: Option, -} - -#[derive(Debug)] -pub struct ResponseType { - pub is_array: bool, - pub return_type: FieldType, -} - -pub fn write_types(enums: &[EnumType], structs: &[Rc]) { - println!("use std::collections::HashMap;\n"); - println!(); - println!(r#"#[cfg(feature = "schemars")]"#); - println!("use schemars::JsonSchema;"); - println!("use serde::{{Deserialize, Serialize}};"); - println!("use serde_json::Value;"); - println!("use serde_with::skip_serializing_none;"); - println!(); - - for e in enums { - println!("#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]"); - println!(r#"#[cfg_attr(feature = "schemars", derive(JsonSchema))]"#); - if e.is_upper_case { - println!(r#"#[serde(rename_all = "UPPERCASE")]"#); - } - - println!("pub enum {} {{", e.name); - - for field in &e.fields { - println!(" {},", field); - } - - println!("}}\n"); - } - - for s in structs { - println!("#[skip_serializing_none]"); - println!("#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]"); - println!(r#"#[cfg_attr(feature = "schemars", derive(JsonSchema))]"#); - if s.is_camel_case { - println!(r#"#[serde(rename_all = "camelCase")]"#); - } - println!("pub struct {} {{", s.name,); - - for field in &s.fields { - let is_rename = match field.field_case { - FieldCase::Custom => true, - FieldCase::Unknown => false, - FieldCase::CamelCase => !s.is_camel_case, - FieldCase::SnakeCase => s.is_camel_case, - }; - if is_rename { - println!(r#" #[serde(rename = "{}")]"#, field.original_field); - } - let mut field_type = field.field_type.name(); - if field.is_array { - field_type = format!("Vec<{}>", field_type); - } - if field.is_optional { - field_type = format!("Option<{}>", field_type); - } - println!(" pub {}: {},", field.field_name, field_type); - } - - println!("}}\n"); - } -} - -pub fn write_rest(methods: &[MethodStruct], stream_mapping: &HashMap) { - let keycloak_version = - std::env::var("KEYCLOAK_VERSION").expect("environment variable KEYCLOAK_VERSION"); - println!("use std::collections::HashMap;"); - println!(); - println!("use reqwest::header::CONTENT_LENGTH;"); - println!("use serde_json::Value;"); - println!(); - println!("use super::*;"); - println!(); - println!("impl KeycloakAdmin {{"); - - for method in methods { - let mut method_name = method.path.clone(); - - let parameters = &method.parameters; - - for parameter in parameters { - if let ParameterKind::Path = parameter.kind { - let parameter_with = (if parameter.name == "realm" { - "" - } else { - "with_" - }) - .to_string() - + parameter.name.to_snake_case().as_str(); - method_name = method_name - .replace(&format!("{{{}}}", parameter.name), parameter_with.as_str()); - } - } - method_name = (method_name + &method.method).to_snake_case(); - - let mut mapping = HashMap::new(); - let mut body_parameter = None; - let mut has_query_params = false; - let mut is_form = false; - let method_params = process_method_parameters( - method, - &mut mapping, - &mut body_parameter, - &mut has_query_params, - &mut is_form, - ); - let mut path = method.path.clone(); - let path_parts = method - .path - .split('/') - .filter(|x| x.starts_with('{') && x.ends_with('}')); - if method.parameters.is_empty() { - for path_part in path_parts { - path = path.replace(path_part, ""); - } - } else { - for path_part in path_parts { - if let Some((s, _)) = mapping.get(&path_part[1..path_part.len() - 1]) { - path = path.replace(path_part, &format!("{{{s}}}")); - } - } - } - let rest_comment = format!("{} {}", method.method, path); - - let mut comments = vec![]; - if method.name != rest_comment { - comments.push(vec![method.name.to_string()]); - } - if let Some(description) = method.description.as_ref().map(|x| x.replace('\n', " ")) { - comments.push(vec![description]); - } - if !parameters.is_empty() { - comments.push(vec!["Parameters:".to_string()]); - comments.push( - parameters - .iter() - .map(|parameter| { - format!( - "- `{}`{}", - match parameter.kind { - ParameterKind::Query => - &mapping.get(parameter.name.as_str()).unwrap().0, - _ => ¶meter.name, - } - .to_snake_case(), - parameter - .comment - .as_ref() - .map(|comment| format!(": {}", comment.replace('\n', ""))) - .unwrap_or_default() - ) - }) - .collect(), - ); - } - comments.push(vec![format!("Resource: `{}`", method.comment)]); - comments.push(vec![format!("`{}`", rest_comment)]); - if let Some(anchor) = &method.anchor { - comments.push(vec![format!( - "Documentation: ", - keycloak_version, anchor - )]); - } - if path != method.path { - comments.push(vec![format!( - "REST method: `{} {}`", - method.method, method.path - )]); - } - let comments = comments - .into_iter() - .map(|c| { - c.into_iter() - .map(|l| format!(" /// {}\n", l)) - .collect::>() - .join("") - }) - .collect::>() - .join(" ///\n"); - print!("{}", comments); - - println!(" pub async fn {}(", method_name); - println!(" &self,"); - for method_param in method_params { - println!("{}", method_param); - } - - let mut response_type = method.response.return_type.name().replace("'a", "'static"); - if method.response.is_array { - response_type = format!("Vec<{}>", response_type); - } - if response_type == "Stream" { - let stream_type = stream_mapping - .get(&method.path) - .map(|f| { - FieldType::Registry(f.clone()) - .name() - .replace("'a", "'static") - }) - .map(|x| format!("Vec<{}>", x)); - if stream_type.is_none() { - panic!("Stream for {} not found", method.path); - } - response_type = stream_type.expect("stream not found"); - } - println!(" ) -> Result<{}, KeycloakError> {{", response_type); - println!( - " let {}builder = self", - if has_query_params { "mut " } else { "" } - ); - println!(" .client"); - - let method_http = match method.method.as_str() { - "OPTIONS" => "request(reqwest::Method::OPTIONS, ".to_string(), - _ => method.method.to_lowercase() + "(", - }; - println!( - r#" .{}&format!("{{}}/admin/realms{}", self.url))"#, - method_http, path, - ); - - if let Some(x) = body_parameter { - if is_form { - println!(" .form(&json!({{",); - for (name, parameter) in x { - println!(r#" "{}": {},"#, parameter.name, name); - } - println!(" }}))",); - } else if let Some((name, _parameter)) = x.first() { - println!(" .json(&{})", name); - } - } else if method.method.eq("PUT") { - println!(" .header( CONTENT_LENGTH, \"0\")"); // PUT without body expects Content-Length header to be 0 - } - - println!(" .bearer_auth(self.token_supplier.get(&self.url).await?);"); - - for parameter in parameters { - if let ParameterKind::Query = parameter.kind { - println!( - " if let Some(v) = {} {{", - mapping.get(parameter.name.as_str()).unwrap().0 - ); - println!( - r#" builder = builder.query(&[("{}", v)]);"#, - parameter.name - ); - println!(" }}"); - } - } - - println!(" let response = builder.send().await?;"); - - match response_type.as_str() { - "()" => { - println!(" error_check(response).await?;"); - println!(" Ok(())"); - } - typ => { - let (des, postfix) = match typ { - "Vec" => ("bytes", ".to_vec()"), - _ => ("json", ""), - }; - println!( - " Ok(error_check(response).await?.{}().await?{})", - des, postfix - ); - } - } - - println!(" }}\n"); - } - - println!("}}"); -} - -fn process_method_parameters( - method: &MethodStruct, - mapping: &mut HashMap)>, - body_parameter: &mut Option)>>, - has_query_params: &mut bool, - is_form: &mut bool, -) -> Vec { - let mut parameters = vec![]; - for parameter in &method.parameters { - let mut name = parameter.name.to_snake_case(); - if ["ref", "type"].contains(&name.as_str()) { - name += "_"; - } - mapping.insert(parameter.name.clone(), (name.clone(), parameter.clone())); - parameters.push((name, parameter.clone())); - } - - let mut path_params = vec![]; - let path_parts = method - .path - .split('/') - .filter(|x| x.starts_with('{') && x.ends_with('}')); - for path_part in path_parts { - let parameter_name = &path_part[1..path_part.len() - 1]; - if let Some(parameter_position) = parameters - .iter() - .position(|(_, p)| p.name == parameter_name) - { - let p = parameters.remove(parameter_position); - path_params.push(p); - } - } - - let mut param_lines = vec![]; - for (name, parameter) in path_params.iter().chain(parameters.iter()) { - let mut parameter_type = parameter.parameter_type.name(); - if parameter.is_array { - parameter_type = format!("Vec<{}>", parameter_type); - } - if parameter.is_optional { - parameter_type = format!("Option<{}>", parameter_type); - } - if !parameter.is_array && !parameter.is_optional && parameter_type == "String" { - parameter_type = "&str".into(); - } - param_lines.push(format!(" {}: {},", name, parameter_type)); - if let ParameterKind::FormData = parameter.kind { - *is_form = true; - } - match parameter.kind { - ParameterKind::Body | ParameterKind::FormData => { - if body_parameter.is_none() { - *body_parameter = Some(vec![(name.clone(), parameter.clone())]); - } else { - body_parameter - .iter_mut() - .next() - .unwrap() - .push((name.clone(), parameter.clone())); - } - } - ParameterKind::Query => *has_query_params = true, - _ => (), - } - } - param_lines -} diff --git a/examples/gen.rs b/examples/gen.rs deleted file mode 100644 index 6508363..0000000 --- a/examples/gen.rs +++ /dev/null @@ -1,337 +0,0 @@ -use clap::Parser; -use heck::{ToLowerCamelCase, ToSnakeCase, ToUpperCamelCase}; -use scraper::{ElementRef, Html, Selector}; -use std::{collections::HashMap, fs::read_to_string, rc::Rc}; - -use crate::common::{ - write_rest, write_types, EnumType, Field, FieldCase, FieldType, MethodStruct, Parameter, - ResponseType, StructType, -}; - -mod common; - -const RESERVED_WORDS: &[&str] = &["type", "self", "use"]; - -/// Generate Rust code from Keycloak REST Description in HTML -#[derive(Parser)] -enum Cli { - /// Generate types - Types, - /// Generate method callers - Rest, -} - -fn main() -> Result<(), std::io::Error> { - let cli = Cli::parse(); - match cli { - Cli::Types => generate_types()?, - Cli::Rest => generate_rest()?, - } - Ok(()) -} - -fn parse_document() -> Result { - Ok(Html::parse_document(&read_to_string( - "./docs/rest-api.html", - )?)) -} - -fn generate_rest() -> Result<(), std::io::Error> { - let document = parse_document()?; - let stream_mapping: HashMap = - toml::from_str(include_str!("stream.toml")).unwrap(); - let methods = read_methods_info(&document, &stream_mapping)?; - write_rest(&methods, &stream_mapping); - Ok(()) -} - -fn generate_types() -> Result<(), std::io::Error> { - let document = parse_document()?; - let (enums, structs) = read_types_info(&document)?; - write_types(&enums, &structs); - Ok(()) -} - -fn check_array(value: &str) -> Option<&str> { - if value.starts_with("< ") && value.ends_with(" > array") { - Some(&value[2..value.len() - 8]) - } else { - None - } -} - -fn check_optional(value: &str) -> bool { - "optional" == value -} - -type TypeDuo = (Vec, Vec>); -fn read_types_info(document: &scraper::Html) -> Result { - let definitions_selector = - Selector::parse("#_definitions ~ div.sectionbody > div.sect2").unwrap(); - - let definitions = document.select(&definitions_selector); - - let mut rename_table = HashMap::new(); - rename_table.insert("Userinfo", "UserInfo".to_string()); - - let mut structs = vec![]; - let mut enums = vec![]; - for definition in definitions { - let struct_name = text(&definition, "h3").replace('-', ""); - - let fields_selector = Selector::parse("tbody tr").unwrap(); - - let fields = definition.select(&fields_selector); - let mut result_fields = vec![]; - let mut camel_case_count = 0; - let mut snake_case_count = 0; - for field in fields { - let original_field = text(&field, "strong"); - let mut field_name = original_field.to_snake_case(); - let fld_camel_case = original_field.to_lower_camel_case(); - - let mut field_case = if field_name == fld_camel_case { - FieldCase::Unknown - } else if original_field == field_name { - snake_case_count += 1; - FieldCase::SnakeCase - } else if original_field == fld_camel_case { - camel_case_count += 1; - FieldCase::CamelCase - } else { - FieldCase::Custom - }; - - let original_field_type = text(&field, "td ~ td p").replace('-', ""); - - let array_field = check_array(&original_field_type); - let is_array = array_field.is_some(); - - let field_type = match if is_array { - convert_type(array_field.unwrap()) - } else { - convert_type(&original_field_type) - } { - Ok(field_type) => field_type, - Err(ConvertTypeFail::Enum(enum_fields)) => { - let enum_name = format!("{}{}", struct_name, field_name.to_upper_camel_case()); - - let is_upper_case = enum_fields - .split(", ") - .all(|x| x.chars().all(|x| x.is_uppercase())); - let enum_ = EnumType { - name: enum_name.clone(), - is_upper_case, - fields: enum_fields - .split(", ") - .map(|enum_field| { - let enum_field = enum_field.to_upper_camel_case(); - rename_table - .get(enum_field.as_str()) - .unwrap_or(&enum_field) - .clone() - }) - .collect(), - }; - enums.push(enum_); - FieldType::Simple(enum_name) - } - Err(err) => panic!("err: {:?}", err), - }; - - let optional_required = text(&field, "em"); - - let is_optional = check_optional(&optional_required); - - if RESERVED_WORDS.contains(&field_name.as_str()) { - field_case = FieldCase::Custom; - field_name += "_"; - } - - let field = Field { - field_name, - original_field, - field_case, - field_type, - is_array, - is_optional, - }; - - result_fields.push(field); - } - - let is_camel_case = camel_case_count > snake_case_count; - - let struct_ = Rc::new(StructType { - name: struct_name.clone(), - is_camel_case, - fields: result_fields, - }); - structs.push(struct_); - } - - Ok((enums, structs)) -} - -fn read_methods_info( - document: &scraper::Html, - stream_mapping: &HashMap, -) -> Result, std::io::Error> { - let resources_selector = Selector::parse("#_paths ~ div.sectionbody > div.sect2").unwrap(); - - let resources_html = document.select(&resources_selector); - let mut methods = vec![]; - for resource in resources_html { - let resource_name = text(&resource, "h3"); - - let methods_selector = Selector::parse("div.sect3").unwrap(); - - let methods_html = resource.select(&methods_selector); - for method in methods_html { - let method_name = text(&method, "h4"); - let anchor = attr(&method, "h4", "id").map(str::to_string); - let path = text_opt(&method, "pre").unwrap_or_else(|| method_name.clone()); - let mut path_parts = path.split(' '); - let method_http = path_parts.next().unwrap(); - let path = path_parts.next().unwrap(); - - let blocks_selector = Selector::parse("div.sect4").unwrap(); - let blocks_html = method.select(&blocks_selector); - - let mut parameters = vec![]; - let mut response = None; - let mut description = None; - for block in blocks_html { - let block_name = text(&block, "h5"); - - match block_name.as_str() { - "Parameters" => { - let parameters_selector = Selector::parse("tbody > tr").unwrap(); - let parameters_html = block.select(¶meters_selector); - - for parameter in parameters_html { - let parameter_kind = text(¶meter, "td:nth-child(1) > p > strong"); - let name = text(¶meter, "td:nth-child(2) > p > strong"); - let optional_required = text(¶meter, "td:nth-child(2) > p > em"); - let comment = text_opt(¶meter, "td:nth-child(3) > p"); - let parameter_type = text_opt(¶meter, "td:nth-child(4) > p") - .unwrap_or_else(|| { - text_opt(¶meter, "td:last-child > p").unwrap() - }); - - let array = check_array(¶meter_type); - - let is_optional = check_optional(&optional_required); - let name_copy = name.clone(); - let parameter_ = Parameter { - name, - comment, - is_optional, - is_array: array.is_some(), - kind: parameter_kind.parse().unwrap(), - parameter_type: array - .or(Some(parameter_type.as_str())) - .map(|param_type| { - stream_mapping - .get(&format!("{}:{}:{}", path, name_copy, param_type)) - .map(String::as_str) - .unwrap_or(param_type) - }) - .map(convert_type) - .unwrap() - .unwrap(), - }; - parameters.push(Rc::new(parameter_)); - } - } - "Responses" => { - let response_type = text(&block, "tbody > tr > td:nth-child(3) > p"); - let array = check_array(&response_type); - response = Some(ResponseType { - is_array: array.is_some(), - return_type: array - .or(Some(response_type.as_str())) - .map(|x| convert_type(&x.replace('-', ""))) - .unwrap() - .unwrap(), - }); - } - "Consumes" | "Produces" => {} - "Description" => { - let description_text = text(&block, "div.paragraph > p"); - description = Some(description_text) - } - _ => eprintln!("Unsupported block {}", block_name), - } - } - - let method = MethodStruct { - anchor, - comment: resource_name.clone(), - name: method_name, - parameters, - path: path.into(), - method: method_http.into(), - response: response.unwrap(), - description, - }; - methods.push(method); - } - } - - Ok(methods) -} - -fn text_opt(element: &ElementRef, selector: &str) -> Option { - let selector = Selector::parse(selector).unwrap(); - element.select(&selector).next().map(|x| element_text(&x)) -} - -fn text(element: &ElementRef, selector: &str) -> String { - text_opt(element, selector).unwrap() -} - -fn element_text(element: &ElementRef) -> String { - element.text().collect::>().join("") -} - -fn attr<'a>(element: &'a ElementRef, selector: &str, name: &str) -> Option<&'a str> { - let selector = Selector::parse(selector).unwrap(); - element - .select(&selector) - .next() - .and_then(|x| x.value().attr(name)) -} - -fn convert_type(original: &str) -> Result { - Ok(match original { - "No Content" | "Response" => FieldType::Simple("()".into()), - "file" => FieldType::Simple("&[u8]".into()), - "string" | "< string > array(csv)" => FieldType::Simple("String".into()), - "string(byte)" => FieldType::Simple("u8".into()), - "integer(int32)" => FieldType::Simple("i32".into()), - "integer(int64)" => FieldType::Simple("i64".into()), - "number(float)" => FieldType::Simple("f32".into()), - "boolean" => FieldType::Simple("bool".into()), - "Map" => FieldType::Simple("HashMap".into()), - "MultivaluedHashMap" => FieldType::Simple("HashMap>".into()), - "Object" => FieldType::Simple("Value".into()), - _ => { - if original.starts_with("enum (") { - return Err(ConvertTypeFail::Enum( - (&original[6..original.len() - 1]).into(), - )); - } else if original.chars().next().unwrap().is_uppercase() { - FieldType::Registry(original.into()) - } else { - return Err(ConvertTypeFail::Unknown(original.into())); - } - } - }) -} - -#[derive(Debug)] -enum ConvertTypeFail { - Enum(String), - Unknown(#[allow(dead_code)] String), -} diff --git a/examples/openapi.rs b/examples/openapi.rs index 887ad19..321c4ca 100644 --- a/examples/openapi.rs +++ b/examples/openapi.rs @@ -1,7 +1,5 @@ use clap::Parser; -mod common; - /// Generate Rust code from Keycloak REST Description in HTML #[derive(Parser)] enum Cli { @@ -24,7 +22,15 @@ mod openapi { use indexmap::IndexMap; use serde::Deserialize; - use crate::{common::FieldCase, RESERVED_WORDS}; + use crate::RESERVED_WORDS; + + #[derive(Debug, PartialEq, Eq)] + pub enum FieldCase { + CamelCase, + SnakeCase, + Custom, + Unknown, + } #[derive(Debug, Deserialize)] pub struct Spec { @@ -1051,7 +1057,7 @@ pub enum {name} {{ fn main() { let cli = Cli::parse(); - let specs: openapi::Spec = serde_json::from_slice(include_bytes!("../docs/openapi.json")) + let specs: openapi::Spec = serde_json::from_slice(include_bytes!("../api/openapi.json")) .expect("valid openapi json specs"); match cli { diff --git a/examples/stream.toml b/examples/stream.toml deleted file mode 100644 index 68e0f14..0000000 --- a/examples/stream.toml +++ /dev/null @@ -1,91 +0,0 @@ -"/:requestBody:InputStream" = "RealmRepresentation" -"/{realm}/partialImport:requestBody:InputStream" = "RealmRepresentation" -"/{realm}/authentication/flows" = "AuthenticationFlowRepresentation" -"/{realm}/authentication/required-actions" = "RequiredActionProviderRepresentation" -"/{realm}/authentication/unregistered-required-actions" = "HashMap" -"/{realm}/clients-initial-access" = "ClientInitialAccessPresentation" -"/{realm}/groups/{id}/role-mappings/clients/{client}" = "RoleRepresentation" -"/{realm}/groups/{id}/role-mappings/clients/{client}/available" = "RoleRepresentation" -"/{realm}/groups/{id}/role-mappings/clients/{client}/composite" = "RoleRepresentation" -"/{realm}/users/{id}/role-mappings/clients/{client}" = "RoleRepresentation" -"/{realm}/users/{id}/role-mappings/clients/{client}/available" = "RoleRepresentation" -"/{realm}/users/{id}/role-mappings/clients/{client}/composite" = "RoleRepresentation" -"/{realm}/client-scopes" = "ClientScopeRepresentation" -"/{realm}/clients" = "ClientRepresentation" -"/{realm}/clients/{id}/evaluate-scopes/protocol-mappers" = "ClientScopeEvaluateResourceProtocolMapperEvaluationRepresentation" -"/{realm}/clients/{id}/evaluate-scopes/scope-mappings/{roleContainerId}/granted" = "RoleRepresentation" -"/{realm}/clients/{id}/evaluate-scopes/scope-mappings/{roleContainerId}/not-granted" = "RoleRepresentation" -# "/{realm}/clients/{id}/offline-sessions" = "UserSessionRepresentation" -"/{realm}/clients/{id}/offline-sessions" = "HashMap" -# "/{realm}/clients/{id}/user-sessions" = "UserSessionRepresentation" -"/{realm}/clients/{id}/user-sessions" = "HashMap" -"/{realm}/components" = "ComponentRepresentation" -"/{realm}/groups" = "GroupRepresentation" -"/{realm}/groups/{id}/members" = "UserRepresentation" -"/{realm}/identity-provider/instances" = "IdentityProviderRepresentation" -"/{realm}/identity-provider/instances/{alias}/mappers" = "IdentityProviderMapperRepresentation" -"/{realm}/client-scopes/{id}/protocol-mappers/models" = "ProtocolMapperRepresentation" -"/{realm}/client-scopes/{id}/protocol-mappers/protocol/{protocol}" = "ProtocolMapperRepresentation" -"/{realm}/clients/{id}/protocol-mappers/models" = "ProtocolMapperRepresentation" -"/{realm}/clients/{id}/protocol-mappers/protocol/{protocol}" = "ProtocolMapperRepresentation" -# "/{realm}/admin-events" = "AdminEventRepresentation" -"/{realm}/admin-events" = "HashMap" -"/{realm}/client-session-stats" = "HashMap" -"/{realm}/credential-registrators" = "String" -"/{realm}/default-default-client-scopes" = "ClientScopeRepresentation" -"/{realm}/default-groups" = "GroupRepresentation" -"/{realm}/default-optional-client-scopes" = "ClientScopeRepresentation" -# "/{realm}/events" = "EventRepresentation" -"/{realm}/events" = "HashMap" -"/{realm}/groups/{id}/role-mappings/realm" = "RoleRepresentation" -"/{realm}/groups/{id}/role-mappings/realm/available" = "RoleRepresentation" -"/{realm}/groups/{id}/role-mappings/realm/composite" = "RoleRepresentation" -"/{realm}/users/{id}/role-mappings/realm" = "RoleRepresentation" -"/{realm}/users/{id}/role-mappings/realm/available" = "RoleRepresentation" -"/{realm}/users/{id}/role-mappings/realm/composite" = "RoleRepresentation" -"/{realm}/clients/{id}/roles" = "RoleRepresentation" -"/{realm}/clients/{id}/roles/{role-name}/composites" = "RoleRepresentation" -"/{realm}/clients/{id}/roles/{role-name}/composites/clients/{clientUuid}" = "RoleRepresentation" -"/{realm}/clients/{id}/roles/{role-name}/composites/realm" = "RoleRepresentation" -"/{realm}/clients/{id}/roles/{role-name}/groups" = "GroupRepresentation" -"/{realm}/clients/{id}/roles/{role-name}/users" = "UserRepresentation" -"/{realm}/roles" = "RoleRepresentation" -"/{realm}/roles/{role-name}/composites" = "RoleRepresentation" -"/{realm}/roles/{role-name}/composites/clients/{clientUuid}" = "RoleRepresentation" -"/{realm}/roles/{role-name}/composites/realm" = "RoleRepresentation" -"/{realm}/roles/{role-name}/groups" = "GroupRepresentation" -"/{realm}/roles/{role-name}/users" = "UserRepresentation" -"/{realm}/roles-by-id/{role-id}/composites" = "RoleRepresentation" -"/{realm}/roles-by-id/{role-id}/composites/clients/{clientUuid}" = "RoleRepresentation" -"/{realm}/roles-by-id/{role-id}/composites/realm" = "RoleRepresentation" -"/{realm}/client-scopes/{id}/scope-mappings/clients/{client}" = "RoleRepresentation" -"/{realm}/client-scopes/{id}/scope-mappings/clients/{client}/available" = "RoleRepresentation" -"/{realm}/client-scopes/{id}/scope-mappings/clients/{client}/composite" = "RoleRepresentation" -"/{realm}/client-scopes/{id}/scope-mappings/realm" = "RoleRepresentation" -"/{realm}/client-scopes/{id}/scope-mappings/realm/available" = "RoleRepresentation" -"/{realm}/client-scopes/{id}/scope-mappings/realm/composite" = "RoleRepresentation" -"/{realm}/clients/{id}/scope-mappings/clients/{client}" = "RoleRepresentation" -"/{realm}/clients/{id}/scope-mappings/clients/{client}/available" = "RoleRepresentation" -"/{realm}/clients/{id}/scope-mappings/clients/{client}/composite" = "RoleRepresentation" -"/{realm}/clients/{id}/scope-mappings/realm" = "RoleRepresentation" -"/{realm}/clients/{id}/scope-mappings/realm/available" = "RoleRepresentation" -"/{realm}/clients/{id}/scope-mappings/realm/composite" = "RoleRepresentation" -"/{realm}/users" = "UserRepresentation" -"/{realm}/users/{id}/configured-user-storage-credential-types" = "String" -"/{realm}/users/{id}/consents" = "HashMap" -"/{realm}/users/{id}/credentials" = "CredentialRepresentation" -"/{realm}/users/{id}/federated-identity" = "FederatedIdentityRepresentation" -"/{realm}/users/{id}/groups" = "GroupRepresentation" -# "/{realm}/users/{id}/offline-sessions/{clientUuid}" = "UserSessionRepresentation" -"/{realm}/users/{id}/offline-sessions/{clientUuid}" = "HashMap" -# "/{realm}/users/{id}/sessions" = "UserSessionRepresentation" -"/{realm}/users/{id}/sessions" = "HashMap" -"/{realm}/authentication/authenticator-providers" = "HashMap" -"/{realm}/authentication/client-authenticator-providers" = "HashMap" -"/{realm}/authentication/form-action-providers" = "HashMap" -"/{realm}/authentication/form-providers" = "HashMap" -"/{realm}/client-registration-policy/providers" = "HashMap" -"/{realm}/clients/{id}/default-client-scopes" = "ClientScopeRepresentation" -"/{realm}/clients/{id}/optional-client-scopes" = "ClientScopeRepresentation" -"/{realm}/components/{id}/sub-component-types" = "ComponentRepresentation" -"/{realm}/localization" = "HashMap" \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 852831a..69a09f8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,7 +19,7 @@ Default flags: `tags-all`. ## Usage -Requires Rust version >= `1.58.0`. +Requires Rust version >= `1.74.0`. Add dependency to Cargo.toml: @@ -103,7 +103,7 @@ Example: official version `13.0.1` is `13.0.100` for crate version. `13.0.102` m To update current version use provided [update.ts](./update.ts) `deno` script: ```sh -deno run --allow-env=KEYCLOAK_RUST_VERSION,KEYCLOAK_VERSION,KEYCLOAK_RUST_MAJOR_VERSION --allow-read=Cargo.toml --allow-write=Cargo.toml,docs/rest-api.html,src/types.rs,src/rest/generated_rest.rs --allow-net=keycloak.org,www.keycloak.org --allow-run=cargo,docker,gh,git,handlebars-magic update.ts +deno run --allow-env=KEYCLOAK_RUST_VERSION,KEYCLOAK_VERSION,KEYCLOAK_RUST_MAJOR_VERSION --allow-read=Cargo.toml --allow-write=Cargo.toml,api/openapi.json,src/types.rs,src/rest/generated_rest.rs --allow-net=keycloak.org,www.keycloak.org --allow-run=cargo,gh,git,handlebars-magic update.ts ``` */ diff --git a/templates/README.md b/templates/README.md index 4b1f671..2255f92 100644 --- a/templates/README.md +++ b/templates/README.md @@ -18,7 +18,7 @@ Default flags: `tags-all`. ## Usage -Requires Rust version >= `1.58.0`. +Requires Rust version >= `1.74.0`. Add dependency to Cargo.toml: @@ -41,5 +41,5 @@ Example: official version `13.0.1` is `13.0.100` for crate version. `13.0.102` m To update current version use provided [update.ts](./update.ts) `deno` script: ```sh -deno run --allow-env=KEYCLOAK_RUST_VERSION,KEYCLOAK_VERSION,KEYCLOAK_RUST_MAJOR_VERSION --allow-read=Cargo.toml --allow-write=Cargo.toml,docs/rest-api.html,src/types.rs,src/rest/generated_rest.rs --allow-net=keycloak.org,www.keycloak.org --allow-run=cargo,docker,gh,git,handlebars-magic update.ts +deno run --allow-env=KEYCLOAK_RUST_VERSION,KEYCLOAK_VERSION,KEYCLOAK_RUST_MAJOR_VERSION --allow-read=Cargo.toml --allow-write=Cargo.toml,api/openapi.json,src/types.rs,src/rest/generated_rest.rs --allow-net=keycloak.org,www.keycloak.org --allow-run=cargo,gh,git,handlebars-magic update.ts ``` diff --git a/update.sh b/update.sh deleted file mode 100755 index d405af4..0000000 --- a/update.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/sh - -set -e - -LAST_KEYCLOAK_VERSION=$(curl https://www.keycloak.org/ --no-progress-meter -o - | grep "Latest release" | xargs | cut -f3 -d" ") -KEYCLOAK_RUST_VERSION=$(grep "version = " Cargo.toml | head -n1 | cut -d"\"" -f 2) -KEYCLOAK_RUST_MAJOR_VERSION=$(echo ${KEYCLOAK_RUST_VERSION} | cut -f 1,2 -d".") -KEYCLOAK_VERSION=$(echo ${KEYCLOAK_RUST_MAJOR_VERSION}.$(($(echo ${KEYCLOAK_RUST_VERSION} | cut -f 3 -d".") / 100))) - -function get_milestone -{ - milestone=$1 - if [ -z "${milestone}" ]; then - echo "get_milestone: no parameter given, provide milestone!" - exit 1 - fi - echo "checking if requested milestone (${milestone}) exists" - output=`gh api \ - -H "Accept: application/vnd.github.v3+json" \ - repos/kilork/keycloak/milestones?state=all \ - --jq '.[].title' ` - echo "output: $output" -} - -if [ "${LAST_KEYCLOAK_VERSION}" != "${KEYCLOAK_VERSION}" ]; then - echo "version of keycloak (${LAST_KEYCLOAK_VERSION}) is different to project version (${KEYCLOAK_VERSION})" - BRANCH=$(git branch --show-current) - DEF_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') - if [ "${BRANCH}" != "${DEF_BRANCH}" ]; then - last_keycloak_major_version=$(echo ${LAST_KEYCLOAK_VERSION} | cut -f 1,2 -d".") - last_keycloak_minor_version=$(echo $(($(echo ${LAST_KEYCLOAK_VERSION} | cut -f 3 -d".") * 100))) - MILESTONE=${last_keycloak_major_version}.${last_keycloak_minor_version} - echo target milestone: $MILESTONE - get_milestone $MILESTONE - exit 1 - else - echo "no actions would be performed in non-default branch, running regular update" - fi -fi - -GITHUB_ISSUE=$(git branch --show-current | grep -oh "^\d*") - -echo "Enter cargo version [${KEYCLOAK_RUST_VERSION}]: \c" -read keycloak_rust_version -[ -n "$keycloak_rust_version" ] && KEYCLOAK_RUST_VERSION=$keycloak_rust_version - -echo "Enter Keycloak REST API version [${KEYCLOAK_VERSION}]: \c" -read keycloak_version -[ -n "$keycloak_version" ] && KEYCLOAK_VERSION=$keycloak_version - -echo "Enter GitHub issue [${GITHUB_ISSUE}]: \c" -read github_issue -[ -n "$github_issue" ] && GITHUB_ISSUE=$github_issue - -echo "cargo version: ${KEYCLOAK_RUST_VERSION} rest: ${KEYCLOAK_VERSION} issue: ${GITHUB_ISSUE}" - -echo "Continue [Y]? \c" -read CONFIRM -case "$CONFIRM" in -[Nn]*) - exit 0 - ;; -*) ;; -esac - -KEYCLOAK_REST_DOCS=https://www.keycloak.org/docs-api/${KEYCLOAK_VERSION}/rest-api/index.html -echo "Download and update docs from ${KEYCLOAK_REST_DOCS} [Y]? \c" -read CONFIRM - -case "$CONFIRM" in -[Yy]* | "") - curl ${KEYCLOAK_REST_DOCS} -o docs/rest-api.html - git diff docs/rest-api.html || true - echo "Docs updated." - ;; -*) echo "No docs updated." ;; -esac - -echo Updating documentation... -export KEYCLOAK_VERSION KEYCLOAK_RUST_MAJOR_VERSION -handlebars-magic templates . -echo Documentation updated. -git diff README.md || true -echo "Continue [Y]? \c" -read CONFIRM -case "$CONFIRM" in -[Nn]*) - exit 0 - ;; -*) ;; -esac - -echo Generating types... -git checkout -- src/types.rs src/rest/generated_rest.rs -cargo run --example gen -- types >src/types2.rs -cargo run --example gen -- rest >src/rest/rest2.rs -mv src/types2.rs src/types.rs -mv src/rest/rest2.rs src/rest/generated_rest.rs -echo Types generated. -echo Format and build -cargo fmt -cargo build - -echo Showing final difference... -git diff || true - -echo "Commit changes to git [Y]? \c" -read CONFIRM -case "$CONFIRM" in -[Nn]*) - exit 0 - ;; -*) ;; -esac - -git add . -git commit -am"Keycloak Admin REST API v${KEYCLOAK_RUST_VERSION}" -git tag -f -a -m "Release ${KEYCLOAK_RUST_VERSION}" -m "" -m "Changes:" -m "" -m "- Keycloak Admin REST API v${KEYCLOAK_VERSION} #${GITHUB_ISSUE}" v${KEYCLOAK_RUST_VERSION} - -git log -git tag --list -n10 v${KEYCLOAK_RUST_VERSION} - -echo "Publish to crates.io [Y]? \c" -read CONFIRM -case "$CONFIRM" in -[Nn]*) - exit 0 - ;; -*) ;; -esac - -cargo publish diff --git a/update.ts b/update.ts index 51c1466..9870e50 100644 --- a/update.ts +++ b/update.ts @@ -50,10 +50,10 @@ class Keycloak { } apiUrl(version: Version): string { - return `https://www.keycloak.org/docs-api/${version}/rest-api/index.html`; + return `https://www.keycloak.org/docs-api/${version}/rest-api/openapi.json`; } - async apiDocs(version: Version): Promise { + async apiOpenJson(version: Version): Promise { const response = await fetch(this.apiUrl(version)); return await responseBody(response); } @@ -113,7 +113,7 @@ class Cargo { return await this.generate("rest"); } - private async generate(kind: string): Promise { + private async generate(kind: "rest" | "types"): Promise { return await this.cargoCommand([ "run", "--example", @@ -132,25 +132,6 @@ class Cargo { } } -class Docker { - async generateOpenAPI(version: Version): Promise { - return await this.dockerCommand([ - "build", - "--build-arg", - `VERSION=${version}`, - "-o", - "docs", - "-f", - "docker/Dockerfile.docs", - "docker", - ]); - } - - private async dockerCommand(args: string[]): Promise { - return await Command.spawn("docker", args); - } -} - class Branch { readonly value: string; @@ -214,6 +195,24 @@ class User { const { versions } = options; const latestVersion = versions.keycloakLatestVersion?.toInternalVersion(); const cargoVersion = versions.keycloakCargoVersion; + const { mode } = await prompt([ + { + name: "mode", + message: "Type of update", + type: Select, + options: [ + { + name: "Generation", + value: "generation", + }, + { + name: "Release", + value: "release", + }, + ], + }, + ]); + const release = mode === "release"; const result = await prompt([ { name: "baseVersion", @@ -249,60 +248,31 @@ class User { milestoneVersion = cargoVersion; break; case "manual": - await next("enterMilestone"); - return; + break; default: milestoneVersion = new InternalVersion(baseVersion!); break; } options.milestoneVersion = milestoneVersion; - const milestone = await updater.git.milestone( - milestoneVersion!.toString(), - ); - if (!milestone) { - await next("createMilestone"); - } else { - versions.milestone = milestone; - await next("assignMilestone"); - } + await next(); }, }, { name: "enterMilestone", message: "Enter Milestone", type: Input, - after: async ({ enterMilestone }, next) => { - const milestoneVersion = new InternalVersion(enterMilestone!); - options.milestoneVersion = milestoneVersion; - const milestone = await updater.git.milestone( - milestoneVersion!.toString(), - ); - if (!milestone) { - await next("createMilestone"); - } else { - versions.milestone = milestone; - await next("assignMilestone"); - } - }, - }, - { - name: "createMilestone", - message: `Milestone does not exist. Should we create it?`, - type: Confirm, - default: true, - }, - { - name: "assignMilestone", - message: `Assign milestone to issues and merge requests?`, - type: Confirm, - default: true, - before: async ({ createMilestone }, next) => { - if (!(createMilestone ?? true)) { + before: async (_, next) => { + if (options.milestoneVersion) { await next("changeCargoTomlVersion"); } else { await next(); } }, + after: async ({ enterMilestone }, next) => { + const milestoneVersion = new InternalVersion(enterMilestone!); + options.milestoneVersion = milestoneVersion; + await next(); + }, }, { name: "changeCargoTomlVersion", @@ -311,21 +281,15 @@ class User { default: true, before: async ({ baseVersion }, next) => { if (baseVersion === "cargo") { - await next("downloadApiDocs"); + await next("downloadApi"); } else { await next(); } }, }, { - name: "downloadApiDocs", - message: `Download API documentation?`, - type: Confirm, - default: true, - }, - { - name: "generateOpenAPI", - message: `Generate openapi.json?`, + name: "downloadApi", + message: `Download API description?`, type: Confirm, default: true, }, @@ -341,53 +305,83 @@ class User { type: Confirm, default: true, }, + { + name: "createMilestone", + message: `Milestone does not exist. Should we create it?`, + type: Confirm, + default: release, + before: async (_, next) => { + const milestone = await updater.git.milestone( + options.milestoneVersion!.toString(), + ); + if (!milestone) { + await next(); + } else { + versions.milestone = milestone; + await next("assignMilestone"); + } + }, + }, + { + name: "assignMilestone", + message: `Assign milestone to issues and merge requests?`, + type: Confirm, + default: release, + before: async (_, next) => { + if (!(versions.milestone)) { + await next("createReleaseIssue"); + } else { + await next(); + } + }, + }, { name: "createReleaseIssue", message: `Create release issue?`, type: Confirm, - default: true, + default: release, }, { name: "gitCommit", message: `Create commit in Git?`, type: Confirm, - default: true, + default: release, }, { name: "gitTag", message: `Create tag in Git?`, type: Confirm, - default: true, + default: release, }, { name: "gitPush", message: `Push changes to GitHub?`, type: Confirm, - default: true, + default: release, }, { name: "createReleasePullRequest", message: `Create release pull request?`, type: Confirm, - default: true, + default: release, }, { name: "mergeReleasePullRequest", message: `Merge release pull request?`, type: Confirm, - default: true, + default: release, }, { name: "gitRelease", message: `Create release on GitHub?`, type: Confirm, - default: true, + default: release, }, { name: "cratesPublish", message: `Publish release on crates.io?`, type: Confirm, - default: true, + default: release, }, ]); @@ -780,7 +774,6 @@ class Updater { readonly cargo: Cargo = new Cargo(); readonly git: Git = new Git("kilork/keycloak"); readonly keycloak: Keycloak = new Keycloak(); - readonly docker: Docker = new Docker(); readonly user: User = new User(); options: Options = new Options(); @@ -832,13 +825,9 @@ class Updater { versions.defaultBranch, ); - if (options.downloadApiDocs) { - const apiDocs = await this.keycloak.apiDocs(milestoneVersion.toVersion()); - Deno.writeTextFileSync("docs/rest-api.html", apiDocs); - } - - if (options.generateOpenAPI) { - await this.docker.generateOpenAPI(milestoneVersion.toVersion()); + if (options.downloadApi) { + const api = await this.keycloak.apiOpenJson(milestoneVersion.toVersion()); + Deno.writeTextFileSync("api/openapi.json", api); } if (options.updateDocs) { @@ -853,10 +842,6 @@ class Updater { "src/rest/generated_rest.rs", ]); - if (options.generateOpenAPI) { - await this.cargo.cleanKeycloak(); - } - this.info("Generating new..."); const codeTypes = await this.cargo.generateTypes();