Skip to main content
AgentMark webhooks allow you to integrate your prompts and datasets directly into your application. When you run a prompt or dataset in the AgentMark platform, it sends the request to your webhook endpoint, which executes it using your configured adapter and models, and returns the results. Test Webhook

How It Works

Each adapter (AI SDK, Claude Agent SDK, Mastra) provides a webhook handler via its /runner export. This handler implements a standard interface with two methods:
  • runPrompt() — execute a single prompt (text, object, image, or speech)
  • runExperiment() — run a prompt against a dataset
The AgentMark platform sends events to your webhook URL, and your handler processes them and returns results — either streamed or as JSON.

Key Features

  • Adapter-agnostic: Every adapter ships its own webhook handler — use whichever SDK you prefer
  • Streaming support: Real-time streaming for text and object generation
  • Signature verification: HMAC-SHA256 signature checking on every request
  • Dataset experiments: Run prompts against datasets with automatic eval scoring
  • Telemetry: Built-in tracing for all prompt and dataset executions

Generation Types

TypeAdaptersStreaming
TextAllYes
Object (structured JSON)AllYes
ImageAI SDK v4, AI SDK v5No
SpeechAI SDK v4, AI SDK v5No
The Claude Agent SDK and Mastra adapters do not support image or speech generation at this time.

Event Types

The webhook handles three event types:
EventDescription
prompt-runExecute a single prompt from the platform editor
dataset-runRun a prompt against a dataset for experiments
alertNotification when a cost, latency, or error-rate alert fires or resolves

Security

All webhook requests include an x-agentmark-signature-256 header containing an HMAC-SHA256 signature. Your endpoint should verify this signature using the webhook secret from your dashboard before processing the request.
import { verifySignature } from "@agentmark-ai/shared-utils";

const isValid = await verifySignature(
  process.env.AGENTMARK_WEBHOOK_SECRET!,
  request.headers.get("x-agentmark-signature-256")!,
  JSON.stringify(payload)
);

Getting Started

Have Questions?

We’re here to help! Choose the best way to reach us: