Skip to content

Request an ownership-transfer challenge (step 1 of 2)

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

Media typeapplication/json
object
targetUserId
required

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.

string
Example
0a1b2c3d-4e5f-6789-abcd-ef0123456789
currentPassword
required

The 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).

string

Code emailed to the owner's address; nothing is transferred until it is confirmed.

Media typeapplication/json
object
expiresAt
required

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.

string format: date-time
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).