---
title: "Enable a tunnel for a running Devbox."
method: POST
path: "/v1/devboxes/{id}/enable_tunnel"
tags: ["Devbox", "Devbox-NetworkTools"]
---

# Enable a tunnel for a running Devbox.

`POST /v1/devboxes/{id}/enable_tunnel`

Enable a V2 tunnel for an existing running Devbox. Tunnels provide encrypted URL-based access to the Devbox without exposing internal IDs. The tunnel URL format is: https://&#123;port&#125;-&#123;tunnel_key&#125;.tunnel.runloop.ai

Each Devbox can have one tunnel.

## Path parameters

- `id` string, required

## Request body

- TunnelConfig — Configuration for creating a V2 tunnel. When specified at Devbox creation, a tunnel will be automatically provisioned.
  - `auth_mode` 'open' | 'authenticated'
  - `http_keep_alive` boolean, nullable — 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, nullable — 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 `200`

OK

- TunnelView — 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
  - `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` 'open' | 'authenticated', required
  - `auth_token` string, nullable — Bearer token for tunnel authentication. Only present when auth_mode is 'authenticated'.
  - `create_time_ms` integer, 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.

## Other responses

- `400` — Devbox is not running or already has a tunnel configured.
- `404` — Devbox not found.

## Changes

- **2026-04-01** `c33fa67077f6` — 2 info
  - added the new optional request property `wake_on_http`
  - added the required property `wake_on_http` to the response with the `200` status
- **2026-02-25** `dd0f43e15cb6` — 2 info
  - added the new optional request property `http_keep_alive`
  - added the required property `http_keep_alive` to the response with the `200` status
- **2026-02-12** `c8d61a0c8b88` — 1 info
  - api operation id `createDevboxTunnel` removed and replaced with `enableDevboxTunnel`
- **2026-01-30** `b493cadf2e3b` — 1 warning, 1 info
  - added the new `open` enum value to the `auth_mode` response property for the response status `200`
  - removed the `public_` enum value from the `auth_mode` response property for the response status `200`
- **2026-01-30** `debd1f9a9d59` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/runloopai/apis/runloop-api/changes/v1/devboxes/:id/enable_tunnel/post.md)

---

[API](https://skmtc.dev/runloopai/apis/runloop-api.md) · [All operations](https://skmtc.dev/runloopai/apis/runloop-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/runloopai/runloop-api/revisions/cd3a17e212ec/schema)
