Create the user for a Keycloak-only account and anchor it to one organization
const url = 'http://localhost:3000/api/v1/tenant-consistency/keycloak-users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/anchor';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"organizationId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","roleId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
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:3000/api/v1/tenant-consistency/keycloak-users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/anchor \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "organizationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "roleId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'For a Keycloak account with no logiccloud orchestrate user row (“keycloak-only”): creates the row from the Keycloak account and anchors it like POST /users/{userId}/anchor, in one transaction. Refused while Entra federation is enabled (user creation is governed by Entra). Requires Super Admin privileges.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”UUID of the organization (tenant) the request acts in. It selects the tenant and grants nothing: the server checks membership or an open tenant switch. Not needed for global operations. A malformed value returns 400. API keys are fixed to their own organization; another organization returns 403. The x-organization-source header grants nothing.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Organization to make the user primary in, in both logiccloud orchestrate and Keycloak.
Role for a NEW membership; defaults to the system viewer role when the user is not yet a member. Rejected (400) when the user already is a member, because the existing role is kept.
Examplegenerated
{ "organizationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "roleId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Responses
Section titled “Responses”object
True when the user was not a member and a membership was created.
Organization_id attribute before the anchor, as Keycloak reported it.
Organization_id attribute now: exactly the membership set, de-duplicated. Order is not meaningful.
False when the user has no live Keycloak account (never linked, or the linked account no longer exists): only the database primary was set (FM-1441).
True when the linked Keycloak account no longer exists and the stale link was removed; the user is linked again on the next sign-in (FM-1441).
True when a logiccloud orchestrate user row was created for a Keycloak-only account (FM-1441).
Examplegenerated
{ "userId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "email": "example", "organizationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "membershipCreated": true, "previousPrimaryOrganizationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "previousKeycloakOrganizationIds": [ "example" ], "keycloakOrganizationIds": [ "example" ], "keycloakUpdated": true, "keycloakLinkCleared": true, "userCreated": true}Invalid input data
Forbidden - Super Admin required, or Entra enabled
Keycloak account, organization or role not found
The account already has a user, has no email, a user with its email exists, or the organization is not active
Keycloak could not be read or rejected the update
Keycloak is not configured