# Team

> Invite people to one business with Read, Full or Admin access. They get an email, sign in (or sign up) and see that business only, never the rest of your account.

Invite someone to **one business** (a project) and pick what they can do there. They get an email, sign in with that address (new people sign up on the way), and the business shows up in their account switcher under **Shared with you**. They never see the rest of your account.

| Role | Can |
| --- | --- |
| **Read** | See everything in the business (pages, analytics, replays, payments, database, logs, settings) and change nothing. Never sees production secrets (production variables, app keys, webhook secrets, secret exports). |
| **Full** | Everything in the business the way you can: deploy, roll back, variables, database, email, AI, payments settings, domains, social. Not the team, and not deleting the business. |
| **Admin** | Full, plus inviting, removing and changing people, and deleting the business. |

Whatever the role, a member never sees your **billing and credits, API keys, other businesses, the account's Library, dashboards and analytics, payouts and withdrawals**, nor sells or transfers the business. What they use (AI, email, web data…) is billed to your account like your own usage, and shows under their name in Usage ▸ by person.

## Inviting

console ▸ the business ▸ **Team** ▸ *Invite someone*: an email and a role. Or:

```bash
curl -X POST https://thelastapi.dev/v1/projects/prj_…/members/invites \
  -H "Authorization: Bearer $VIBIZ_API_KEY" -H 'content-type: application/json' \
  -d '{"email":"ana@example.com","role":"full"}'
```

- The link works **once**, for **14 days**, and **only for the invited email** (any capitalization). Someone signed in with another address is told so, and offered to sign in with the right one.
- Inviting the same email again updates the pending invite (its role, a new link, a new expiry) and sends it again; the old link stops working. *Send again* and *Revoke* are on the Team page.
- Someone already on the team can't be invited again: change their role instead.
- At most 25 invites a day per business, and 5 to the same address.
- If the email can't be sent, the answer says why and hands you the link to send yourself.

Who can invite: the owner (a Full access key or the console), and admin members. A Limited key can't.

## Changing and removing

On the Team page the owner and admins change a member's role or remove them; a member can **Leave**. A change applies on the member's very next request: a removed member's access ends at once, and a member demoted to Read can't change anything from that click on. Nobody changes their own role.

## For the person invited

The link opens a welcome page: the business, the role as a badge (*Member · Full access*, *Admin*, *Read access*), who invited them, and their number on the team. Signed out, it offers to sign in or create a login with the invited email (filled in on the sign-in page); after **Join**, *Welcome aboard* and a button into the business. Opening the link again later shows the same welcome.

The account switcher (the account name in the breadcrumb, or the role button at the top on phones) lists **Your account** and **Shared with you: Bakery · Ana's stack (Full)**. Picking one switches the whole console to it. Inside a shared business the console shows only its pages, with your role next to it; account pages aren't there. Someone with no account of their own needs none: signing in opens the business shared with them.

### An account of their own

Accepting an invite from an account that **pays** (it has topped up credits or is exempt from billing) also lets the person open an account of their own, whenever new accounts would otherwise need approval: *Create your own account* in the switcher, `vibiz login`, or an MCP client's sign-in. That account starts **without trial credit**: the free trial stays with people who sign up on their own (once per mailbox), so invites can't be used to collect it. An invite from an account that never paid gives access to the business only.

## How isolation works

A member acts through their own key on the owner's account, limited to that one business and their role. Every request is checked centrally, before any route runs, and **denies by default**:

- Another business of the same owner answers `404`, as if it didn't exist; the project list shows only theirs.
- Any route that isn't the business's own answers `403` with `reason: "member_scope"`, including routes added later.
- A Read member's changes answer `403` with `reason: "member_read_only"`: *"You have Read access to Bakery; ask an admin for Full access."*
- Inviting, changing or removing people without Admin answers `403` with `reason: "member_admin_only"`.

## API

| Call | Does |
| --- | --- |
| `GET /v1/projects/:id/members` | the owner, members, pending invites (owner and admins), `can_manage` |
| `POST /v1/projects/:id/members/invites` `{ email, role }` | invite, or update and send again the pending invite |
| `POST /v1/projects/:id/members/invites/:invite/send` | a new link and expiry |
| `DELETE /v1/projects/:id/members/invites/:invite` | revoke |
| `PATCH /v1/projects/:id/members/:member` `{ role }` | change a role |
| `DELETE /v1/projects/:id/members/:member` | remove (`me`: yourself) |
| `POST /v1/projects/:id/members/me/leave` | leave |

Every answer has a `console_url` to the business's Team page; every refusal says what failed, why and how to fix it, with the field in `param`.
