删除 Webhook 端点
curl --request DELETE \
--url https://api.tokenlab.sh/v1/management/webhooks/{webhookId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tokenlab.sh/v1/management/webhooks/{webhookId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tokenlab.sh/v1/management/webhooks/{webhookId}', 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.tokenlab.sh/v1/management/webhooks/{webhookId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tokenlab.sh/v1/management/webhooks/{webhookId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.tokenlab.sh/v1/management/webhooks/{webhookId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenlab.sh/v1/management/webhooks/{webhookId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "webhook_endpoint",
"deleted": true
}{
"error": {
"message": "model: Model is required",
"type": "invalid_request_error",
"param": "model"
},
"validation_errors": [
{
"field": "model",
"message": "Model is required"
}
]
}{
"error": {
"message": "Invalid API key provided",
"type": "invalid_api_key"
}
}{
"error": {
"message": "Organization is not active",
"type": "invalid_request_error"
}
}{
"error": {
"message": "<string>",
"type": "unauthorized",
"code": "<string>",
"param": "<string>",
"model": "<string>",
"did_you_mean": "<string>",
"suggestions": [
{
"id": "<string>"
}
],
"alternatives": [
{
"id": "<string>",
"status": "<string>",
"tags": [
"<string>"
]
}
],
"hint": "<string>",
"retry_after": 123,
"retryable": true,
"balance_usd": 123,
"estimated_cost_usd": 123,
"supported_operations": [
"<string>"
],
"supported_parameters": [
"<string>"
],
"required_selectors": [
"<string>"
],
"optional_selectors": [
"<string>"
],
"allowed_resolutions": [
"<string>"
],
"allowed_durations": [
"<string>"
],
"allowed_aspect_ratios": [
"<string>"
],
"prompt_max_characters": 123,
"recommended_request": {},
"request_endpoint": "<string>",
"request_shape_mode": "<string>",
"status_mode": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "unauthorized",
"code": "<string>",
"param": "<string>",
"model": "<string>",
"did_you_mean": "<string>",
"suggestions": [
{
"id": "<string>"
}
],
"alternatives": [
{
"id": "<string>",
"status": "<string>",
"tags": [
"<string>"
]
}
],
"hint": "<string>",
"retry_after": 123,
"retryable": true,
"balance_usd": 123,
"estimated_cost_usd": 123,
"supported_operations": [
"<string>"
],
"supported_parameters": [
"<string>"
],
"required_selectors": [
"<string>"
],
"optional_selectors": [
"<string>"
],
"allowed_resolutions": [
"<string>"
],
"allowed_durations": [
"<string>"
],
"allowed_aspect_ratios": [
"<string>"
],
"prompt_max_characters": 123,
"recommended_request": {},
"request_endpoint": "<string>",
"request_shape_mode": "<string>",
"status_mode": "<string>",
"request_id": "<string>"
}
}管理
删除 Webhook
需要工作区 Management Token (mt-…),可在 Dashboard > API > Management Tokens 中创建。发送 Authorization: Bearer mt-…。不支持 Inference API keys (sk-…) 和 Webhook 签名密钥 (whsec_…)。仅可访问该 token 所属的工作区。
DELETE
/
v1
/
management
/
webhooks
/
{webhookId}
删除 Webhook 端点
curl --request DELETE \
--url https://api.tokenlab.sh/v1/management/webhooks/{webhookId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tokenlab.sh/v1/management/webhooks/{webhookId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tokenlab.sh/v1/management/webhooks/{webhookId}', 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.tokenlab.sh/v1/management/webhooks/{webhookId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tokenlab.sh/v1/management/webhooks/{webhookId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.tokenlab.sh/v1/management/webhooks/{webhookId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenlab.sh/v1/management/webhooks/{webhookId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "webhook_endpoint",
"deleted": true
}{
"error": {
"message": "model: Model is required",
"type": "invalid_request_error",
"param": "model"
},
"validation_errors": [
{
"field": "model",
"message": "Model is required"
}
]
}{
"error": {
"message": "Invalid API key provided",
"type": "invalid_api_key"
}
}{
"error": {
"message": "Organization is not active",
"type": "invalid_request_error"
}
}{
"error": {
"message": "<string>",
"type": "unauthorized",
"code": "<string>",
"param": "<string>",
"model": "<string>",
"did_you_mean": "<string>",
"suggestions": [
{
"id": "<string>"
}
],
"alternatives": [
{
"id": "<string>",
"status": "<string>",
"tags": [
"<string>"
]
}
],
"hint": "<string>",
"retry_after": 123,
"retryable": true,
"balance_usd": 123,
"estimated_cost_usd": 123,
"supported_operations": [
"<string>"
],
"supported_parameters": [
"<string>"
],
"required_selectors": [
"<string>"
],
"optional_selectors": [
"<string>"
],
"allowed_resolutions": [
"<string>"
],
"allowed_durations": [
"<string>"
],
"allowed_aspect_ratios": [
"<string>"
],
"prompt_max_characters": 123,
"recommended_request": {},
"request_endpoint": "<string>",
"request_shape_mode": "<string>",
"status_mode": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "unauthorized",
"code": "<string>",
"param": "<string>",
"model": "<string>",
"did_you_mean": "<string>",
"suggestions": [
{
"id": "<string>"
}
],
"alternatives": [
{
"id": "<string>",
"status": "<string>",
"tags": [
"<string>"
]
}
],
"hint": "<string>",
"retry_after": 123,
"retryable": true,
"balance_usd": 123,
"estimated_cost_usd": 123,
"supported_operations": [
"<string>"
],
"supported_parameters": [
"<string>"
],
"required_selectors": [
"<string>"
],
"optional_selectors": [
"<string>"
],
"allowed_resolutions": [
"<string>"
],
"allowed_durations": [
"<string>"
],
"allowed_aspect_ratios": [
"<string>"
],
"prompt_max_characters": 123,
"recommended_request": {},
"request_endpoint": "<string>",
"request_shape_mode": "<string>",
"status_mode": "<string>",
"request_id": "<string>"
}
}使用工作区管理令牌
mt-…,不是模型调用 Key sk-…,也不是签名密钥 whsec_…。在 Dashboard → API → Management Tokens 创建,以 Authorization: Bearer mt-… 发送。只能操作该工作区。
接入、事件、验签与失败处理见 Webhook 管理 API 文档。