Create an application
const url = 'http://localhost:8000/clusters/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/realms/customer-portal/applications';
const options = {
method: 'POST',
headers: {
'API-Version': '2026-06-01.beta',
'API-Key': '<API-Key>',
'Content-Type': 'application/json'
},
body: '{"client_id":"example","name":"example","description":"example","type":"confidential","protocol":"openid-connect","status":"active","redirect_uris":["example"],"grant_types":["authorization_code"],"pkce_required":false,"consent_required":false,"saml_config":{"entity_id":"example","assertion_consumer_urls":["example"],"single_logout_service_url":"example","name_id_format":"urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified","sign_documents":true,"sign_assertions":true,"encrypt_assertions":true,"force_authn":true,"force_post_binding":true,"include_authn_statement":true,"attribute_statements":{"additionalProperty":"example"}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}curl --request POST \
--url http://localhost:8000/clusters/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/realms/customer-portal/applications \
--header 'API-Key: <API-Key>' \
--header 'API-Version: 2026-06-01.beta' \
--header 'Content-Type: application/json' \
--data '{ "client_id": "example", "name": "example", "description": "example", "type": "confidential", "protocol": "openid-connect", "status": "active", "redirect_uris": [ "example" ], "grant_types": [ "authorization_code" ], "pkce_required": false, "consent_required": false, "saml_config": { "entity_id": "example", "assertion_consumer_urls": [ "example" ], "single_logout_service_url": "example", "name_id_format": "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", "sign_documents": true, "sign_assertions": true, "encrypt_assertions": true, "force_authn": true, "force_post_binding": true, "include_authn_statement": true, "attribute_statements": { "additionalProperty": "example" } } }'Registers a new Keycloak client in the realm.
Required scope: applications:write
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Keycloak realm name (not ID). Must start with a letter; allows letters, digits, and hyphens.
Example
customer-portalHeader Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Request body for creating a new application.
object
OAuth 2.0 client identifier. Must be unique within the realm.
Human-readable display name.
Optional description.
OAuth 2.0 client type. Defaults to confidential.
Authentication protocol. Defaults to openid_connect.
Initial status. Defaults to active.
Allowed redirect URIs. Required when grant_types includes authorization_code.
Enabled OAuth 2.0 grant types.
Whether PKCE is required. Defaults to false.
Whether user consent is required. Defaults to false.
SAML configuration. Required when protocol is saml.
object
SAML entity ID (SP Entity ID / Issuer).
Assertion Consumer Service URLs (ACS endpoints).
Single Logout Service URL.
SAML NameID format.
Whether to sign SAML documents.
Whether to sign SAML assertions.
Whether to encrypt SAML assertions.
Whether to force re-authentication on each request.
Whether to force HTTP POST binding for responses.
Whether to include the AuthnStatement in assertions.
Static SAML attribute statements to include in assertions. Keys are attribute names; values are attribute values.
object
Responses
Section titled “Responses”The request has succeeded and a new resource has been created as a result.
A Keycloak client (application) registered in a realm.
object
OAuth 2.0 client identifier. Stable resource identifier for this API.
Human-readable display name.
Optional description of the application.
OAuth 2.0 client type.
Authentication protocol.
Whether the application is active.
Allowed redirect URIs for authorization-code flows. Required for authorization_code grant.
Enabled OAuth 2.0 grant types.
Whether PKCE (Proof Key for Code Exchange) is required.
Whether user consent is required before issuing tokens.
Whether this application has a service account for machine-to-machine flows. Derived from the client_credentials grant type.
Client secret. Present only immediately after creation or secret rotation; store it securely as it will not be returned again.
Browser origins allowed to call this application (CORS). ["*"] allows any origin.
URIs a user may be redirected to after signing out. Falls back to redirect_uris when empty.
Root URL. Prefixed to any relative redirect URI.
Home URL. Where Keycloak sends a user opening the application from the account console.
Admin URL. Where Keycloak sends back-channel logout and admin callbacks.
SAML-specific configuration. Present only when protocol is saml.
object
SAML entity ID (SP Entity ID / Issuer).
Assertion Consumer Service URLs (ACS endpoints).
Single Logout Service URL.
SAML NameID format.
Whether to sign SAML documents.
Whether to sign SAML assertions.
Whether to encrypt SAML assertions.
Whether to force re-authentication on each request.
Whether to force HTTP POST binding for responses.
Whether to include the AuthnStatement in assertions.
Static SAML attribute statements to include in assertions. Keys are attribute names; values are attribute values.
object
Example
{
"type": "confidential",
"protocol": "openid-connect",
"status": "active",
"grant_types": [
"authorization_code"
],
"saml_config": {
"name_id_format": "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"
}
}The server could not understand the request due to invalid syntax.
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}Access is unauthorized.
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}Client error
Returned when a workspace plan quota would be exceeded. required_plan indicates the minimum plan needed to complete the request.
object
Machine-readable identifier of the quota that was hit, so a client can tell
quotas apart without parsing detail. Known values include cluster_limit
(the workspace’s total cluster allowance), cluster_size_quota (the
allowance for the requested cluster size) and cluster_size (the requested
size is not offered on the plan at all). New values may be added.
How many of the resource the workspace currently has.
Maximum allowed by the current plan. 0 means the plan does not include the resource at all.
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com",
"current_plan": "example",
"required_plan": "example",
"code": "example",
"current_usage": 1,
"current_limit": 1
}Access is forbidden.
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}The server cannot find the requested resource.
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}The request conflicts with the current state of the server.
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}Client error
object
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com",
"errors": [
{
"field": "example",
"detail": "example",
"code": "example",
"value": "example"
}
]
}Client error
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}Headers
Section titled “Headers”Server error
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}Server error
RFC 9457 Problem Details object.
object
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com"
}