/users/{name}/ssh-keys
0.1.0Unchanged since publicationAdd an SSH public key for a customer
usersallAdministrators, the customer's reseller and the customer can add a key. The target needs a Linux account. Administrator accounts lack one.
Supply one public key line in ssh-keygen format, with the key type, key data and an optional comment. Omit authorized_keys options. UrbeStack trims surrounding whitespace and returns 400 if key is empty or contains multiple lines. UrbeStack rejects DSA keys and validates public keys with ssh-keygen -l.
A label must contain 1 to 64 printable ASCII characters. If label is omitted or empty, UrbeStack uses up to 64 printable ASCII characters from the key comment, or the key type if the comment yields no label. Each customer can keep up to ssh_keys_max keys, which defaults to 20. A fingerprint already on that customer's list returns 409.
The response contains the added key in key. UrbeStack immediately updates the customer's file under ssh_keys_dir, /etc/urbestack/ssh/keys/<name> by default. sshd reads that file alongside the customer's .ssh/authorized_keys.
As a command
Run as root on the serverParameters
namepath ·UsernameRequiredkeystring, up to 16384 charactersRequiredlabelstring, up to 64 charactersExample
See the API overview for how to set $API and $TOKEN.curl -sS -X POST "$API/users/alice/ssh-keys" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"key": "panel.port",
"label": "my laptop"
}'201 Created{
"key": {
"created_at": "2026-09-09T10:15:00Z",
"fingerprint": "text",
"id": 1,
"key": "panel.port",
"label": "my laptop",
"type": "rebuild",
"user": "alice"
}
}Errors
12 errors, each a status and a sentence400--key-stdin is required: the key comes on standard input400--user is required400<user.name> has <n> SSH keys, the limit: remove one first400<user.name> is an administrator: administrators have no system account, so no SSH keys here400Invalid label: 1 to 64 printable ASCII characters400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter400Paste one public key, on one line400Username '<value>' is reserved400key is required: one public key, as ssh-keygen writes it401Authentication required404User '<user>' not found409This key is on the list already, as '<dup.label>'urbestack.com/docs/api/post-users-name-ssh-keys/