> ## Documentation Index
> Fetch the complete documentation index at: https://docs.styne.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Organizations

> Add members to one account and give each a role.

An organization is an account with more than one member. There is no second wallet: the account's plan, hours included, keys
and sandboxes belong to the account, and every member works in it with the role you give them.

## Roles

| Role | Keys | Sandboxes and logs | Billing | Members | Audit log |
| - | - | - | - | - | - |
| Owner | read, write | yes | yes | manage, transfer | yes |
| Admin | read, write | yes | yes | manage (not other admins) | yes |
| Developer | read, write | yes | no | view | no |
| Billing | no | usage only | yes | view | no |
| Viewer | read | read | no | view | no |

One owner per account. Ownership moves only by transfer.

## Invite a person

```text theme={"theme":"css-variables"}
POST /v1/invites          { "email": "name@company.com", "role": "developer" }
```

They get an email with a link that works once for 7 days. They sign in, or sign up, with that address and accept. Until then the invite
shows in `GET /v1/members`; `DELETE /v1/invites/{id}` withdraws it. Only the owner invites an admin.

## Work with members

```text theme={"theme":"css-variables"}
GET    /v1/members                       members and, for owner and admin, open invites
PATCH  /v1/members/{user_id}             { "role": "viewer" }
DELETE /v1/members/{user_id}             remove a member, or leave (your own id)
POST   /v1/account/transfer-ownership    { "user_id": "..." }
GET    /v1/audit-log                     who changed what
```

Changes to members need a recent sign-in with a second factor if the account has one. The dashboard does all of this on the **Team**
page.

A member can belong to several accounts and switches between them in the dashboard.

## Shared sandboxes

A sandbox belongs to the account, not to the person who started it. Everyone with a role that reads sandboxes sees the same list, and
the audit log records who started, paused or stopped each one. Removing a member never stops or deletes a sandbox.

## Member spend caps

An owner or admin can cap what one member's API keys may spend in a month:

```text theme={"theme":"css-variables"}
PUT /v1/members/{user_id}/cap     { "monthly_spend_cap_micro": 25000000 }    # null removes the cap
```

The cap applies to keys the member creates afterwards: a key with no cap of its own gets the member's cap, and a higher cap is lowered
to it. Keys the member already holds keep their own cap. `GET /v1/members` shows each member's cap. The
account balance is shared; a cap only limits how much of it one member's keys can use.

## Removing a member

`DELETE /v1/members/{user_id}` also revokes every live API key that member created in this account and drops their
cap. The answer carries `keys_revoked`. Their sandboxes stay with the account and keep running.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.