ウェブフック
ベースURL https://arteza.ai/api/v1
OpenAPI 3.1 仕様、SDK ジェネレータとエージェント向け: /api/v1/openapi.json
TypeScriptとPythonの公式SDK、コマンドラインとエージェントスキル: SDKsおよびCLI
生成を作成するときにwebhook_urlを指定すると、完了、失敗、またはキャンセルされたときに最終的な生成をPOSTで送信します。URLは公開HTTPSである必要があります。
すべての配信はwebhook秘密鍵を使用してStandard Webhooksスキームで署名されます:webhook-id、webhook-timestamp、webhook-signatureヘッダー。ボディを信頼する前に署名を検証し、webhook-idを使用して重複を無視します。
import crypto from "node:crypto";
// secret: whsec_... from the console. body: the raw request body string.
export function verify(secret, headers, body) {
const id = headers["webhook-id"];
const ts = headers["webhook-timestamp"];
if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
const expected = crypto.createHmac("sha256", key).update(`${id}.${ts}.${body}`).digest("base64");
return headers["webhook-signature"].split(" ").some((s) => {
const sig = s.split(",")[1] ?? "";
return sig.length === expected.length && crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected));
});
}10 秒以内に任意の 2xx で応答してください。それ以外の場合、24 時間にわたってバックオフで再試行します。すべての配信はコンソールから確認でき、そこから再送信できます。