Lazy owner claim: invite a real user (invitation email round-trip)
const url = 'https://api.emite.cr/v1/partner/tenants/example/grant-access';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"email":"dueno@elfogon.cr","role":"owner"}'};
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/partner/tenants/example/grant-access \ --header 'Content-Type: application/json' \ --data '{ "email": "dueno@elfogon.cr", "role": "owner" }'Creates an invitation attributed to the partner app; the recipient materializes the membership (default role: owner) by accepting the emailed one-time code. Never creates a login-capable account directly. Calling it again for the same address replaces the pending invitation (same invitationId, a new code and expiry), but not within 60 seconds of the previous email (429 EMAIL_VERIFICATION_COOLDOWN). If the email cannot be sent, the call fails and can be repeated.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Partner app credential (ecp_*)
Request Bodyrequired
Section titled “Request Bodyrequired”object
Who is invited. The address receives a one-time code valid for 7 days, and the membership exists only once the invitation is accepted; no account is created beforehand. 409 MEMBER_ALREADY_EXISTS when that person is already a member.
Example
dueno@elfogon.crRole of the membership on acceptance, one of the system roles: owner, admin, billing_manager, accountant, issuer, viewer (400 MEMBER_ROLE_INVALID otherwise). owner only while the company has none (409 PARTNER_OWNER_ALREADY_EXISTS).
Example
ownerResponses
Section titled “Responses”object
Identifier of the pending invitation. Calling grant-access again for the same address replaces its code, role and expiry and returns this same id.
The invited address, lowercased — the one the one-time code was emailed to.
Role the membership gets once the invitation is accepted.
When the emailed code stops working — 7 days after this call. Past it, call grant-access again for a new code.
Example
{ "email": "dueno@elfogon.cr", "role": "owner"}