Skip to content

Confirm the OTP and execute the transfer (step 2 of 2)

POST
/v1/tenants/me/members/transfer-ownership/confirm
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.

Media typeapplication/json
object
code
required

6-digit code from the OTP email.

string
Example
123456

Ownership transferred.

Media typeapplication/json
object
message
required

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.

string
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.