Skip to main content
POST
JavaScript

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

The Devbox ID.

Body

application/json

Configuration for creating a V2 tunnel. When specified at Devbox creation, a tunnel will be automatically provisioned.

auth_mode
enum<string> | null

Authentication mode for the tunnel. Defaults to 'public' if not specified.

Available options:
open,
authenticated
http_keep_alive
boolean | null

When true, HTTP traffic through the tunnel counts as activity for idle lifecycle policies, resetting the idle timer. Defaults to true if not specified.

wake_on_http
boolean | null

When true, HTTP traffic to a suspended devbox will automatically trigger a resume. Defaults to false if not specified. Prefer lifecycle.resume_triggers.http on launch_parameters for new integrations. If both are set, lifecycle.resume_triggers.http takes precedence.

Response

OK

A V2 tunnel provides secure HTTP access to services running on a Devbox. Tunnels allow external clients to reach web servers, APIs, or other HTTP services running inside a Devbox without requiring direct network access. Each tunnel is uniquely identified by an encrypted tunnel_key and can be configured for either open (public) or authenticated access. Usage: https://{port}-{tunnel_key}.tunnel.runloop.ai. Authenticated tunnels should pass auth_token as X-Runloop-Tunnel-Authorization: Bearer {auth_token}.

tunnel_key
string
required

The encrypted tunnel key used to construct the tunnel URL. URL format: https://{port}-{tunnel_key}.tunnel.runloop.{domain}

auth_mode
enum<string>
required

The authentication mode for the tunnel.

Available options:
open,
authenticated
create_time_ms
integer<int64>
required

Creation time of the tunnel (Unix timestamp milliseconds).

http_keep_alive
boolean
required

When true, HTTP traffic through the tunnel counts as activity for idle lifecycle policies, resetting the idle timer.

wake_on_http
boolean
required

When true, HTTP traffic to a suspended devbox will automatically trigger a resume.

auth_token
string | null

Bearer token for tunnel authentication. Only present when auth_mode is 'authenticated'. Pass as X-Runloop-Tunnel-Authorization: Bearer {auth_token}.