Delete a webhook
π Delete a Webhook
Remove a webhook to stop receiving transcription notifications.
Endpoint
DELETE https://api.tor.app/developer/integrations/webhooks
Query Parameters
- webhookType (string, required): The ID of the webhook to delete (e.g.,
wh 2025-05-02 12:34:56
).
Responses
200 OK
"Webhook deleted."
400 Bad Request
"webhookType is required."
404 Not Found
"Webhook not found."
500 Internal Server Error
"Failed to delete webhook."
Notes
- Deleted webhooks cannot be recovered.
import requests
import json
api_key = "YOUR_API_KEY"
url = "https://api.tor.app/developer/integrations/webhooks"
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
data = {
"webhookType": "wh 2025-05-05 08:17:16"
}
response = requests.delete(url, headers=headers, data=json.dumps(data))
print(response.status_code)
print(response.json())
const axios = require('axios');
const api_key = "YOUR_API_KEY";
const url = "https://api.tor.app/developer/integrations/webhooks";
const headers = {
"Authorization": `Bearer ${api_key}`,
"Content-Type": "application/json"
};
const data = {
webhookType: "wh 2025-05-05 08:17:16"
};
axios.delete(url, { headers, data })
.then(response => {
console.log(response.status);
console.log(response.data);
})
.catch(error => {
console.error(error.response ? error.response.data : error.message);
});
import okhttp3.*;
import org.json.JSONObject;
public class DeleteWebhook {
public static void main(String[] args) throws Exception {
String api_key = "YOUR_API_KEY";
String url = "https://api.tor.app/developer/integrations/webhooks";
OkHttpClient client = new OkHttpClient();
JSONObject data = new JSONObject();
data.put("webhookType", "wh 2025-05-05 08:17:16");
RequestBody body = RequestBody.create(data.toString(), MediaType.parse("application/json"));
Request request = new Request.Builder()
.url(url)
.addHeader("Authorization", "Bearer " + api_key)
.addHeader("Content-Type", "application/json")
.delete(body)
.build();
try (Response response = client.newCall(request).execute()) {
System.out.println(response.code());
System.out.println(response.body().string());
}
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class Program {
static async Task Main(string[] args) {
string api_key = "YOUR_API_KEY";
string url = "https://api.tor.app/developer/integrations/webhooks";
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {api_key}");
var data = new {
webhookType = "wh 2025-05-05 08:17:16"
};
var content = new StringContent(JsonSerializer.Serialize(data), Encoding.UTF8, "application/json");
var request = new HttpRequestMessage(HttpMethod.Delete, url) {
Content = content
};
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
api_key := "YOUR_API_KEY"
url := "https://api.tor.app/developer/integrations/webhooks"
data := map[string]interface{}{
"webhookType": "wh 2025-05-05 08:17:16",
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("DELETE", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer "+api_key)
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
fmt.Println("Status Code:", resp.StatusCode)
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}
require 'net/http'
require 'json'
require 'uri'
api_key = "YOUR_API_KEY"
url = URI("https://api.tor.app/developer/integrations/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = "Bearer #{api_key}"
request["Content-Type"] = "application/json"
data = {
webhookType: "wh 2025-05-05 08:17:16"
}
request.body = data.to_json
response = http.request(request)
puts response.code
puts response.body
<?php
$api_key = "YOUR_API_KEY";
$url = "https://api.tor.app/developer/integrations/webhooks";
$data = [
"webhookType" => "wh 2025-05-05 08:17:16"
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer $api_key",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo "Status Code: $status_code\n";
echo $response;
?>
import okhttp3.*
import org.json.JSONObject
fun main() {
val api_key = "YOUR_API_KEY"
val url = "https://api.tor.app/developer/integrations/webhooks"
val client = OkHttpClient()
val data = JSONObject().apply {
put("webhookType", "wh 2025-05-05 08:17:16")
}
val body = RequestBody.create(
MediaType.parse("application/json"),
data.toString()
)
val request = Request.Builder()
.url(url)
.addHeader("Authorization", "Bearer $api_key")
.addHeader("Content-Type", "application/json")
.delete(body)
.build()
client.newCall(request).execute().use { response ->
println("Status Code: ${response.code()}")
println(response.body()?.string())
}
}
import Foundation
let api_key = "YOUR_API_KEY"
let url = URL(string: "https://api.tor.app/developer/integrations/webhooks")!
var request = URLRequest(url: url)
request.httpMethod = "DELETE"
request.addValue("Bearer \(api_key)", forHTTPHeaderField: "Authorization")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
let data: [String: Any] = [
"webhookType": "wh 2025-05-05 08:17:16"
]
let jsonData = try! JSONSerialization.data(withJSONObject: data)
request.httpBody = jsonData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print("Error: \(error.localizedDescription)")
return
}
if let httpResponse = response as? HTTPURLResponse {
print("Status Code: \(httpResponse.statusCode)")
}
if let data = data, let responseString = String(data: data, encoding: .utf8) {
print(responseString)
}
}
task.resume()
import 'dart:convert';
import 'dart:io';
void main() async {
final api_key = "YOUR_API_KEY";
final url = Uri.parse("https://api.tor.app/developer/integrations/webhooks");
final client = HttpClient();
final data = {
"webhookType": "wh 2025-05-05 08:17:16"
};
try {
final request = await client.openUrl("DELETE", url);
request.headers.set("Authorization", "Bearer $api_key");
request.headers.set("Content-Type", "application/json");
request.add(utf8.encode(jsonEncode(data)));
final response = await request.close();
final responseBody = await response.transform(utf8.decoder).join();
print("Status Code: ${response.statusCode}");
print(responseBody);
} catch (e) {
print("Error: $e");
} finally {
client.close();
}
}
Updated about 14 hours ago