# Custom roles and permissions

Every member of an organization has exactly one role. Three roles are built in (owner, admin, member). The owner can add up to 10 custom roles of their own, each with the permissions they pick. See [Teams and roles](/docs/teams-and-roles) for inviting people.

## What a permission lets you do

| Permission | What it allows |
| --- | --- |
| View servers | See servers, deployments, logs and usage. |
| Deploy servers | Launch new servers and create storage volumes. |
| Manage servers | Start, stop, restart and rename servers. |
| File tools and recreate | Use the file tools on stopped servers and recreate servers. |
| Destroy servers | Destroy and redeploy servers. This deletes their disk. |
| Manage templates | Create, edit and delete the organization's templates. |
| Manage endpoints | Create, edit, pause and delete serverless endpoints. |
| Manage storage | Delete storage volumes. |
| Manage SSH keys | Add SSH keys and attach them to servers. |
| Manage secrets | Create, replace and delete secrets. |
| Manage API keys | Create and revoke API keys. |
| Manage webhooks | Create, edit and test webhook endpoints and notification channels. |
| Manage automation | Set automatic stop and destroy rules on servers, and manage server groups (groups also need Deploy servers to create and Destroy servers to delete, and are not open to the built-in member role). |
| View billing | See the balance, invoices, usage and transactions. |
| Add credit | Top up the prepaid balance. |
| Manage billing | Change billing details, cards, budgets and promo codes. |
| Manage the team | Invite and remove members and change their roles, within your own permissions. |
| Manage settings | Edit the organization's name and settings. |
| View activity | See the organization's activity log. |



Some permissions include others they depend on. Choosing "Manage billing" also selects "View billing" and "Add credit"; choosing any server permission also selects "View servers".

## The built-in roles

- **Owner** and **admin** have every permission above. The owner also closes the organization, transfers ownership, changes the monthly plan and manages custom roles. There is always exactly one owner.
- **Member** can view servers, deploy, start, stop, restart and rename them, manage SSH keys and automation, see billing and add credit. A member runs commands on, recreates and schedules a destroy for only the servers they launched, and deletes only their own SSH keys.

The built-in roles behave as they always did. Custom roles are an addition.

## Create a custom role

Only the owner can do this.

1. Open **Team** and select the **Roles** tab, then **New role**.
2. Give the role a name and, if you like, a description. The names owner, admin and member are reserved.
3. Tick the permissions. A custom role can never hold more than the admin role.
4. Select **Create role**.

Editing a role changes what its members can do on their next request. You cannot delete a role while a member or a pending invitation still holds it: move them to another role first.

## Give a role to people

Choose the role in the invite dialog, or in the role selector on the member's row. The info icon next to a role shows what it can do.

- A member holds one role at a time. The owner's role never changes except by transferring ownership.
- Anyone who can manage the team can only hand out a role whose permissions they hold themselves, and cannot change or remove someone who can do more than they can. This keeps anyone from gaining power through someone else.
- Email addresses: by default every member sees everyone's address on the **Team** page and in `GET /api/v1/team/members`. The owner can turn off **Members can see each other's email addresses** on that page. Members who cannot manage the team, and every `read` or `servers` API key, then see names and roles only; everyone still sees their own address.

## API keys

A key can do what its creator can do right now, and no more than its scope allows. If you change the creator's role, the key follows on its next call. If the creator is removed, the key falls back to member access.

`GET /api/v1/team/roles` lists the roles and their permissions (it needs the Manage the team permission), and `GET /api/v1/team/members` shows each member's role. `GET /api/v1/me` lists what the calling key may do. See the [API reference](/docs/api-reference).

## Spending limit per member

An owner, or an admin who can manage billing, can give a member a monthly spending limit: open the member's menu on the **Team** page and choose **Spending limit**. It counts the usage charges this UTC month of the servers the member launched, from the console or with any API key. At the limit their new servers and the starts of their stopped servers are refused until the limit is raised or the month ends. Servers already running keep running, and workers that a serverless endpoint or server group starts by itself are not affected. Only an owner can change their own limit. The CLI: `apidly team limit USER_ID 200`; the API: `PUT /api/v1/team/members/{userId}/spending-limit`.

Who can change a limit: someone with both the **Manage the team** and **Manage billing** permissions (owners and admins have both; a custom role needs both). Only the owner can set or remove the owner's limit. You cannot change your own limit unless you are the owner, so a member or admin with a limit cannot lift it alone. You also cannot change the limit of someone whose role allows something yours does not.

The month starts at 00:00 UTC on the first day, so the limit resets at the same moment everywhere. The disk storage of the member's servers counts as well, also while they are stopped. A limit is between $0.01 and $1,000,000, and the **This month** column on the **Team** page shows what each member has used so far. At the limit their launches and starts answer `403 member_limit_reached`. Unlike the limit of an API key, no email is sent.

## The activity log

Creating, editing and deleting a role, changing a member's role and inviting someone with a role all appear in the activity log (Settings, Activity).
