# Accounts and teams

> Signing in to the console, organizations, roles and invitations.

Everything belongs to an **organization**. People sign in to the console as **users** and belong to one or more organizations. Programs use **API tokens**, which belong to one organization.

## Signing in

The console offers **Continue with GitHub** and **email sign-in links**. A link works once and expires after 15 minutes. While Elefork is invite-only, an account can only be created for an email address that has a pending invitation.

The session lasts 7 days. It is an HttpOnly cookie, so page scripts cannot read it.

## Roles

| Role | Can |
|---|---|
| `member` | Work with projects, branches, checkpoints and credentials; see usage and members; leave |
| `admin` | Everything a member can, plus invite and remove members (not owners) and manage API tokens |
| `owner` | Everything, including inviting owners and removing other owners |

An organization always keeps at least one owner. API tokens act with admin rights in their organization.

## Invitations

Owners and admins invite people by email from **Members** (or `POST /v1/orgs/{id}/invitations`). The invitation link is valid for 7 days. It can only be accepted by a signed-in user with **the same email address**. A new user can sign in first with that address and accept the invitation right away.

## Organizations in the API

API tokens imply their organization. Console sessions name the organization with the `Elefork-Org` header; asking for an organization you do not belong to answers `404`, the same as for something that does not exist.
