# X-Hub Users, Roles and API Keys

> For AI tools: this is the Markdown copy of https://xproxy.io/document/xproxy-hub-users. Every XProxy guide has one at its URL + `.md`; the index of all guides is https://xproxy.io/llms.txt.

Add people to your X-Hub as owner, operator or viewer, create API keys for scripts, review who signed in and read the audit log of every change.

Give each person their own login with the right role, create API keys for scripts, end sign-ins you do not recognize, and read a record of every change.

**You need:** an **owner** login on a [running X-Hub](https://xproxy.io/document/xproxy-hub-setup). Only owners see **Users &amp; Access**.

## How do I manage access?

**Step 1: Open Users &amp; Access (Add a person)**

An owner opens **Users &amp; Access** under **Admin**. The **Users** tab lists everyone who can sign in. Click **Add user**. Change a role with the box, or use **Disable** to block someone without deleting them, or **Reset password**. The key explains the three roles.

![The Users tab with Add user, a role box and the role legend marked (demo data)](https://media1.xproxy.io/docs/hub/us-1-users.webp)

**Step 2: Fill in the new user (Add a person)**

Type a **Username** and a **Password** of at least 10 characters (the **Generate** button makes a strong one). Choose a **Role**, then click **Add user**. Give the password to the person over a private channel.

![The Add user window with username, password, role and the Add user button marked (demo)](https://media1.xproxy.io/docs/hub/us-2-add-user.webp)

> Everyone should have their own login, so the audit log shows who did what. Give the lowest role that does the job.

**Step 3: Open the API keys tab (Create an API key)**

Open **API keys**. Each key has a name, the start of the key, a role, when it was created, when it was last used and its status. **Create key** makes a new one. **Revoke** kills it at once.

![The API keys tab with Create key, a key row and Revoke marked (demo data)](https://media1.xproxy.io/docs/hub/us-3-keys.webp)

**Step 4: Name it and pick a role (Create an API key)**

Give the key a name that says where you use it, for example **Grafana dashboard**. Pick a role: a key never has more rights than you. Click **Create key**.

![The Create API key window with the name, the role and the Create key button marked (demo)](https://media1.xproxy.io/docs/hub/us-4-create-key.webp)

**Step 5: Copy the key now (Create an API key)**

The key starts with `xph_`. **It is shown only once.** Copy it and store it safely. Your app sends it as `Authorization: Bearer YOUR_KEY`. Then click **I saved it, close**.

![The new API key window with the key, the shown-only-once notice and the close button marked (demo, not a real key)](https://media1.xproxy.io/docs/hub/us-5-key-created.webp)

> Lost it? Revoke the key and create a new one. Owner keys cannot create users, keys or webhooks: those need you in the browser.

**Step 6: See who is signed in (Check who did what)**

The **Sessions** tab lists browsers that are signed in: user, browser, IP address, when they signed in and when they were last active. Click **Sign out** on any you do not know, or **Sign out everywhere else**. Every person can see and end their own sessions from the menu under their name.

![The Sessions tab with the signed-in browsers (demo data)](https://media1.xproxy.io/docs/hub/us-6-sessions.webp)

**Step 7: Read the audit log (Check who did what)**

The **Audit log** lists sign-ins, pairing, rotations, acknowledgements and every settings change. Each line says **who**, **what** and **where**: from the web, a key name, Telegram or an AI assistant (marked **AI**). Use the filters to find one action. Each row shows its details. X-Hub keeps 365 days.

![The Audit log with the filters and a row showing who did what (demo data)](https://media1.xproxy.io/docs/hub/us-7-audit.webp)

## What can each role do?

| Role | View | Rotate, reboot, acknowledge, add servers | Users, keys, Telegram, webhooks, remove servers |
| --- | --- | --- | --- |
| **Viewer** | Yes | No | No |
| **Operator** | Yes | Yes | No |
| **Owner** | Yes | Yes | Yes |

Telegram buttons and AI assistants follow the same roles.

## How do I change a password?

Your own: click your name in the top right, then **Change password**. Someone else's: an owner clicks **Reset password** on their row. The person is signed out everywhere and signs in again.

## FAQ

### I forgot the owner password

Another owner can reset it. If you have no other owner, turn X-Hub off in the panel with **Also delete the hub's accounts, servers and settings** and turn it on again (X-Hub on your box), or ask support for help with X-Hub on a VPS.

### Can I delete the last owner?

No. X-Hub refuses changes that would leave it without an enabled owner.

### A key leaked

Open **API keys** and click **Revoke**. It stops working at once. Check the audit log for what it did.

## What next?

Make risky changes safer.

[Passkeys →](https://xproxy.io/document/xproxy-hub-passkeys) [Troubleshooting →](https://xproxy.io/document/xproxy-hub-troubleshooting)

---

Source: https://xproxy.io/document/xproxy-hub-users
