Transfer organization ownership
POST
/v1/organization/transfer-ownership
const url = 'https://api.varman.io/v1/organization/transfer-ownership';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"newOwnerId":"mem_xyz789","userId":"usr_abc123def456"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.varman.io/v1/organization/transfer-ownership \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "newOwnerId": "mem_xyz789", "userId": "usr_abc123def456" }'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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Transfer organization ownership to another member
Media typeapplication/json
object
newOwnerId
required
Member ID of the new owner
string
Example
mem_xyz789userId
User ID of the current owner initiating the transfer (required for API key auth, ignored for JWT auth)
string
Example
usr_abc123def456Responses
Section titled “Responses”default
Section titled “default”Not found - Organization or member not found
Forbidden - Only organization owner can transfer ownership
Unauthorized - Invalid or missing authentication
Bad request - Invalid input
Ownership transferred successfully
Media typeapplication/json
object
success
boolean
message
string
currentOwner
object
memberId
string
previousRoles
Array<string>
newRoles
Array<string>
newOwner
object
memberId
string
previousRoles
Array<string>
newRoles
Array<string>
Example
{ "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" ] }}