Browse documentation

Portwarp API

Use the API to create tunnels, manage their configuration and run them on your devices.

Base URL: https://api.portwarp.com/v2. Create a key in Dashboard → API Keys.

If an account does not currently have API access, requests return 403 feature_not_available. Keep the key stored. Access changes do not require key rotation.

Make your first request

Send your key as a Bearer token. This request returns the devices available to the key.

Shell
curl https://api.portwarp.com/v2/devices \
  -H "Authorization: Bearer pw_v2_REPLACE_ME"
Response
{
  "data": [
    {
      "id": "8dfda098-6da3-4ea4-b8af-85f62d634b86",
      "name": "Home server",
      "online": true,
      "remote_control_enabled": true
    }
  ],
  "meta": {"request_id": "req_...", "next_cursor": null}
}

Create a tunnel

Write requests use JSON. Creations and actions also require an Idempotency-Key, which makes a retry safe.

Shell
curl -X POST https://api.portwarp.com/v2/tunnels \
  -H "Authorization: Bearer pw_v2_REPLACE_ME" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: create-minecraft-001" \
  -d '{"name":"Minecraft","protocol":"tcp","local_port":25565}'

Run it on a device

On the target device, enable remote control once with pwrp remote enable, or in the desktop app under Settings > Remote Control. Then start the tunnel and track the returned operation.

Shell
curl -X POST https://api.portwarp.com/v2/tunnels/TUNNEL_ID/actions/start \
  -H "Authorization: Bearer pw_v2_REPLACE_ME" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: start-minecraft-001" \
  -d '{"device_id":"DEVICE_ID"}'

Choose a reference