# Teams and roles

An account can have several members. Each has one role.

| Role | Can |
| --- | --- |
| Owner | Everything, including billing and deleting projects. |
| Admin | Everything except billing and deleting projects. |
| Developer | Deploy, manage environment variables and secrets, read logs and data. |
| Viewer | See projects, logs and the team. Can't change anything or read your app's data. |

Only an owner can make someone an owner, change an owner's role or remove an owner. An account always has at least one owner, so the last owner can't leave or step down until someone else is an owner.

## Seats

Your plan sets how many members you can have; extra seats add more. A pending invite holds a seat until it's accepted, revoked or expired. If you're full, inviting returns `403 plan_limit_reached`.

## Invites

| Request | Who | What it does |
| --- | --- | --- |
| `GET /v1/members` | Everyone | Lists members and their roles. |
| `GET /v1/members/invites` | Everyone | Lists pending invites. |
| `POST /v1/members/invites` | Owners, admins | `{ "email", "role" }`. Emails the person a link that works for 7 days and returns `{ "id", "email", "expiresAt" }`. The link is only in the email. If the address can't receive email, the invite isn't kept and you get `400 validation_failed`. To send a new link, revoke the invite and invite again. |
| `DELETE /v1/members/invites/{inviteId}` | Owners, admins | Revokes an invite. |
| `POST /v1/invites/accept` | The invited person | `{ "token" }`. Sign in with the invited email address first; it must be confirmed. You don't need a plan of your own. |
| `PATCH /v1/members/{memberId}` | Owners, admins | `{ "role" }`. |
| `DELETE /v1/members/{memberId}` | Owners, admins | Removes a member. Their personal access tokens stop working. |
| `POST /v1/members/leave` | Everyone | Leaves the account. |

## Tokens and roles

A personal access token can only have scopes your role has, and it never does more than your role allows today. If your role changes, your tokens change with it. Tokens can't manage billing or members; those need you signed in.