Skip to the page

Register a WireGuard public key for the person

POST/v1/organisations/{id}/environments/{envId}/vpn/keys

Operation settings.vpnKey · since 2026-11-05 · stable

Needs a session withwritescopeAnswers201 Created

Five live keys per person per environment.

Path parameters

idstring (uuid)required
The organisation id.
envIdstring (uuid)required
The environment id.

Body (JSON)

publicKeystring, 44 charactersrequired
Your WireGuard public key (base64). The private half never leaves your device.
devicestring, 1 to 60required
What to call the device.
daysinteger, 1 to 90optional
How long the key lives.
sourcestringoptional
"console", "api" or "cli", for the record.

Errors

Every error is { "error", "message", "detail"? } (Errors and references). Besides the codes any route can answer, this one refuses with:

  • vpn_key_limit
POST/v1/organisations/{id}/environments/{envId}/vpn/keys
curl -X POST "https://api.rykloud.com/v1/organisations/$ORG_ID/environments/$ENV_ID/vpn/keys" \
  -H "Authorization: Bearer $RYKLOUD_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "publicKey": "<publicKey>",
  "device": "<device>"
}'