Skip to content

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.

Needs an API key in the Authorization header.

On this page

Request body

FieldTypeDescription
nodeIdrequiredstring
  • format: uuid
namerequiredstring
  • min length: 1
  • max length: 40
publicKeyrequiredstring
JSON schema
{
  "type": "object",
  "properties": {
    "nodeId": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
    },
    "publicKey": {
      "type": "string"
    }
  },
  "required": [
    "nodeId",
    "name",
    "publicKey"
  ]
}

Example request

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"
}'

Responses

StatusMeaning
200OK

Can also answer the common errors 400, 401, 403, 404. See common errors