agentbase-docs

事件回调

这是什么 / 何时用

Webhooks 把项目事件推送到你的 HTTP 端点,用于服务端集成(与 Function 的事件触发是两条链路)。事件发生时平台向登记的 url 推送;security: true 时带签名头。

前置

使用骨架

webhooks.create({ webhookId, url, name, events, enabled, security, httpUser, httpPass }) 创建;list / get / update / delete 维护;updateSignature 轮换签名密钥。

关键参数与返回

错误与边界

各语言调用示例

凭据:项目 API Key(webhooks.* scope)或 Console Session;浏览器不可用,无 Web 页签。

import { Webhooks } from 'agentbase-node-sdk';

const webhooks = new Webhooks(client);
await webhooks.create({
    webhookId: 'wh_billing_events',
    url: 'https://example.com/hooks/agentbase',
    name: '计费事件回调',
    events: ['databases.tables.update', 'databases.collections.update'],
    enabled: true,
    security: true            // 平台推送带签名头,用返回的 signatureKey 校验来源
});
const list = await webhooks.list();   // get / update / delete 维护同一个 webhook
// 轮换签名密钥:webhooks.updateSignature(...)(REST 对应 PATCH /webhooks/{webhookId}/signature)

SDK 类别差异

事实源