Request an ownership-transfer challenge (step 1 of 2)
const url = 'https://api.emite.cr/v1/tenants/me/members/transfer-ownership/request';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"targetUserId":"0a1b2c3d-4e5f-6789-abcd-ef0123456789","currentPassword":"example"}'};
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.emite.cr/v1/tenants/me/members/transfer-ownership/request \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "targetUserId": "0a1b2c3d-4e5f-6789-abcd-ef0123456789", "currentPassword": "example" }'Two-factor step-up: password (this endpoint) + 6-digit OTP emailed to the current owner's address, valid 10 minutes (verified at POST …/transfer-ownership/confirm). Answers 202 with the code's expiry. The OTP arriving in the real owner's inbox is the out-of-band signal that detects session hijacking — a stolen session can request but not complete the transfer. Pending row is one per tenant (the partial unique re-uses an existing row, rotating the code subject to a 60s cooldown).
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
User ID of the existing tenant member who will become the new owner. Must already be a member of the tenant. The previous owner is atomically demoted to admin on confirm.
Example
0a1b2c3d-4e5f-6789-abcd-ef0123456789The current owner's password — first factor of the step-up challenge. Proves the live session. The second factor is the 6-digit OTP emailed to the current owner's address (must be confirmed at POST /transfer-ownership/confirm).
Responses
Section titled “Responses”Code emailed to the owner's address; nothing is transferred until it is confirmed.
object
When the 6-digit code emailed to the owner's address stops working: 10 minutes after this request. Confirm it with POST /v1/tenants/me/members/transfer-ownership/confirm.
Examplegenerated
{ "expiresAt": "2026-04-15T12:00:00Z"}Missing or invalid JWT.
Password challenge failed (PASSWORD_INVALID) or caller not the owner (NOT_OWNER).
Target user is not a member (MEMBER_NOT_FOUND).