# Team members and roles

> Invite people to your pushq team, assign admin, member or viewer roles, and manage invites and password resets on hosted and self-hosted servers.

Source: https://pushqueue.dev/docs/guides/team-members/

People use the pushq dashboard as members of a team, and each member has a role that decides what they can do. This page covers roles, inviting and removing people, and the matching API endpoints.

How sign-in and invites work depends on where pushq runs:

| | Hosted service (console.pushqueue.dev) | Self-hosted server |
|---|---|---|
| Sign-in | A 6-digit code emailed to you, or GitHub. Signing in the first time creates your account. | Email and password. The first person creates the admin account. |
| Teams | Create as many as you like; one person can be in several and switch between them. | One team: everyone with an account on the server. |
| Data | Isolated per team: queues, tasks, stats and API keys. | Shared by everyone on the server. |
| Invites | Emailed for you. | You get a one-time link to send yourself. |
| Forgotten password | Not applicable (no passwords). | Reset link from an admin, or the `pushq users reset-password` command. |

A self-hosted server can also run like the hosted service; see [SaaS mode](https://pushqueue.dev/docs/self-hosting/saas-mode/). Everything this page says about the hosted service applies to SaaS mode too.

## Roles

| Role | Can |
|---|---|
| Admin | Everything, including team members, invites, API keys and the team name. |
| Member | Create, change, pause, resume, purge and delete queues; enqueue, run and delete tasks. |
| Viewer | Read-only: browse queues, stats, tasks and attempt history. |

The full permission table, from the server's permission checks:

| Capability | Endpoints | Admin | Member | Viewer |
|---|---|---|---|---|
| View a queue, its stats, tasks and attempts | `GET /v1/queues/{queue}`, `.../stats`, `.../tasks`, `.../tasks/{id}`, `.../attempts` | Yes | Yes | Yes |
| List and browse queues | `GET /v1/queues` | Yes | Yes | Yes |
| Create and change queues; pause, resume, purge | `POST /v1/queues`, `PUT`/`PATCH /v1/queues/{queue}`, `:pause`, `:resume`, `:purge` | Yes | Yes | No |
| Enqueue, force-run and delete tasks | `POST .../tasks`, `.../tasks:batch`, `.../tasks/{id}:run`, `DELETE .../tasks/{id}` | Yes | Yes | No |
| Delete queues | `DELETE /v1/queues/{queue}` | Yes | Yes | No |
| Manage members and invites | `/v1/users`, `/v1/invites` | Yes | No | No |
| Create and revoke API keys | `/v1/api-keys` | Yes | No | No |
| Rename the team (hosted) | `PATCH /v1/teams/current` | Yes | No | No |
| Change your own name and password | `/v1/me`, `/v1/me/password` | Yes | Yes | Yes |

A team always keeps at least one admin: the last admin can't be demoted or removed. Trying returns `400 failed_precondition` with `"the team must keep at least one admin"`.

API keys have their own two roles, `writer` and `admin`; see [API keys](https://pushqueue.dev/docs/guides/api-keys/#key-roles).

## On the hosted service

### Sign up and sign in

1. Open the [console](https://console.pushqueue.dev/).
2. Click **Continue with GitHub**, or enter your email and click **Email me a sign-in code**, then type the 6-digit code from the email. The code expires in 10 minutes; **Send a new code** sends another.
3. If this is the first time you've signed in, your account is created now. There's no separate sign-up and no password.

Sometimes a GitHub sign-in asks you to verify your email first: the console asks for a verification code that was just emailed to you. Enter it to finish signing in.

Your sign-in lasts 30 days and is extended automatically while you keep using it.

### Create a team

Queues, tasks and API keys belong to a team, so a new account starts on the **Welcome** screen:

1. Enter a team name (1–100 characters, usually your company or project).
2. Click **Create team**.

You become the team's admin and land on its (empty) queue list. To create another team later, open the account menu and choose **+ Create team**.

Use this when you want a separate workspace, for example one per company or per client, with its own queues and keys.

### Invite people

Admins invite from **Settings → Team**:

1. Under **Invite a team member**, enter their email address.
2. Pick a role: **Admin**, **Member** or **Viewer**.
3. Click **Send invite**.

We email them an invitation. The invite appears under **Pending invites** with its expiry date until they accept, and **Revoke** cancels it. To join, they accept the invitation from the email and then sign in to the console with that email address; they join with the role you picked.

### Switch teams

If you belong to several teams, open the account menu (top right). Under **Teams**, click the team you want; the console reloads its queues. The console remembers the team you used last and opens it the next time you sign in.

### Rename the team

Admins can change the name under **Settings → Team → Team name**. Everyone in the team sees it in the team switcher.

```bash
curl -X PATCH https://api.pushqueue.dev/v1/teams/current \
  -H "Authorization: Bearer $PUSHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Acme Production"}'
```

### Change a role

In **Settings → Team**, pick a new role from the dropdown next to the member. It applies to their next request.

### Remove a member

Click **Remove** next to the member and confirm. They lose access to this team immediately, but keep their pushq account and any other teams they belong to. You can invite them again later.

## On a self-hosted server

### First-time setup

When you first open the dashboard of a new server (at `/`, for example `http://localhost:8080/`), it asks you to create the admin account:

1. Enter your name, email and a password (at least 8 characters).
2. If the server has `api_keys` in its config, also enter one of its **admin** keys. This stops whoever reaches the dashboard first from claiming a protected server.
3. Click **Create admin account**.

:::caution
Until the first account exists, a server without config-file API keys accepts anonymous requests with full access. Create the admin account before exposing the server, and serve the dashboard over HTTPS.
:::

From then on, the API needs either a dashboard session or an API key. Create keys for your apps under **Settings → API keys** (see [API keys](https://pushqueue.dev/docs/guides/api-keys/)).

`pushq dev` turns authentication off entirely, so none of this applies to it.

### Invite people with a link

pushq doesn't send email on a self-hosted server. Instead:

1. In **Settings → Team**, enter the person's email, pick a role and click **Create invite link**.
2. Copy the link from the dialog (it looks like `https://pushq.example.com/invite#token=pqi_...`) and send it to them however you like.
3. They open it, enter their name and choose a password, and click **Create account**. They're signed in straight away.

Each link works once and expires after 7 days. Creating a new invite for the same email replaces the previous link. You can't invite an email that already has an account (`409 already_exists`). Pending invites are listed on the Team page, where **Revoke** cancels them.

### Change roles and remove people

Use the role dropdown and **Remove** button on **Settings → Team**. Removing someone deletes their account and signs them out everywhere.

### Reset a password

Admins can make a reset link from **Settings → Team**: click **Reset password** next to the person and send them the link. It works once, expires after 24 hours, and signs them out on every device once they set the new password. Making a new link replaces the previous one.

People can change their own password under **Settings → Your account**; that signs them out on their other devices.

If nobody can sign in (for example, the only admin forgot their password), run this on the server. It works directly on the database, so the server doesn't have to be reachable:

```bash
pushq users reset-password you@example.com -c /etc/pushq/pushq.yaml --url https://pushq.example.com
```

| Flag | Default | Description |
|---|---|---|
| `-c`, `--config` | none | The server's config file, used to find the database. |
| `--db` | from config | Database URL (`sqlite:PATH` or `postgres://...`), overriding the config. |
| `--url` | `http://localhost:8080` | Public URL of the server, used to build the printed link. |

It prints a one-time link valid for 24 hours. `pushq users list` lists every account with its role and last sign-in.

## API reference

### Which credentials each endpoint accepts

| Endpoints | Admin API key | Signed-in dashboard user |
|---|---|---|
| `/v1/users`, `/v1/invites`, `PATCH /v1/teams/current` | Yes | Admins only |
| `PATCH /v1/me`, `POST /v1/me/password` | No | Any role |
| `GET /v1/teams`, `POST /v1/teams`, `POST /v1/teams/{id}:switch` | No | Any role (hosted / SaaS mode only) |
| `/v1/auth/*` | No credentials needed | |

Session-only endpoints use the `pushq_session` cookie that sign-in sets; the console calls them for you. If you call them yourself with the cookie, `POST`, `PATCH` and `DELETE` requests must also send an `X-Requested-With` header (any value), or they're rejected with `403`.

On the hosted service, an admin API key acts on the team it belongs to. Invites it sends have no inviting user.

### User object

| Field | Type | Description |
|---|---|---|
| `id` | integer | Use it in `/v1/users/{id}`. |
| `email` | string | |
| `name` | string | May be empty. |
| `role` | string | `admin`, `member` or `viewer`. On the hosted service, the role in the current team. |
| `created_at` | string (date-time) | |
| `last_login_at` | string (date-time) | Omitted if they never signed in. |

### Invite object

| Field | Type | Description |
|---|---|---|
| `id` | integer | Use it in `DELETE /v1/invites/{id}`. |
| `kind` | string | `invite` (new member) or `reset` (password reset link). |
| `email` | string | |
| `role` | string | The role they'll get. Omitted for reset links. |
| `created_at` | string (date-time) | |
| `expires_at` | string (date-time) | |

### List members

`GET /v1/users` returns `{"users": [User, ...]}`. Self-hosted: every account, sorted by email. Hosted: the current team's members.

```bash
curl https://api.pushqueue.dev/v1/users \
  -H "Authorization: Bearer $PUSHQ_API_KEY"
```

```json
{
  "users": [
    {
      "id": 7,
      "email": "ada@example.com",
      "name": "Ada",
      "role": "admin",
      "created_at": "2026-10-01T09:00:00Z",
      "last_login_at": "2026-11-28T08:30:00Z"
    }
  ]
}
```

### Change a member

`PATCH /v1/users/{id}` returns the updated User.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `role` | string | unchanged | `admin`, `member` or `viewer`. The last admin can't be demoted. |
| `name` | string | unchanged | Self-hosted only, at most 100 characters. On the hosted service names come from the person's sign-in, and only `role` can be changed. |

```bash
curl -X PATCH https://api.pushqueue.dev/v1/users/12 \
  -H "Authorization: Bearer $PUSHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"role": "viewer"}'
```

### Remove a member

`DELETE /v1/users/{id}` returns `204`. They lose access immediately. The last admin can't be removed.

### Create a password-reset link (self-hosted)

`POST /v1/users/{id}/reset-link` returns `201`:

| Field | Type | Description |
|---|---|---|
| `link` | Invite | The reset link's details (`kind` is `reset`). |
| `path` | string | The single-use link relative to the server, e.g. `/invite#token=pqi_...`. Prefix it with your server's URL. |

Returns `404` on the hosted service.

### List pending invites

`GET /v1/invites` returns `{"invites": [Invite, ...]}`: unexpired, unaccepted invites, newest first.

### Invite someone

`POST /v1/invites`

| Parameter | Type | Default | Description |
|---|---|---|---|
| `email` | string | required | Who to invite. |
| `role` | string | required | `admin`, `member` or `viewer`. |

```bash
curl -X POST https://api.pushqueue.dev/v1/invites \
  -H "Authorization: Bearer $PUSHQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email": "grace@example.com", "role": "member"}'
```

Response, `201 Created`:

| Field | Type | Description |
|---|---|---|
| `invite` | Invite | The new invite. |
| `emailed` | boolean | Hosted: `true`, the invitation was emailed. |
| `path` | string | Self-hosted: the invite link to send, relative to the server (`/invite#token=pqi_...`). |

### Revoke an invite

`DELETE /v1/invites/{id}` returns `204`, or `404` if there's no such pending invite.

### Your own account

`PATCH /v1/me` with `{"name": "..."}` (at most 100 characters) changes your name and returns your User.

`POST /v1/me/password` (self-hosted only) changes your password and returns `204`. Your other sessions are signed out.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `current_password` | string | required | Your current password. |
| `new_password` | string | required | At least 8 characters, at most 256 bytes. |

### Teams (hosted / SaaS mode)

A Team object has `id` (integer), `name` (string) and `role` (your role in it).

| Endpoint | Body | Response |
|---|---|---|
| `GET /v1/teams` | none | `{"teams": [Team, ...]}`, the teams you belong to. |
| `POST /v1/teams` | `{"name": "..."}`, 1–100 characters | `201` Team. You become its admin and your session switches to it. |
| `POST /v1/teams/{id}:switch` | none | `204`. Your session now works in that team. `404` if you're not a member. |
| `PATCH /v1/teams/current` | `{"name": "..."}`, 1–100 characters | `200` Team. Admins only. |

On a self-hosted server without SaaS mode these return `404`.

### Sign-in endpoints

The dashboard uses these; you rarely need them directly. None need credentials.

| Endpoint | Where | What it does |
|---|---|---|
| `GET /v1/auth/session` | Both | Who you are and how this server signs people in (see below). |
| `POST /v1/auth/setup` | Self-hosted | Create the first admin. Body: `email`, `name`, `password`, and `api_key` (an admin config key, required when the server has config keys). Only works while no account exists. |
| `POST /v1/auth/login` | Self-hosted | Body: `email`, `password`. Sets the session cookie. |
| `POST /v1/auth/logout` | Both | Ends the session. `204`. |
| `GET /v1/auth/invites/{token}` | Self-hosted | Look up an invite or reset link without using it. Returns an Invite. |
| `POST /v1/auth/invites/{token}:accept` | Self-hosted | Body: `name`, `password`. Creates the account (invite) or sets the password (reset) and signs in. |
| `POST /v1/auth/email-code` | Hosted | Body: `email`. Emails a 6-digit code. Returns `{"sent": true}`. |
| `POST /v1/auth/email-code:verify` | Hosted | Body: `email`, `code`. Signs in. |
| `GET /v1/auth/workos/login?provider=github` | Hosted | Starts GitHub sign-in (browser redirect). |

Password, setup, invite-accept and email-code endpoints are rate limited per client IP (10 attempts, then one more every 6 seconds); over the limit they return `429 rate_limited`.

`GET /v1/auth/session` returns:

| Field | Type | Description |
|---|---|---|
| `mode` | string | `saas` (hosted / SaaS mode), `locked` (sign-in required), `open` (self-hosted with no accounts or config keys yet) or `dev` (authentication off). |
| `authenticated` | boolean | Whether the request carried valid credentials. |
| `kind` | string | `user`, `api_key` or `open`. |
| `role` | string | Your role (or the key's role). |
| `user` | User | When signed in as a person. |
| `key_name` | string | When authenticated with an API key. |
| `permissions` | object | `read`, `list`, `write`, `delete_queue`, `manage` booleans. |
| `setup_required` | boolean | Self-hosted: no account exists yet. |
| `setup_requires_key` | boolean | Self-hosted: setup needs an admin config key. |
| `sso_providers` | array | `["workos"]` in hosted / SaaS mode. |
| `team` | Team | Hosted: the team this session works in. |
| `teams` | array | Hosted: all your teams. |
| `needs_team` | boolean | Hosted: you must create or pick a team first. |
