App öffnen
Moonborn — API · orgs

Transfer Owner role to another active member (atomic 4-eyes flow)

POST/v1/orgs/{id}/transfer-ownershipscope · Bearer (API key or session JWT)
Path parameters
FieldTypeDescription
idreqstringOrganization id (cuid).
Request body
FieldTypeDescription
toUserIdreqstring

Responses

200Ownership transferred
Body
FieldTypeDescription
idreqstring
slugreqstring
namereqstring
regionreqstring · "us" | "eu"
dataResidencyLockedreqboolean
createdAtreqstring
ownerUserIdreqstring
workspacesCountreqnumber
404Org not found
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring
409Target user is not an active member
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring

Examples

cURL
curl -X POST https://api.moonborn.co/v1/orgs/<id>/transfer-ownership \
  -H "Authorization: Bearer $MOONBORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "toUserId": "<string>"
    }'
TypeScript
import Moonborn from '@moonborn/sdk';

const client = new Moonborn({ apiKey: process.env.MOONBORN_API_KEY });

const result = await client.orgs.transferOrgOwnership({
  id: '<id>',
  toUserId: "<string>",
});
Python
import os
from moonborn import Moonborn

client = Moonborn(api_key=os.environ["MOONBORN_API_KEY"])

result = client.orgs.transfer_org_ownership(
    id="<id>",
    to_user_id="<string>",
)