Users, permissions and API keys
This page explains how to manage access to PxVault: create user accounts, give them rights (permissions), restrict them to certain hypervisors or VPCs, create API keys for your scripts, and manage passwords and two-factor authentication (2FA).
The relevant pages are Users and API Keys in the side menu (visible only if you have the matching permission), and My Account, which you open by clicking your name at the bottom of the menu.
Understanding roles: administrator or user
Each account is either:
- Administrator: the "Admin (full access)" option is enabled. It has all rights, on all resources, with no scope restriction.
- User: it only has the permissions checked in its permission matrix, possibly limited to certain resources (scope).
The first account created during installation is an administrator. It is also the application owner (Owner badge in the list): only this account can change the step-up 2FA policy (see Sensitive actions and step-up 2FA).
Transferring application ownership
The owner cannot be deleted, demoted or disabled (the delete button is grayed out on its row). To hand this role to another account, the owner clicks Transfer ownership (crown icon) on the row of another active administrator, then confirms with their 2FA code. They remain an administrator, but are no longer the owner. Through the API: POST /api/users/{id}/transfer-ownership, restricted to the signed-in owner (an API key is refused).
An administrator can always reset the owner's 2FA (Reset 2FA), as for any other account.
Creating a user
- Open Users in the menu.
- Click New user.
- Fill in the fields (table below).
- Check the permissions you want in the matrix, or enable Admin (full access).
- If needed, limit access to certain resources (see Restricting a user to certain hypervisors).
- Click Create user.
| Field | Description |
|---|---|
| Username | 3 to 32 characters: letters, digits, ., _, -. Must be unique. |
| Email (optional) | Required for email 2FA and for "Forgot password" by email. |
| Password | At least 10 characters. The Generate 32 chars link creates a random password and copies it to the clipboard. |
| Admin (full access) | Grants all permissions and bypasses the matrix. |
| Permissions | Resource × action matrix (hidden if Admin is enabled). |
| Restrict to specific resources (optional) | Scope: allowed hypervisors, VPCs, IP pools, etc. (hidden if Admin is enabled). |
Send the password to the user through a secure channel. At first sign-in, they will have to choose their sign-in method (authenticator app, email code or password only) on the Secure your account screen. See also Getting started.
Editing, disabling or deleting a user
In Users, the list shows for each account its role, 2FA state (2FA on / 2FA off), status (Active / Disabled) and number of permissions. The search field filters by ID, username or email.
Edit: click Edit on the account's row, change what you need, then Save changes. You can change the name, email, role, permissions and scope.
Resetting a user's password: in the same window, fill in Reset password (optional) (leave blank to keep the current one), then save. The old password is not required.
Good to know: a reset by an administrator closes all sessions already open for the user, on all their devices: they must sign in again with the new password. Their API keys, however, keep working. To cut off API keys too, disable the account.
Disabling an account: in Edit, turn off the Active switch. Disabled users can no longer sign in, their open sessions are closed immediately and their API keys are revoked. The account and its settings are kept: re-enable it the same way.
Deleting an account: click Delete, then confirm in the Delete user? window (you may be asked for a 2FA code). Deletion is permanent. API keys created by this account stop working; the history of its actions is kept.
Important: you cannot delete your own account, nor delete, disable or remove the administrator role from the last active administrator. Always keep at least two administrators.
Permissions (rights)
A permission is written resource:action, for example vms:read or hypervisors:admin. In the matrix, each row is a resource and each column an action.
| Action (column) | Code | What it allows |
|---|---|---|
| Create | create |
Create new items |
| Read | read |
View / list items |
| Update | update |
Modify existing items |
| Delete | delete |
Delete items |
| VM protection | protect |
Protect / unprotect against deletion |
| Admin | admin |
Privileged operations (start/stop, apply, synchronization, revealing secrets, etc.); includes all the other actions |
| Resource (row) | Code | Resource (row) | Code |
|---|---|---|---|
| Hypervisors | hypervisors |
Blueprints | blueprints |
| Virtual machines (KVM) | vms |
Recipes | recipes |
| Containers (LXC) | containers |
Scheduler | scheduler |
| Templates | templates |
Alerts | alerts |
| Packer builds | packer |
Automation scripts | automation |
| IPAM | ipam |
Users | users |
| Firewall | firewall |
API tokens | apiTokens |
| Datacenters | datacenter |
Settings | settings |
| Network | network |
Logs | logs |
| VPC / Tenant networks | vpc |
Supervision & stats | stats |
| FinOps & Billing | finops |
Search | search |
Automatic rules to know:
- Admin on a resource gives all actions on that resource.
- Create, Update or Delete automatically give Read on the same resource.
- Some read rights imply others so that pages work (for example, reading VMs also gives read access to hypervisors, templates, IPAM and recipes). These boxes appear grayed out and cannot be unchecked.
- The
statsresource (global supervision pages) is never granted automatically: check it explicitly.
The Read-only button above the matrix checks read on all resources; Clear unchecks everything.
Each user can view their own rights in My Account, section Your permissions.
Restricting a user to certain hypervisors
On top of permissions, you can limit an account (or an API key) to specific resources: this is the scope. You set it in the Restrict to specific resources (optional) section of the create or edit window.
Available dimensions (each one appears only if the account has the matching read right):
| Dimension | Effect |
|---|---|
| Specific machines | Specific VMs/containers. If machines are chosen, only these are allowed (this replaces the per-hypervisor scope). |
| Hypervisors | Allowed hypervisors; also limits the visible VMs and containers. |
| Datacenters | Allowed datacenters. |
| IP pools | Allowed IPAM pools. |
| VPC | Allowed tenant networks, for example a customer's VPCs. |
Warning: as long as nothing is checked, there is no restriction ("All (unrestricted)"). As soon as you check a single item, the scope becomes active and any dimension left empty means None. Use Select all on a dimension to allow everything in it.
Example: to limit a user to the hypervisor "pve-client-a" and its IP pool, check that hypervisor in Hypervisors and that pool in IP pools. The VPCs, left unchecked, will then not be accessible to them.
Administrators ignore the scope.
Delegation rule: you cannot give more than you have
A user who has the right to manage accounts (users:create, users:update) or create API keys (apiTokens:create) without being an administrator is limited:
- only an administrator can create or promote an administrator, or create an API key with Full access;
- you cannot grant a permission you do not have yourself;
- if you are restricted to a scope, you cannot grant a scope wider than yours;
- you cannot edit, reset or delete an account that outranks you: an administrator, an account with a permission you do not have, or, if you are restricted to a scope, an account whose scope is not included in yours (an account with no scope, which sees everything, is one of them).
In these cases, the action is refused with an error message (403).
Creating an API key
An API key (or API token) lets a script, a server or a CI tool use the PxVault API without going through the sign-in page.
- Open API Keys in the menu.
- In Create API Token, enter a Token name (optional).
- Set Expires in days (blank = never): the field is prefilled with API Token Expiration from Settings > Security (90 days out of the box), 3650 at most. Clear it for a key that never expires. A key created through the API without
expiresInDaysalso gets this default duration (expiresInDays: null= never). - Expand Security & Scope Restrictions (Show details link) to choose the rights:
- Full access (enabled by default, administrators only): the key has all rights;
- otherwise, turn it off and check the permissions you want in the matrix (at least one);
- Restrict to specific instances (optional): same principle as a user's scope. It also applies to a full-access key.
- If a 2FA code is requested, enter it.
- Click Create Token.
- Copy the key immediately with Copy.
Important: the key is shown only once. PxVault keeps only a hash of it: it cannot be retrieved later, neither by you nor by support. If you lost it, revoke it and create a new one.
Tip: prefer keys limited to what is strictly necessary. A key that only reads the inventory needs only
readpermissions.
Who owns an API key
A key belongs to the account that created it. When another API key creates it (through the API, with apiTokens:create), the new key belongs to the same account as the key that created it. Disabling or deleting that account therefore revokes the whole family of keys at once.
Only exception: an old key without an owner (created before accounts existed) creates keys that also have no owner. No account deactivation reaches them: revoke them explicitly.
Warning: keys created by another key before this fix have no owner and survive the deactivation of the original account. Find them in the audit log (action
api.token.createdwhose actor is an API key) and revoke them, then recreate them if needed.
Using an API key
Send the key in the X-API-Key header (or Authorization: Bearer). Example to list virtual machines (requires vms:read or containers:read):
curl -H "X-API-Key: VOTRE_CLE" https://pxvault.example.com/api/vms
# equivalent
curl -H "Authorization: Bearer VOTRE_CLE" https://pxvault.example.com/api/vms
API keys are never subject to step-up 2FA. Never put a key in code that runs in a browser. To go further (jobs, pagination, errors, OpenAPI documentation on /docs), see the headless API guide.
Revoking an API key
In Existing Tokens, click Revoke on the key's row, then confirm. Revocation is immediate and permanent; the row stays visible with the revoked/expired status for the record. The list never shows the full key, only a Hint to recognize it.
A non-administrator can revoke neither a full-access key nor another user's key. The rule also applies to an API key without full access: it acts on behalf of its owner, and therefore only revokes that owner's keys (and old keys without an owner).
Deleting revoked or expired keys
A revoked or expired key no longer works, but its row stays in Existing Tokens. To clean up:
- a single key: on its row (status revoked/expired), click Delete, then confirm in Delete API token?;
- all at once: at the top of the page, click Delete revoked keys, then confirm in Delete revoked and expired API tokens?.
Deletion is permanent, but never touches an active key (revoke it first). The audit history is kept: entries that mention the key remain, and the deletion adds an api.token.purged entry. A 2FA code may be requested (same setting as revocation). The same limits apply as for revocation: a non-administrator deletes neither a full-access key nor another user's key.
Through the API: DELETE /api/api-tokens/{id}?purge=true for one key, POST /api/api-tokens/purge for all of them (1,000 at most per call; complete: false means some remain).
My Account: changing your password and managing 2FA
Click your name at the bottom of the side menu to open My Account.
Changing your password
- In the Change password section, enter the Current password.
- Enter the New password (at least 10 characters) and confirm it.
- Confirm with Change password.
Changing your sign-in method (2FA)
The Sign-in method section offers three choices (labels shown in English):
| Method | How it works |
|---|---|
| Authenticator app | 6-digit code from an app (Google Authenticator or equivalent). You scan a QR code, then verify a code. |
| Email code | One-time code sent by email at each sign-in. Requires an email address on your account and a configured SMTP server. |
| Password only | No second factor; sensitive actions ask for your password again. |
Click the method you want, then confirm in the Change your sign-in method window with your current code. Your email address cannot be changed from this page: ask an administrator to fill it in.
Important: if your installation makes 2FA mandatory, the "Password only" choice is refused.
Resetting a user's 2FA
If a user lost their phone or their authenticator app:
- Open Users, then Edit on their account.
- Click Reset 2FA (button visible only if their 2FA is active).
- Confirm in Reset 2FA? (your own 2FA code may be requested).
At their next sign-in, the user signs in with their password and must set up a new method on the Secure your account screen. This action requires the users:update permission and is recorded in the audit log.
Forgot password
On the sign-in page, click Forgot password?. Two methods are offered:
- With 2FA code: enter your username, the 6-digit code from your authenticator app and a new password, then Reset password. No email is needed, but this only works if your account uses an authenticator app.
- By email: enter your username or email, then Send reset link. You receive a link to the Set a new password page. The link is single-use and valid for 30 minutes by default (Reset Link Validity setting in Settings > Security).
Important: email reset only works if the SMTP server is configured (Settings > Notifications) and the
APP_URLenvironment variable is set to the public address of PxVault. The message shown is deliberately the same whether or not the account exists; if in doubt, check the audit log.
If none of these methods is possible, ask an administrator to reset your password (see Editing, disabling or deleting a user).
Account locked after several failures
After 5 wrong passwords from the same IP address, sign-in to that account is blocked for that address for 15 minutes. The whole account is locked only after ten times as many failures, coming from several addresses. These thresholds are set in Settings > Security (Max Login Failures, Lockout Duration). Just wait for the delay to end.
Sensitive actions and step-up 2FA
Some actions ask you to confirm your identity again, even if you are already signed in: a code field appears in the confirmation window. Enter the code from your app or received by email, or your password if your account is set to "Password only".
Actions concerned (all enabled by default): delete a hypervisor, delete a VM or a container, reveal a VM's credentials, reveal a public console link, create or revoke an API key, delete a user, reset a user's 2FA, purge logs.
They are set in Settings > Security, card Step-up 2FA for critical actions. Only the application owner (the first account created, unless ownership was transferred) can change them, and each change requires their 2FA code. API keys are never concerned.