Skip to content

Lazy owner claim: invite a real user (invitation email round-trip)

POST
/v1/partner/tenants/{id}/grant-access
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.

id
required
string
x-partner-key
string

Partner app credential (ecp_*)

Media typeapplication/json
object
email
required

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.

string
Example
dueno@elfogon.cr
role

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

string
default: owner
Example
owner
Media typeapplication/json
object
invitationId
required

Identifier of the pending invitation. Calling grant-access again for the same address replaces its code, role and expiry and returns this same id.

string format: uuid
email
required

The invited address, lowercased — the one the one-time code was emailed to.

string
role
required

Role the membership gets once the invitation is accepted.

string
Allowed values: owner admin billing_manager accountant issuer viewer
expiresAt
required

When the emailed code stops working — 7 days after this call. Past it, call grant-access again for a new code.

string format: date-time
Example
{
"email": "dueno@elfogon.cr",
"role": "owner"
}