ServerAvatarDocs
API Reference

System users and SSH keys API

Create and manage the Linux accounts that own sites, their passwords, shells, sudo and SSH access, and add or remove SSH keys on one or many accounts through the OSS Panel API.

These endpoints are the API behind System Users in the panel's sidebar. A system user is a Linux account on the server. Every application is owned by one, and you can also create accounts for people who need SSH or SFTP access.

All paths are relative to https://<your-panel-host>/api. Read Authentication first. The examples use:

PANEL=https://panel.example.com
TOKEN='1|xcMq8K3vZ2pL…'

Permissions

Every endpoint here needs the system_user permission (System Users in Roles). Reading needs view; every endpoint marked manage needs manage, which implies view.

A caller with only view never receives a plaintext password: the password field is null for them, and password_known still says whether one is set.

Endpoint index

MethodPathPermissionLimit per minutePurpose
GET/system-usersviewsharedList accounts.
POST/system-usersmanagesharedCreate an account.
GET/system-users/shellsviewsharedThe shells you can pick.
GET/system-users/{systemUser}viewsharedOne account.
DELETE/system-users/{systemUser}managesharedDelete one.
DELETE/system-usersmanage6Delete several.
PUT/system-users/{systemUser}/passwordmanagesharedSet the password.
PUT/system-users/{systemUser}/shellmanagesharedChange the shell.
PUT/system-users/{systemUser}/sshmanagesharedAllow or refuse SSH sign-in.
PUT/system-users/{systemUser}/sudomanagesharedGive or take away sudo.
GET/system-users/{systemUser}/ssh-keysviewsharedKeys on one account.
POST/system-users/{systemUser}/ssh-keysmanagesharedAdd a key to one account.
DELETE/system-users/{systemUser}/ssh-keys/{sshKey}managesharedRemove a key from one account.
GET/ssh-keysviewsharedKeys across all accounts.
POST/ssh-keys/deploymanage30Add one key to several accounts.
DELETE/ssh-keysmanage30Remove a key from several accounts.

The per-minute limits sit on top of the shared budget (see Rate limits). {systemUser} and {sshKey} are numeric ids. A key that is not on that account answers 404.

Accounts

GET /system-users

QueryRules
searchUp to 255 characters; matches the username.
sortcreated_at or username; - for descending.
page, per_pageper_page is one of 10, 20, 30, 50, 100.
curl "$PANEL/api/system-users?sort=username" \
  -H "Authorization: Bearer $TOKEN" -H 'Accept: application/json'
{
  "system_users": [
    {
      "id": 2,
      "username": "shop",
      "home_path": "/home/shop",
      "shell": "/bin/bash",
      "shell_title": "Bash",
      "shell_allows_login": true,
      "sudo": false,
      "ssh_access": true,
      "container_login": false,
      "password": null,
      "password_known": true,
      "applications": [
        { "id": 12, "name": "shop", "domain": "shop.example.com" }
      ],
      "created_at": "02-11-2026 09:14:03"
    }
  ],
  "meta": { "current_page": 1, "per_page": 10, "total": 1, "last_page": 1 }
}

GET /system-users/{systemUser}

Returns {"system_user": { … }, "meta": {"ssh_access_enforced": true|false}}. ssh_access_enforced tells you whether the server actually applies the per-account SSH switch.

POST /system-users

Answers 201 with {"system_user": { … }}.

FieldRules
usernameRequired: starts with a lower case letter or _, then lower case letters, digits, _ or -; 1 to 32 characters in all; not already used; not a reserved name.
passwordOptional. At least 10 characters with upper and lower case and a number.
public_keyOptional: an SSH public key to add to the account.
shellOptional: /bin/bash, /bin/sh, /usr/bin/zsh, /usr/sbin/nologin or /bin/false, and installed on the server (see /system-users/shells).
sudoOptional boolean.
ssh_accessOptional boolean.

Reserved names: root, daemon, bin, sys, sync, games, man, lp, mail, news, uucp, proxy, www-data, backup, list, irc, gnats, nobody, systemd-network, mysql, postgres, mongodb, redis, ubuntu, admin and sshd.

curl -X POST "$PANEL/api/system-users" \
  -H "Authorization: Bearer $TOKEN" -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{"username": "deploy", "ssh_access": true, "public_key": "ssh-ed25519 AAAA… ci@example.com"}'

GET /system-users/shells

Returns {"shells": [ … ]}: the shells installed on the server.

PUT /system-users/{systemUser}/password

Body {"password": "…"}: at least 10 characters with upper and lower case and a number, with no control characters. Answers 204.

PUT /system-users/{systemUser}/shell

Body {"shell": "/bin/bash"}: one of the shells above that is installed. Returns {"system_user": { … }}.

PUT /system-users/{systemUser}/ssh

Body {"ssh_access": true} (required boolean). Returns {"system_user": { … }}.

PUT /system-users/{systemUser}/sudo

Body {"sudo": true} (required boolean). Returns {"system_user": { … }}.

DELETE /system-users/{systemUser}

Deletes the account and its home folder. Optional body end_sessions (boolean): end the account's running processes first. Answers 204.

Refused with 422 when an application still belongs to the account (on system_user), and when the account has running processes and you did not ask to end them.

DELETE /system-users

Body:

FieldRules
idsRequired array of 1 to 50 distinct existing ids.
end_sessionsOptional boolean, as for one account.

Returns {"deleted": true|false, …} with the ids that failed and why.

SSH keys on one account

GET /system-users/{systemUser}/ssh-keys

Returns {"ssh_keys": [ … ]}, newest first. A key has id, name, fingerprint, type, system_user and timestamps.

POST /system-users/{systemUser}/ssh-keys

FieldRules
nameRequired, up to 255 characters.
public_keyRequired: a valid SSH public key line.

Answers 201 with {"ssh_key": { … }, "existing": false}. If the account already has that key you get 200 with "existing": true and a message.

DELETE /system-users/{systemUser}/ssh-keys/{sshKey}

Answers 204.

SSH keys across accounts

GET /ssh-keys

Optional filters fingerprint and system_user_id. Returns {"ssh_keys": [ … ]} for all accounts, ordered by account.

POST /ssh-keys/deploy

Adds one key to several accounts.

FieldRules
nameRequired, up to 255 characters.
public_keyRequired, a valid SSH public key.
system_user_idsRequired array of 1 to 100 distinct existing ids.
{
  "results": [
    {
      "system_user": { "id": 2, "username": "shop" },
      "status": "added",
      "ssh_key_id": 7,
      "warnings": []
    }
  ],
  "warnings": []
}

status is added, existing or failed (with a reference). A per-account warning ssh_access_off means the key was added but that account is not allowed to sign in over SSH; the top-level warning ssh_port_closed means the server's firewall has the SSH port closed.

DELETE /ssh-keys

Removes a key from several accounts.

FieldRules
fingerprintRequired: SHA256: followed by 43 characters.
system_user_idsOptional array of 1 to 100 distinct ids. Leave out to remove the key everywhere.

Returns {"results": [ … ]}, one row per account with status removed or failed (with a reference).

Common errors

StatusMessage or cause
403Your role does not include management for System Users.
404Unknown account or key.
422Validation ({"message", "errors": {"field": ["…"]}}), including an account that still owns an application.
429Over a limit; wait for Retry-After.
500{"message", "reference"}: find the reference in the error log.

On this page