Create an identity provider
const url = 'http://localhost:8000/clusters/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/realms/customer-portal/identity-providers';
const options = {
method: 'POST',
headers: {
'API-Version': '2026-06-01.beta',
'API-Key': '<API-Key>',
'Content-Type': 'application/json'
},
body: '{"provider_id":"oidc","type":"oidc","display_name":"example","client_id":"example","client_secret":"example","config":{"oidc":{"issuer":"https://accounts.google.com","authorization_url":"https://accounts.google.com/o/oauth2/v2/auth","token_url":"https://oauth2.googleapis.com/token","userinfo_url":"https://openidconnect.googleapis.com/v1/userinfo","logout_url":"https://example.com"},"saml":{"entity_id":"https://idp.example.com/entity","sso_url":"https://idp.example.com/sso/saml","metadata_url":"https://example.com","metadata_xml":"example"},"ldap":{"server_url":"ldaps://ldap.example.com:636","base_dn":"dc=example,dc=com","bind_dn":"cn=skycloak-svc,ou=service-accounts,dc=example,dc=com"},"icon_url":"https://example.com","button_text":"Continue with Okta","attribute_mappings":{"email":"email","firstName":"given_name","lastName":"family_name"},"sync_mode":"import","trust_email":true},"template_id":"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/identity-providers \
--header 'API-Key: <API-Key>' \
--header 'API-Version: 2026-06-01.beta' \
--header 'Content-Type: application/json' \
--data '{ "provider_id": "oidc", "type": "oidc", "display_name": "example", "client_id": "example", "client_secret": "example", "config": { "oidc": { "issuer": "https://accounts.google.com", "authorization_url": "https://accounts.google.com/o/oauth2/v2/auth", "token_url": "https://oauth2.googleapis.com/token", "userinfo_url": "https://openidconnect.googleapis.com/v1/userinfo", "logout_url": "https://example.com" }, "saml": { "entity_id": "https://idp.example.com/entity", "sso_url": "https://idp.example.com/sso/saml", "metadata_url": "https://example.com", "metadata_xml": "example" }, "ldap": { "server_url": "ldaps://ldap.example.com:636", "base_dn": "dc=example,dc=com", "bind_dn": "cn=skycloak-svc,ou=service-accounts,dc=example,dc=com" }, "icon_url": "https://example.com", "button_text": "Continue with Okta", "attribute_mappings": { "email": "email", "firstName": "given_name", "lastName": "family_name" }, "sync_mode": "import", "trust_email": true }, "template_id": "example" }'Adds a new identity provider to the realm. Supply template_id from GET /identity-provider-templates to bootstrap configuration from a pre-built template.
Required scope: identity-providers: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 identity provider.
object
Skycloak provider ID. Determines the Keycloak provider type and becomes the alias for this provider instance. Must be unique within the realm.
Protocol of the identity provider.
OAuth 2.0 / LDAP client identifier registered with the external provider.
Client secret or LDAP bind password. Write-only; never returned by the API.
Protocol-specific configuration and shared display options. Populate only the sub-object that matches type.
object
OIDC-specific endpoints. Required when type is oidc.
object
OIDC issuer identifier URL. Use POST /identity-providers/discover-oidc to fetch endpoints from the issuer automatically.
Example
https://accounts.google.comAuthorization endpoint. Derived from discovery when issuer is supplied.
Example
https://accounts.google.com/o/oauth2/v2/authToken endpoint. Derived from discovery when issuer is supplied.
Example
https://oauth2.googleapis.com/tokenUserInfo endpoint.
Example
https://openidconnect.googleapis.com/v1/userinfoEnd-session (logout) endpoint.
SAML-specific settings. Required when type is saml.
object
SAML entity ID of the external identity provider.
Example
https://idp.example.com/entitySAML Single Sign-On service URL.
Example
https://idp.example.com/sso/samlURL to the IdP’s SAML metadata document. Takes precedence over metadata_xml.
Raw SAML metadata XML. Used when the IdP does not publish a metadata URL.
LDAP-specific settings. Required when type is ldap.
object
LDAP server URL including scheme and port.
Example
ldaps://ldap.example.com:636Base Distinguished Name used as the search root.
Example
dc=example,dc=comBind DN used to authenticate against the directory.
Example
cn=skycloak-svc,ou=service-accounts,dc=example,dc=comURL to the logo displayed on the login button.
Label of the SSO login button shown to end users.
Example
Continue with OktaKeycloak attribute name → IdP claim name mappings applied when importing user profiles.
object
Example
{
"email": "email",
"firstName": "given_name",
"lastName": "family_name"
}When true, Keycloak trusts email addresses provided by this IdP without sending a verification email. Enable only for providers that verify email addresses themselves.
Template ID from GET /identity-provider-templates. When provided, type and config are pre-filled with recommended defaults; explicit fields in this request override template values.
Responses
Section titled “Responses”The request has succeeded and a new resource has been created as a result.
An identity provider (social login, enterprise SSO, or directory federation) configured in a Keycloak realm.
object
Keycloak alias. Stable resource identifier for this API. For providers created via Skycloak this is always a SkycloakProviderId value; for externally managed providers it may be any valid alias string.
Protocol of the identity provider.
Client identifier used to authenticate with the external provider. Not a secret.
Protocol-specific configuration and shared display options. Populate only the sub-object that matches type.
object
OIDC-specific endpoints. Required when type is oidc.
object
OIDC issuer identifier URL. Use POST /identity-providers/discover-oidc to fetch endpoints from the issuer automatically.
Authorization endpoint. Derived from discovery when issuer is supplied.
Token endpoint. Derived from discovery when issuer is supplied.
UserInfo endpoint.
End-session (logout) endpoint.
SAML-specific settings. Required when type is saml.
object
SAML entity ID of the external identity provider.
SAML Single Sign-On service URL.
URL to the IdP’s SAML metadata document. Takes precedence over metadata_xml.
Raw SAML metadata XML. Used when the IdP does not publish a metadata URL.
LDAP-specific settings. Required when type is ldap.
object
LDAP server URL including scheme and port.
Base Distinguished Name used as the search root.
Bind DN used to authenticate against the directory.
URL to the logo displayed on the login button.
Label of the SSO login button shown to end users.
Keycloak attribute name → IdP claim name mappings applied when importing user profiles.
object
When true, Keycloak trusts email addresses provided by this IdP without sending a verification email. Enable only for providers that verify email addresses themselves.
When true, this provider was created or last modified directly in the Keycloak Admin Console. Skycloak reflects its configuration but PATCH and DELETE will return 403 Forbidden.
Example
{
"provider_id": "google-workspace",
"type": "oidc",
"config": {
"oidc": {
"issuer": "https://accounts.google.com",
"authorization_url": "https://accounts.google.com/o/oauth2/v2/auth",
"token_url": "https://oauth2.googleapis.com/token",
"userinfo_url": "https://openidconnect.googleapis.com/v1/userinfo"
},
"saml": {
"entity_id": "https://idp.example.com/entity",
"sso_url": "https://idp.example.com/sso/saml"
},
"ldap": {
"server_url": "ldaps://ldap.example.com:636",
"base_dn": "dc=example,dc=com",
"bind_dn": "cn=skycloak-svc,ou=service-accounts,dc=example,dc=com"
},
"button_text": "Continue with Okta",
"attribute_mappings": {
"email": "email",
"firstName": "given_name",
"lastName": "family_name"
},
"sync_mode": "import"
}
}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"
}