Invitations
Invite a person to the account by copy-link or email, assign a role and initial grants, and revoke pending invitations.
To add a person to an account you create an invitation — its own resource, separate
from members. It is a single-use, expiring token that
carries the target role and, for a MEMBER, the initial company grants. The person
becomes a member only when they accept; a revoked or expired invitation never
produces one.
Invitations hang off the account — /v1/accounts/{account_id}/invitations — and require
OWNER or ADMIN plus members:read / members:write.
Invite a person
POST /v1/accounts/{account_id}/invitations — members:write. Full field list and
types: Invite a person to the account.
curl -X POST https://app.beel.es/api/v1/accounts/3fa85f64-5717-4562-b3fc-2c963f66afa6/invitations \
-H "Authorization: Bearer beel_sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"invited_email": "colleague@example.com",
"account_role": "MEMBER",
"send_email": false,
"grants": [
{ "company_id": "550e8400-e29b-41d4-a716-446655440000", "access_level": "OPERATE" }
]
}'Three things about the body are easy to get wrong:
grantsis required, even when empty. Send[]to invite somebody with no NIF access yet and grant it after they accept. An explicitnullis rejected with400— the API will not guess whether you meant "none" or "forgot".- Grants only make sense for
account_role: "MEMBER". AnOWNERorADMINreaches every NIF implicitly; sending grants with either is422 GRANTS_ONLY_FOR_MEMBER. A grant naming a NIF outside the account is422 GRANT_COMPANY_NOT_IN_ACCOUNT. - Inviting as
OWNERrequires you to beOWNER. AnADMINcannot mint one.
token and invitation_url are shown once and never again. Not by the list
endpoint, not by the get. Capture them from the 201 and deliver the link; lose them
and your only option is to revoke the invitation and issue a new one.
Copy-link or email
- Copy-link (default,
send_email: false) — you get a ready-to-shareinvitation_urlplus the rawtoken, and deliver it however you like: your own email, chat, in-app. Full control over the message and the branding. - Email (
send_email: true) — BeeL. also sends the invitation email for you. You still receive the token and URL in the response, so you can follow up yourself.
Both mint the same single-use token; invitation_url is just that token wrapped in the
acceptance link for the current environment, so you never assemble /aceptar?token=
by hand.
Acceptance happens outside the API
The invitee opens the link and accepts on BeeL. — setting a password if they are new.
There is no public endpoint for you to call: acceptance is a session action on
BeeL.'s side, the same way a provisioned account is
claimed. You observe the result, you do not drive it: the
invitation flips to ACCEPTED and the person shows up in
GET /v1/accounts/{account_id}/members.
Track and revoke
GET /v1/accounts/{account_id}/invitations — members:read, paginated with page
and limit. Every invitation stays readable for its whole life:
status | Meaning |
|---|---|
PENDING | Active and not yet expired. Revocable. |
ACCEPTED | The invitee accepted; they are now a member. |
REVOKED | Cancelled before acceptance. |
EXPIRED | Passed its expiry date unaccepted. |
ACCEPTED, REVOKED and EXPIRED invitations are not deleted. The record is the
audit trail of who was ever granted access to the account's fiscal data — revoking one
does not erase it. So a 404 from the get means exactly one thing: no invitation with
that id exists in this account.
DELETE /v1/accounts/{account_id}/invitations/{invitation_id} — members:write,
204. Only a PENDING invitation can be revoked; one already accepted, revoked or
expired returns 404 rather than disclosing which of the three it is. See
Revoke a member invitation.
Next steps
Members & grants
Account roles (owner/admin/member), per-company grants with an access level (view/operate), and handing over ownership.
Managed accounts
The provisioner flow for agencies and fleets — provision accounts, choose your access level, track their lifecycle, and issue invoices on their behalf.