Add or change an organization member (idempotent upsert)
`(orgId, userId)` is unique: adding an existing member with the same tier is a no-op, a different tier updates it. Granting the `org-owner` tier performs an atomic ownership transfer (the previous owner lands on `org-admin`). With `actorUserId` the change additionally passes that user's in-org management gate, self-hold check, and (for transfers) the current-owner requirement.
(orgId, userId) is unique: adding an existing member with the same tier
is a no-op, a different tier updates it. Granting the org-owner tier
performs an atomic ownership transfer (the previous owner lands on
org-admin). With actorUserId the change additionally passes that
user's in-org management gate, self-hold check, and (for transfers) the
current-owner requirement.
api_keyX-API-Key<token>Client-app API key (third-party external API).
realmId*stringRealm ID
orgId*stringOrganization ID
application/json- body
actorUserId?|User the application acts on behalf of; when present the change is gated by that user's in-org management and self-hold authority.
role*stringTier name resolved within (realm, the organization's client_id);
built-ins are org-owner / org-admin / org-member.
userId*stringMembership created or updated
application/json- response
createdAt*stringisOwner*booleanorgId*stringrole*updatedAt*stringuserId*stringcurl -X POST 'https://example.com/api/ext/realms/string/orgs/string/members' \
-H 'Content-Type: application/json' \
-d '{
"role": "string",
"userId": "string"
}'{
"createdAt": "string",
"isOwner": true,
"orgId": "string",
"role": {
"id": "string",
"name": "string"
},
"updatedAt": "string",
"userId": "string"
}