Skip to content

删除 Webhook

DELETE /v1/webhooks/{id}

立即删除 Webhook。一旦删除,该端点将停止接收事件。

试一试

Swagger UI 中交互式测试此端点。

需要认证

Authorization 头中包含您的 API 密钥。

DANGER

删除 Webhook 是即时且永久的操作。该端点将立即停止接收事件。此操作不可撤销 -- 您需要创建新的 Webhook。

请求

请求头

必需
AuthorizationBearer <token>

路径参数

参数类型必需描述
idstring要删除的 Webhook ID(例如 webhook-abc123def456)。

代码示例

bash
curl -X DELETE https://api.docmap.io/v1/webhooks/webhook-abc123def456 \
  -H "Authorization: Bearer dm_live_abc123def456ghi789jkl012mno345"
typescript
const apiKey = process.env.DOCMAP_API_KEY
const webhookId = 'webhook-abc123def456'

const response = await fetch(
  `https://api.docmap.io/v1/webhooks/${webhookId}`,
  {
    method: 'DELETE',
    headers: { 'Authorization': `Bearer ${apiKey}` },
  },
)

const result = await response.json()
console.log(result) // { success: true }
python
import requests

api_key = "dm_live_abc123def456ghi789jkl012mno345"
webhook_id = "webhook-abc123def456"

response = requests.delete(
    f"https://api.docmap.io/v1/webhooks/{webhook_id}",
    headers={"Authorization": f"Bearer {api_key}"},
)

print(response.json())  # {"success": True}

响应

状态码:200 OK

示例

json
{
  "success": true
}

错误

状态码错误码描述
401UNAUTHORIZED缺少、无效或已过期的 API 密钥/令牌。
403FORBIDDEN该 Webhook 属于其他用户。您只能删除自己的 Webhook。
404NOT_FOUND指定 ID 的 Webhook 未找到。

DocMap API 文档