> ## 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.

# Delete a Tunnel

> Deletes a tunnel. A tunnel that a route names as its next hop cannot be deleted; delete those routes first. Connected tunnel processes are disconnected and cannot reconnect with the tunnel's token.



## OpenAPI

````yaml /openapi/source/external/netapps/netapps.json delete /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}:
    delete:
      tags:
        - Tunnels
      summary: Delete a Tunnel
      description: >-
        Deletes a tunnel. A tunnel that a route names as its next hop cannot be
        deleted; delete those routes first. Connected tunnel processes are
        disconnected and cannot reconnect with the tunnel's token.
      operationId: DeleteTunnel
      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:
        '204':
          description: Deleted.
        '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'
        '409':
          description: >-
            Conflict: one or more routes name the tunnel as their next hop.
            `detail` and `meta.route_ids` list them.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              example:
                errors:
                  - code: '10021'
                    title: Resource conflict
                    detail: >-
                      tunnel 62d438d2-8a51-4c5e-9d0c-1f6b2a7e4c39 is the next
                      hop of 1 route; delete it first:
                      e8a2c5d0-3f7b-4a19-b6d2-9c1e0f8a7b53
                    meta:
                      route_ids:
                        - e8a2c5d0-3f7b-4a19-b6d2-9c1e0f8a7b53
        default:
          $ref: '#/components/responses/GenericErrorResponse'
components:
  schemas:
    Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
      type: object
    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

````