> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve a Tunnel

> Retrieves a tunnel with its status and the tunnel processes connected to it. The response never includes `tunnel_token`.



## OpenAPI

````yaml /openapi/source/external/netapps/netapps.json get /tunnels/{id}
openapi: 3.1.0
info:
  version: 2.0.0
  title: Telnyx API
  x-latency-category: responsive
  x-endpoint-cost: light
  description: SIP trunking, SMS, MMS, Call Control and Telephony Data Services.
  license:
    name: MIT
    identifier: MIT
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
    description: Version 2.0.0 of the Telnyx API
security:
  - bearerAuth: []
tags:
  - name: Networks
    description: Network operations
  - name: Public Internet Gateways
    description: Public Internet Gateway operations
  - name: WireGuard Interfaces
    description: WireGuard Interface operations
  - name: Tunnels
    description: >-
      Tunnels connect a Network to hosts behind a tunnel process within the
      user's network.
  - name: Network Routes
    description: Routes on a Network that send a CIDR to a next hop, such as a tunnel.
  - name: Tailscale Subnet Routers
    description: Tailscale Subnet Router operations
  - name: Virtual Cross Connects
    description: Virtual Cross Connect operations
  - name: Regions
    description: Regions
  - name: Global IPs
    description: Global IPs
paths:
  /tunnels/{id}:
    get:
      tags:
        - Tunnels
      summary: Retrieve a Tunnel
      description: >-
        Retrieves a tunnel with its status and the tunnel processes connected to
        it. The response never includes `tunnel_token`.
      operationId: GetTunnel
      parameters:
        - name: id
          in: path
          required: true
          description: The id of the tunnel.
          schema:
            type: string
            format: uuid
            example: 62d438d2-8a51-4c5e-9d0c-1f6b2a7e4c39
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Tunnel'
              example:
                data:
                  id: 62d438d2-8a51-4c5e-9d0c-1f6b2a7e4c39
                  record_type: tunnel
                  name: chicago-dc
                  status: healthy
                  connection_count: 2
                  connections:
                    - hostname: dc1-tunnel-a
                      version: 0.6.0
                      region_code: chicago-il
                      connected_at: '2026-10-21T15:04:05.123456Z'
                    - hostname: dc1-tunnel-b
                      version: 0.6.0
                      region_code: chicago-il
                      connected_at: '2026-10-21T15:04:05.123456Z'
                  created_at: '2026-10-21T15:04:05.123456Z'
        '404':
          description: 'Not found: no tunnel with this id exists on the account.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                errors:
                  - code: '10020'
                    title: Resource not found
                    detail: 'get tunnel: not found'
        default:
          $ref: '#/components/responses/GenericErrorResponse'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.tunnels.retrieve('id');

            console.log(response.data);
        - lang: Python
          source: |
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            response = client.tunnels.retrieve(
                "id",
            )
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttunnel, err := client.Tunnels.Get(\n\t\tcontext.TODO(),\n\t\t\"id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", tunnel.Data)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    var response = client.tunnels().retrieve("id");
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            response = telnyx.tunnels.retrieve("id")

            puts(response)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $response = $client->tunnels->retrieve(
                'id',
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx tunnels retrieve \
              --api-key 'My API Key' \
              --id 62d438d2-8a51-4c5e-9d0c-1f6b2a7e4c39
components:
  schemas:
    Tunnel:
      type: object
      title: Tunnel
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: Identifies the resource.
          example: 62d438d2-8a51-4c5e-9d0c-1f6b2a7e4c39
        record_type:
          type: string
          readOnly: true
          description: Identifies the type of the resource.
          example: tunnel
        name:
          type: string
          minLength: 1
          description: A user specified name for the tunnel.
          example: chicago-dc
        status:
          type: string
          enum:
            - inactive
            - healthy
            - degraded
          readOnly: true
          description: >-
            `inactive` when no tunnel process is connected, and `healthy` when
            one or more are. `degraded` (Preview, not reported yet) when a
            process is connected but fails to reach its destinations.
          example: healthy
        connection_count:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of tunnel processes connected with the tunnel's token.
          example: 2
        connections:
          type: array
          readOnly: true
          description: The tunnel processes connected with the tunnel's token.
          items:
            $ref: '#/components/schemas/TunnelConnection'
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: >-
            ISO 8601 formatted date-time indicating when the resource was
            created.
          example: '2026-10-21T15:04:05.123456Z'
    Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
      type: object
    TunnelConnection:
      type: object
      title: TunnelConnection
      description: A tunnel process connected to the tunnel.
      properties:
        hostname:
          type: string
          description: >-
            The name the host reports for itself. Preview: empty until the CLI
            reports it.
          example: dc1-tunnel-a
        version:
          type: string
          description: >-
            The `telnyx-edge` CLI version of the process. Preview: empty until
            the CLI reports it.
          example: 0.6.0
        region_code:
          type: string
          description: >-
            The Telnyx region the process is connected to. Preview: empty until
            the CLI reports it.
          example: chicago-il
        connected_at:
          type: string
          format: date-time
          description: When the process connected.
          example: '2026-10-21T15:04:05.123456Z'
    Error:
      required:
        - code
        - title
      properties:
        code:
          type: string
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
          additionalProperties: true
      type: object
  responses:
    GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````