Herald
OpenapiExt

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.

POST
/api/ext/realms/{realmId}/orgs/{orgId}/members

(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
headerX-API-Key<token>

Client-app API key (third-party external API).

Path Parameters

realmId*string

Realm ID

orgId*string

Organization ID

Request Body

application/json
  1. 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*string

Tier name resolved within (realm, the organization's client_id); built-ins are org-owner / org-admin / org-member.

userId*string

Response Body

Membership created or updated

application/json
  1. response
createdAt*string
isOwner*boolean
orgId*string
role*
updatedAt*string
userId*string
Example Request
curl -X POST 'https://example.com/api/ext/realms/string/orgs/string/members' \
  -H 'Content-Type: application/json' \
  -d '{
  "role": "string",
  "userId": "string"
}'
Example Response
{
  "createdAt": "string",
  "isOwner": true,
  "orgId": "string",
  "role": {
    "id": "string",
    "name": "string"
  },
  "updatedAt": "string",
  "userId": "string"
}