Ir al contenido

Connect a device to the VPN

POST/api/v1/vpn/connect

Send only the public half of the device's WireGuard key. The same key gets the same device back. Needs the vpn.use scope.

Necesita una clave de API en la cabecera Authorization.

En esta página

Cuerpo

CampoTipoDescripción
nodeIdobligatoriostring
  • formato: uuid
nameobligatoriostring
  • long. mín.: 1
  • long. máx.: 40
publicKeyobligatoriostring
Esquema JSON
{
  "type": "object",
  "properties": {
    "nodeId": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
    },
    "publicKey": {
      "type": "string"
    }
  },
  "required": [
    "nodeId",
    "name",
    "publicKey"
  ]
}

Petición de ejemplo

curl -X POST "https://polaris.example.com/api/v1/vpn/connect" \
  -H "Authorization: Bearer $POLARIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "nodeId": "string",
  "name": "string",
  "publicKey": "string"
}'

Respuestas

EstadoQué es
200OK

También puede dar los errores comunes 400, 401, 403, 404. Ver errores comunes