Skip to main content
DELETE
/
api
/
v1
/
tunnel
Bulk Delete Tunnels Endpoint
curl --request DELETE \
  --url https://api.primeintellect.ai/api/v1/tunnel \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "tunnel_ids": [
    "<string>"
  ],
  "labels": [
    "<string>"
  ],
  "teamId": "<string>",
  "userId": "<string>",
  "allUsers": false
}
'
import requests

url = "https://api.primeintellect.ai/api/v1/tunnel"

payload = {
"tunnel_ids": ["<string>"],
"labels": ["<string>"],
"teamId": "<string>",
"userId": "<string>",
"allUsers": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.delete(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tunnel_ids: ['<string>'],
labels: ['<string>'],
teamId: '<string>',
userId: '<string>',
allUsers: false
})
};

fetch('https://api.primeintellect.ai/api/v1/tunnel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.primeintellect.ai/api/v1/tunnel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'tunnel_ids' => [
'<string>'
],
'labels' => [
'<string>'
],
'teamId' => '<string>',
'userId' => '<string>',
'allUsers' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.primeintellect.ai/api/v1/tunnel"

payload := strings.NewReader("{\n \"tunnel_ids\": [\n \"<string>\"\n ],\n \"labels\": [\n \"<string>\"\n ],\n \"teamId\": \"<string>\",\n \"userId\": \"<string>\",\n \"allUsers\": false\n}")

req, _ := http.NewRequest("DELETE", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.delete("https://api.primeintellect.ai/api/v1/tunnel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tunnel_ids\": [\n \"<string>\"\n ],\n \"labels\": [\n \"<string>\"\n ],\n \"teamId\": \"<string>\",\n \"userId\": \"<string>\",\n \"allUsers\": false\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.primeintellect.ai/api/v1/tunnel")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tunnel_ids\": [\n \"<string>\"\n ],\n \"labels\": [\n \"<string>\"\n ],\n \"teamId\": \"<string>\",\n \"userId\": \"<string>\",\n \"allUsers\": false\n}"

response = http.request(request)
puts response.read_body
{
  "message": "<string>",
  "succeeded": [
    "<string>"
  ],
  "failed": [
    {}
  ]
}
{
"errors": [
{
"param": "<string>",
"details": "<string>"
}
]
}

Rate Limit

100 requests per 60 seconds per user.

Authorizations

Authorization
string
header
required

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

Body

application/json

Request to bulk delete tunnels.

tunnel_ids
string[] | null

List of tunnel IDs to delete

Required array length: 1 - 500 elements
labels
string[] | null

List of labels - delete all tunnels with ALL these labels

Required array length: 1 - 50 elements
status
enum<string> | null

Delete only tunnels currently in this status. Must be an active status (pending, connected, disconnected)

Available options:
pending,
connected,
disconnected,
expired,
terminated
teamId
string | null

Scope deletion to tunnels in this team

userId
string | null

Scope deletion to tunnels owned by this user

allUsers
boolean
default:false

Delete tunnels across all users in the given team

Response

Successful Response

Response for bulk tunnel deletion.

message
string
required

Summary message

succeeded
string[]

Successfully deleted tunnel IDs

failed
Failed · object[]

Failed deletions with error messages