Confirm the OTP and execute the transfer (step 2 of 2)
const url = 'https://api.emite.cr/v1/tenants/me/members/transfer-ownership/confirm';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"code":"123456"}'};
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/confirm \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "code": "123456" }'Verifies the OTP (TTL + attempt cap + HMAC) then runs the atomic demote-then-promote tx against tenant_users with race-safe WHERE clauses so a concurrent removeMember on the target or a concurrent transfer can never leave the tenant without an active owner. The transfer row is marked consumed_at inside the same tx. After the transfer the caller becomes admin; the web should call /auth/me to refresh effective scopes.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
6-digit code from the OTP email.
Example
123456Responses
Section titled “Responses”Ownership transferred.
object
A fixed confirmation, in English: Ownership transferred. The target member is now the owner and the caller an admin — read GET /v1/auth/me again for the scopes it holds now.
Example
{ "message": "Ownership transferred"}Missing or invalid JWT.
Caller no longer the owner (NOT_OWNER) — possible if a concurrent transfer ran.
Target user no longer a member (MEMBER_NOT_FOUND) — they were removed mid-flow.