hosting

POST /v1/sites/{siteId}/ftp-users/{ftpUserId}/keys

Add another key to a site's SFTP login.

All hosting endpoints

All developer docs →

Zinn®, our Viking, hammering at his anvil beside an API endpoint sending events to several listeners.

Authentication

Send an API key as a bearer token. The key must carry the sites.view permission; a key without it is refused with 403, not 404.

This endpoint takes no organisation id. Your key already identifies the organisation it belongs to, and the response is scoped to it.

Try it

Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.

curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/ftp-users/{ftpUserId}/keys \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "public_key": <string> }'

Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console

Details

Authorises one more public key for the site's SFTP login, beside the key SFTP was switched on with, so a second person or machine can connect without sharing a key. To REPLACE the switch-on key, call createSiteFtpUser again with the new key. How many keys a login may hold is the plan's sftp_keys_max entitlement, published as keys_max on listSiteFtpUsers; past it the answer is 422 with what to do. 422 while SFTP is off, for a key that is not a single valid public key, and on a plan whose SSH access carries SFTP (its keys are managed under SSH keys). 404 for a site not on our own servers. Requires sites.view and sites.panel_access.

Parameters

NameTypeRequiredWhat it is
siteId (path)UuidYesSite ID (UUIDv7).
ftpUserId (path)stringYesThe account id returned by listSiteFtpUsers.

Request body

NameTypeRequiredWhat it is
public_keystringYesOne OpenSSH public key line (ssh-ed25519 AAAA... comment).

Response

NameTypeRequiredWhat it is
handlestringYessftp for the key SFTP was switched on with (replace it through createSiteFtpUser), sftp-2 onwards for added keys.
fingerprintstringYesSHA256: and the unpadded base64 SHA-256 of the key, exactly as ssh-keygen -lf and SFTP clients print it. Empty if the key could not be read.
algorithmstringYes—
commentstringYesThe key's own comment (often user@machine); may be empty.

Errors this endpoint can return

401 · 403 · 404 · 422 · 429 · 503