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.
Authorization
api_key Client-app API key (third-party external API).
In: header
Path Parameters
Realm ID
Organization ID
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
User the application acts on behalf of; when present the change is gated by that user's in-org management and self-hold authority.
Tier name resolved within (realm, the organization's client_id);
built-ins are org-owner / org-admin / org-member.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -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"}{ "code": "string", "details": null, "message": "string", "requestId": "string", "status": 0}{ "code": "string", "details": null, "message": "string", "requestId": "string", "status": 0}{ "code": "string", "details": null, "message": "string", "requestId": "string", "status": 0}{ "code": "string", "details": null, "message": "string", "requestId": "string", "status": 0}{ "code": "string", "details": null, "message": "string", "requestId": "string", "status": 0}{ "code": "string", "details": null, "message": "string", "requestId": "string", "status": 0}