curl --request POST \
--url http://localhost:3333/v1/organization/transfer-ownership \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"newOwnerId": "mem_xyz789"
}
'{
"success": true,
"message": "Ownership transferred successfully",
"currentOwner": {
"memberId": "mem_abc123",
"previousRoles": [
"owner",
"employee"
],
"newRoles": [
"admin",
"employee"
]
},
"newOwner": {
"memberId": "mem_xyz789",
"previousRoles": [
"admin"
],
"newRoles": [
"admin",
"owner"
]
}
}Transfers organization ownership to another member. The current owner will become an admin and keep all other roles. The new owner will receive the owner role while keeping their existing roles. Only the current organization owner can perform this action. Supports both API key authentication (X-API-Key header) and session authentication (cookies + X-Organization-Id header).
curl --request POST \
--url http://localhost:3333/v1/organization/transfer-ownership \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"newOwnerId": "mem_xyz789"
}
'{
"success": true,
"message": "Ownership transferred successfully",
"currentOwner": {
"memberId": "mem_abc123",
"previousRoles": [
"owner",
"employee"
],
"newRoles": [
"admin",
"employee"
]
},
"newOwner": {
"memberId": "mem_xyz789",
"previousRoles": [
"admin"
],
"newRoles": [
"admin",
"owner"
]
}
}API key for authentication
Organization ID (required for session auth, optional for API key auth)
Transfer organization ownership to another member
Member ID of the new owner
"mem_xyz789"
Ownership transferred successfully
true
"Ownership transferred successfully"
Was this page helpful?