hosting
POST /v1/sites/{siteId}/ssh-keys
Authorise a public key for SSH on a site.
Authenticatie
Stuur een API-sleutel mee als bearer token. De sleutel moet over de permissie sites.view beschikken; een sleutel zonder deze permissie wordt geweigerd met een 403 in plaats van een 404.
Dit eindpunt vereist geen organisatie-id. Uw sleutel identificeert al de organisatie waartoe deze behoort, en het antwoord is hierop afgestemd.
Probeer het
Vervang alles tussen punthaakjes door uw eigen waarden en de sleutelplaatsvervanger door een sleutel uit uw dashboard.
curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/ssh-keys \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "handle": <string>, "key": <string> }'Ingelogd? De API-console in je dashboard vult je echte organisatie-id en je eigen sleutel in, en voert het verzoek uit tegen de live API zodat je de daadwerkelijke respons kunt zien. Open dit eindpunt in de API-console
Details
Files one public key under a handle and returns the key as it was stored. `201` and the created key rather than the whole list, because the list is re-read anyway: `can_create` is a property of the collection and the vendor's own key count moves with it. ⛔ **What makes a key valid is checked in the service, not in this schema**, and the sentence the customer reads is the same whichever door they came through — including the one that says *"that is your private key"*. A line that is not a public key we accept, a handle outside `[A-Za-z0-9][A-Za-z0-9._-]{0,63}`, a duplicate handle, or a package type that does not include SSH are all `422` with our wording, before the vendor is called. `404` for a site with no vendor hosting package, or one that is not the caller's. Requires `sites.view` **and** `sites.panel_access` — this write grants a shell.
Parameters
| Naam | Type | Verplicht | Wat dit is |
|---|---|---|---|
siteId (path) | Uuid | Ja | Site ID (UUIDv7). |
Aanvraaglichaam
| Naam | Type | Verplicht | Wat dit is |
|---|---|---|---|
handle | string | Ja | What to file the key under. Constrained to `[A-Za-z0-9][A-Za-z0-9._-]{0,63}`; anything else is refused with our wording rather than the vendor's. |
key | string | Ja | The public key line, as OpenSSH writes it. |
Reactie
| Naam | Type | Verplicht | Wat dit is |
|---|---|---|---|
handle | string | Ja | The name the key is filed under, ours and the vendor's, and what `deleteSiteSshKey` addresses. Constrained to `[A-Za-z0-9][A-Za-z0-9._-]{0,63}`. |
key | string | Ja | The public key line, in full and never truncated. It is a **public** key — publishing it is what it is for — and a shortened one would stop a customer confirming that the key on… |
algorithm | string | Ja | The key type parsed out of the line. `""` when the stored line does not parse as one of the algorithms we accept, which is possible for a key added at the vendor before this sur… |
comment | string | Ja | The trailing comment on the key line. Often an email address, often empty. |
Fouten die dit eindpunt kan retourneren
401 · 403 · 404 · 422 · 429 · 503