Update a webhook
π Update a Webhook
Change the settings of an existing webhook, like its web address or format.
Endpoint
PUT https://api.tor.app/developer/integrations/webhooks
POST Body Parameters
- webhookType (string, required): The ID of the webhook to update (e.g.,
wh 2025-05-02 12:34:56
). - url (string, required): The new web address for notifications.
- export_format (string, optional): Choose the transcript format:
Txt
,Json
, orCsv
. Default:Txt
. - include_timestamps (boolean, optional): Set to
true
to add timestamps. Default:false
. - include_speaker_names (boolean, optional): Set to
true
to include speaker names. Default:false
. - merge_same_speaker_segments (boolean, optional): Set to
true
to combine parts by the same speaker. Default:false
. - is_single_paragraph (boolean, optional): Set to
true
for one big paragraph. Default:false
. - paragraph_size (integer, optional): Lines per paragraph (if not single paragraph). Suggested: 1, 2, 4, or 8. Default: 1.
- folder_id (string, optional): Send notifications only for transcriptions in this folder. Default: none.
Responses
200 OK
"Webhook updated."
400 Bad Request
"webhookType is required."
404 Not Found
"Webhook not found."
500 Internal Server Error
"Failed to update webhook."
Notes
- Ensure the
webhookType
matches an existing webhook. - Notifications sent to the
url
include details like file ID and name.
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",
"url": "https://your-webhook-url.com"
}
response = requests.put(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",
url: "https://your-webhook-url.com"
};
axios.put(url, data, { headers })
.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 UpdateWebhook {
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");
data.put("url", "https://your-webhook-url.com");
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")
.put(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 HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {api_key}");
var data = new {
webhookType = "wh 2025-05-05 08:17:16",
url = "https://your-webhook-url.com"
};
string json = JsonSerializer.Serialize(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
HttpResponseMessage response = await client.PutAsync(url, content);
Console.WriteLine((int)response.StatusCode);
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}
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",
"url": "https://your-webhook-url.com",
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("PUT", 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::Put.new(url)
request["Authorization"] = "Bearer #{api_key}"
request["Content-Type"] = "application/json"
data = {
webhookType: "wh 2025-05-05 08:17:16",
url: "https://your-webhook-url.com"
}
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",
"url" => "https://your-webhook-url.com"
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
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")
put("url", "https://your-webhook-url.com")
}
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")
.put(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 = "PUT"
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",
"url": "https://your-webhook-url.com"
]
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",
"url": "https://your-webhook-url.com"
};
try {
final request = await client.openUrl("PUT", 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 12 hours ago