---
title: "List Tunnels Endpoint"
method: GET
path: "/api/v1/tunnel"
tags: ["Tunnel"]
---

# List Tunnels Endpoint

`GET /api/v1/tunnel`

List all active tunnels for the current user.

## Query parameters

- `teamId` string, nullable
- `status` string, nullable — Filter by status
- `labels` string[], nullable — Filter by labels
- `includeTerminated` boolean — Include terminated tunnels
- `page` integer — Page number
- `perPage` integer — Items per page
- `sortBy` string
- `sortOrder` string

## Response `200`

Successful Response

- TunnelListResponse — Response containing list of tunnels.
  - `tunnels` TunnelStatusResponse[] — List of active tunnels
    - `tunnel_id` string, required — Unique tunnel identifier
    - `name` string, nullable — Friendly name if set
    - `status` 'pending' | 'connected' | 'disconnected' | 'expired' | 'terminated', required
    - `hostname` string, required — Tunnel hostname
    - `url` string, required — Full HTTPS URL
    - `local_port` integer, required — Local port forwarded by the tunnel
    - `labels` string[] — Tunnel labels
    - `http_user` string, nullable — HTTP basic auth username, if auth is enabled
    - `auth_enabled` boolean — Whether HTTP basic auth protects tunnel traffic
    - `created_at` string, date-time, required — Tunnel creation time
    - `connected_at` string, date-time, nullable — When the client connected
    - `expires_at` string, date-time, required — Token expiration time
    - `terminated_at` string, date-time, nullable — When the tunnel was terminated
    - `user_id` string, required — Owner user ID
    - `team_id` string, nullable — Team ID if applicable
  - `total` integer, required — Total number of tunnels
  - `page` integer — Page number
  - `per_page` integer — Items per page
  - `has_next` boolean — Whether more pages are available

## Other responses

- `401` — Authorization failed
- `422` — Invalid request data

---

[API](https://skmtc.net/primeintellect/apis/pi-api.md) · [All operations](https://skmtc.net/primeintellect/apis/pi-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/primeintellect/pi-api/revisions/3d3868828a78/schema)
