Webhook 端点
作业结束或积分不足时,我们向其发送签名消息的地址。如何验证每条消息,请参阅 Webhook。
本页内容
GET/v1/webhooks
工作区的端点,不含签名密钥。
返回
- 200端点列表。
8 个字段
webhooksobject[]必填webhooks[].idstring必填webhooks[].urlstring (URL)必填webhooks[].eventsstring[]必填可选值:
job.completed、job.partly_failed、job.failed、job.cancelled或credits.lowwebhooks[].enabledboolean必填投递持续失败 72 小时后端点会被停用,此时为 false。管理员可在“设置”中重新启用。
webhooks[].disabled_atstring (date-time) | null必填webhooks[].created_atstring (date-time)必填webhooks[].secretstring签名密钥。仅在添加端点的响应中返回。
错误
示例
curl https://api.filesokay.com/v1/webhooks \
-H "Authorization: Bearer $FILESOKAY_KEY"const res = await fetch("https://api.filesokay.com/v1/webhooks", {
headers: {
Authorization: `Bearer ${process.env.FILESOKAY_KEY}`,
},
});
const list = await res.json();import os
import requests
res = requests.get(
"https://api.filesokay.com/v1/webhooks",
headers={
"Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}",
},
)
list = res.json(){
"webhooks": [
{
"id": "wh_5b0e3c1f9a7d42e8b6c4d2f0a8e61b37",
"url": "https://example.com/webhooks/filesokay",
"events": [
"job.completed",
"job.partly_failed",
"job.failed"
],
"enabled": true,
"disabled_at": null,
"created_at": "2026-12-03T09:25:50Z"
}
]
}POST/v1/webhooks
添加一个位于公共互联网上的 HTTPS 地址,我们会向其发送签名消息。响应中包含该端点的签名密钥:请妥善保存,用于验证每条消息的签名。一个工作区最多可拥有 20 个端点。
请求体
urlstring (URL)必填一个
https://地址。私有网络中的地址会被拒绝。最多 2,048 个字符
eventsstring[]要发送的事件。省略则发送所有事件。
可选值:
job.completed、job.partly_failed、job.failed、job.cancelled或credits.low
返回
- 201该端点及其签名密钥,密钥仅显示这一次。
7 个字段
idstring必填urlstring (URL)必填eventsstring[]必填可选值:
job.completed、job.partly_failed、job.failed、job.cancelled或credits.lowenabledboolean必填投递持续失败 72 小时后端点会被停用,此时为 false。管理员可在“设置”中重新启用。
disabled_atstring (date-time) | null必填created_atstring (date-time)必填secretstring必填签名密钥。仅在添加端点的响应中返回。
错误
示例
curl -X POST https://api.filesokay.com/v1/webhooks \
-H "Authorization: Bearer $FILESOKAY_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/webhooks/filesokay",
"events": [
"job.completed",
"job.partly_failed",
"job.failed"
]
}'const res = await fetch("https://api.filesokay.com/v1/webhooks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.FILESOKAY_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://example.com/webhooks/filesokay",
events: [
"job.completed",
"job.partly_failed",
"job.failed"
]
}),
});
const endpoint = await res.json();import os
import requests
res = requests.post(
"https://api.filesokay.com/v1/webhooks",
headers={
"Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}",
},
json={
"url": "https://example.com/webhooks/filesokay",
"events": [
"job.completed",
"job.partly_failed",
"job.failed"
]
},
)
endpoint = res.json(){
"id": "wh_5b0e3c1f9a7d42e8b6c4d2f0a8e61b37",
"url": "https://example.com/webhooks/filesokay",
"events": [
"job.completed",
"job.partly_failed",
"job.failed"
],
"enabled": true,
"disabled_at": null,
"created_at": "2026-12-03T09:25:50Z",
"secret": "whsec_…"
}DELETE/v1/webhooks/{id}
删除该端点。仍在等待发送给它的消息将不再发送。
路径参数
idstring必填
返回
- 204已删除。
错误
示例
curl -X DELETE https://api.filesokay.com/v1/webhooks/wh_5b0e3c1f9a7d42e8b6c4d2f0a8e61b37 \
-H "Authorization: Bearer $FILESOKAY_KEY"const res = await fetch("https://api.filesokay.com/v1/webhooks/wh_5b0e3c1f9a7d42e8b6c4d2f0a8e61b37", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.FILESOKAY_KEY}`,
},
});
console.log(res.status);import os
import requests
res = requests.delete(
"https://api.filesokay.com/v1/webhooks/wh_5b0e3c1f9a7d42e8b6c4d2f0a8e61b37",
headers={
"Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}",
},
)
print(res.status_code)