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.

X-API-Key<token>

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

In: header

Path Parameters

realmId*string

Realm ID

orgId*string

Organization ID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

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

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}