Browse documentation

Fundamentals

Everything needed to send requests and handle responses consistently.

Authentication

Send an API key in every request. Keys are created and revoked only in the dashboard.

HTTP
Authorization: Bearer pw_v2_REPLACE_ME

Scopes

ScopeAllows
account:readAccount, usage and scope presets
tunnels:readTunnels, sessions, usage and catalog
tunnels:writeCreate and configure tunnels
tunnels:controlStart, stop and restart tunnels
devices:readList and inspect devices
devices:writeRename a device or disable remote control
devices:controlStop all tunnels or restart an agent
operations:readRead asynchronous action results
webhooks:readRead endpoints and delivery history
webhooks:writeCreate, edit, test and remove webhooks

Response format

Successful responses contain data and meta. Dates use RFC 3339 in UTC. Use meta.request_id when contacting support.

JSON
{
  "data": {"id": "..."},
  "meta": {"request_id": "..."}
}

Pagination

List endpoints that support pagination accept limit from 1 to 100. Pass meta.next_cursor unchanged as the next request's cursor. A null cursor means there are no more pages.

Shell
GET /tunnels?limit=25
GET /tunnels?limit=25&cursor=CURSOR_FROM_PREVIOUS_RESPONSE

Safe retries

Send a unique Idempotency-Key on every endpoint marked “Idempotency required”. Retry the same request with the same key. Do not reuse a key for a different body or resource.

ResultMeaning
Original responseThe first request completed.
Idempotent-Replayed: trueThe previous result was returned; the action was not repeated.
409 idempotency_conflictThe key was reused for a different request.

Errors

Errors use application/problem+json. Branch on code, not on the human-readable detail.

JSON
{
  "type": "https://portwarp.com/docs/api/errors#device_offline",
  "title": "Device Offline",
  "status": 409,
  "code": "device_offline",
  "detail": "The device is offline; no command was queued.",
  "request_id": "..."
}
StatusHandle it as
400Missing or invalid request header
401Missing, invalid or inactive key
403Feature, scope, plan or Team role does not allow the action
404Resource is absent or outside the key's scope
409Current state conflicts with the requested action
422Request fields failed validation
429Wait for Retry-After before retrying

feature_not_available means the requested API or remote action is not currently available for the account. Do not retry in a tight loop. Existing keys remain stored and can be used again when access becomes available.

Rate limits

Each key allows 120 requests per minute and 10,000 per day. Read X-RateLimit-Limit, X-RateLimit-Remaining and Retry-After.