Webhooks

URL base https://arteza.ai/api/v1

Especificación OpenAPI 3.1, para generadores de SDK y agentes: /api/v1/openapi.json

SDKs oficiales para TypeScript y Python, una línea de comandos y skills para agentes: SDKs y CLI

Pasa webhook_url cuando creas una generación y haremos POST de la generación final a él cuando se complete, falle o se cancele. La URL debe ser HTTPS pública.

Cada entrega se firma con tu secreto de webhook usando el esquema Standard Webhooks: los headers webhook-id, webhook-timestamp y webhook-signature. Verifica la firma antes de confiar en el cuerpo e ignora duplicados con 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));
  });
}

Responde con cualquier 2xx dentro de diez segundos. Si no, reintenamos con backoff durante 24 horas. Puedes ver todas las entregas y reenviar una desde la consola.