OpenAI 更新Webhook端点
2026-11-12 16:14 更新
更新 Webhook 端点
post /webhook_endpoints/{webhook_endpoint_id}
更新当前身份验证所对应项目的 Webhook 端点。
路径参数
webhook_endpoint_id: string
要更新的 Webhook 端点的 ID。
请求体参数
内容类型:application/json
event_types: optional array of "batch.completed" or "batch.failed" or "batch.expired" or 24 more
应触发投递的完整事件类型集合。
minItems: 1
"batch.completed"
"batch.failed"
"batch.expired"
"batch.cancelled"
"response.completed"
"response.failed"
"response.cancelled"
"response.incomplete"
"eval.run.succeeded"
"eval.run.failed"
"eval.run.canceled"
"fine_tuning.job.succeeded"
"fine_tuning.job.failed"
"fine_tuning.job.cancelled"
"realtime.call.incoming"
"video.completed"
"video.failed"
"agent.environment.ready"
"agent.environment.failed"
"agent.environment.suspended"
"agent.environment.expired"
"agent.session.created"
"agent.session.action_required"
"agent.session.in_progress"
"agent.session.idle"
"agent.session.failed"
"safety.alert.created"
name: optional string
Webhook 端点新的便于阅读的名称。
minLength: 1, maxLength: 256
url: optional string
接收 Webhook 投递的新的 HTTPS URL。
pattern: ^https://, maxLength: 2048
返回值
WebhookEndpoint object { id, created_at, event_types, 5 more }
id: string
Webhook 端点的唯一 ID。
created_at: integer
端点创建时的 Unix 时间戳。
format: unixtime
event_types: array of string
触发向此端点投递的事件类型。
name: string
端点便于阅读的名称。
object: "webhook_endpoint" (default: "webhook_endpoint")
对象类型,始终为 webhook_endpoint。
"webhook_endpoint"
signing_secret_hint: string or null
端点签名密钥的掩码提示。
url: string
接收 Webhook 投递的 HTTPS URL。
updated_at: optional integer
上次更改端点配置或签名密钥时的 Unix 时间戳。创建时初始化;测试以及未改变配置的更新不会推进此时间戳。
format: unixtime
示例
## 从环境变量读取 API 密钥;运行前替换 Webhook 端点 ID、URL 和名称占位值。
curl https://api.openai.com/v1/webhook_endpoints/$WEBHOOK_ENDPOINT_ID \
-X POST \
-H "Authorization: Bearer $OPENAI_API_KEY"
200:示例
{
"id": "id",
"created_at": 0,
"event_types": [
"string"
],
"name": "示例端点",
"object": "webhook_endpoint",
"signing_secret_hint": "signing_secret_hint",
"url": "url",
"updated_at": 0
}以上内容是否对您有帮助:

TRAE-AI编程


更多建议: