웹훅

기본 URL https://arteza.ai/api/v1

OpenAPI 3.1 사양, SDK 생성기 및 에이전트용: /api/v1/openapi.json

TypeScript 및 Python용 공식 SDK, 명령줄 및 에이전트 스킬: SDK 및 CLI

생성을 만들 때 webhook_url을 전달하면, 완료, 실패 또는 취소될 때 최종 생성을 POST합니다. URL은 공개 HTTPS여야 합니다.

모든 전송은 Standard Webhooks 스키마를 사용하여 webhook 시크릿으로 서명됩니다: 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시간 동안 지수 백오프를 사용하여 재시도합니다. 콘솔에서 모든 전달 기록을 확인하고 재전송할 수 있습니다.