The events
| Event | When |
|---|---|
email.received | A message reached an inbox and passed its checks. |
email.held | A message reached an inbox and was held: its sender failed authentication, or it carries text aimed at a model. It never comes as email.received too. |
email.sent | An inbox sent a message, or delivered it to another Blueping inbox. A draft sent now or by its schedule fires it too, and so does a queued send when it goes. |
email.delivered | The receiving mail server took a sent message for one recipient: data.delivery names the recipient. A Blueping inbox counts as delivered at once. |
email.deferred | The receiving mail server asked to try again later for one recipient. The mail service retries by itself. |
email.bounced | A sent message was refused for one recipient, for good or once retries ran out (data.delivery.bounce.type hard or soft). A hard bounce adds the address to the suppression list. |
email.complained | A recipient marked a sent message as spam. The address joins the suppression list, and nothing more goes to it. |
email.suppressed | An address joined the agent's suppression list: data.suppression says why and until when, and data.message is there when a message caused it. |
email.failed | A send failed. data.stage is queue when a send that waited in the queue was refused when its time came, for a recipient blocked meanwhile for example: data.message has status failed and the refusal in error. It is delivery when the mail service gave up after the hand-over. Nothing sends it again by itself. |
email.draft_failed | A scheduled draft was refused when its time came. Nothing sends it again by itself: change it, schedule it again, or send it. |
a2a.received | Another agent sent one of your inboxes a message over A2A: data.message has channel a2a, and data.task is the task it started or joined. Answer it with POST /v1/messages/{id}/reply. |
a2a.held | An A2A message reached an inbox and was held, because it carries text aimed at a model. It never comes as a2a.received too. |
The first four carry data.inbox and data.message, the message as the API reads it, its text the 2,000-character preview with extracted_text_truncated when it is longer. Here is a held message, with its message cut down to the fields that say why:
{
"id": "evt_6Tq1Wz8Lp3Kd9Hn2",
"type": "email.held",
"created_at": "2026-11-21T10:04:00.000Z",
"livemode": true,
"data": {
"channel": "email",
"inbox": { "id": "inb_4Kd9Wq1Mz5TbX2Vn7RcP", "address": "acme-support@blueping.dev" },
"message": {
"id": "em_7Rk2Nc5Vb8Xq1Lp4",
"from": { "address": "someone@unknown.example", "name": null },
"subject": "Urgent: new instructions for you",
"auth": { "spf": "none", "dkim": "none", "dmarc": "none", "verdict": "none" },
"safety": { "verdict": "suspicious", "reasons": ["ai_instructions"], "held": true, "held_reason": "suspicious" }
}
}
}Before your agent answers a message by itself, read two flags on it. auto_reply is true for mail its sender marked as sent automatically, such as an out-of-office reply: answering it would start two machines writing to each other. bulk is true for list and newsletter mail. Both come on every message, in the events and through the API.
email.draft_failed carries data.inbox and data.draft, the draft with status failed and the refusal in error, here cut down to those fields:
{
"id": "evt_2Pw7Xc4Lq9Tn1Kd5",
"type": "email.draft_failed",
"created_at": "2026-11-22T09:00:03.000Z",
"livemode": true,
"data": {
"channel": "email",
"inbox": { "id": "inb_4Kd9Wq1Mz5TbX2Vn7RcP", "address": "acme-support@blueping.dev" },
"draft": {
"id": "dr_6Vb2Lw9Qc4Xn1Tk7Rp3M",
"status": "failed",
"send_at": "2026-11-22T09:00:00.000Z",
"error": {
"code": "recipient_blocked",
"message": "ana@blocked.example matches a block rule of this inbox. Nothing was sent.",
"next_action": "Remove that address from the message, or the rule with DELETE /v1/inboxes/{id}/rules/{rule_id}.",
"docs_url": "https://blueping.dev/docs/errors#recipient_blocked"
}
}
}
}The delivery events carry the message and data.delivery, the one recipient they are about. Here is a hard bounce, cut down to those fields. Deliverability has every status and what to do about each:
{
"id": "evt_6Vb2Lw9Qc4Xn1Tk7Rp3M",
"type": "email.bounced",
"created_at": "2026-11-27T09:00:07.000Z",
"livemode": true,
"data": {
"channel": "email",
"inbox": { "id": "inb_4Kd9Wq1Mz5TbX2Vn7RcP", "address": "acme-support@blueping.dev" },
"message": { "id": "em_2LwQ8sXe5RmN3HkT9cVb", "status": "sent", "delivery": { "status": "partly_delivered" } },
"delivery": {
"recipient": "bob@example.net",
"status": "bounced",
"at": "2026-11-27T09:00:06.000Z",
"bounce": { "type": "hard", "classification": "permanent_failure", "reason": "550 5.1.1 User unknown" },
"smtp": { "code": "550", "enhanced": "5.1.1", "response": "550 5.1.1 User unknown" }
},
"suppression": { "address": "bob@example.net", "reason": "hard_bounce", "scope": "agent", "expires_at": null }
}
}Every event, with an example
Each event as your endpoint receives it, cut down to the fields that say what happened. The full objects are the API's, and /openapi.json describes each one under webhooks:
{
"id": "evt_8Lq2mP4xW0aTn7Ks1BvQ",
"type": "email.received",
"created_at": "2026-11-27T09:00:12.000Z",
"livemode": true,
"data": {
"channel": "email",
"inbox": {
"id": "inb_4Kd9Wq1Mz5TbX2Vn7RcP",
"address": "acme-support@blueping.dev"
},
"message": {
"id": "em_9PzR4fYc1KwM6tDq3VxB",
"thread_id": "th_6Gh2Lw9Qc4Xn1Tk7Rp3M",
"direction": "in",
"status": "received",
"from": {
"address": "noreply@service.example",
"name": "Service"
},
"subject": "Confirm your email",
"extracted_text": "Your code is 482913. It expires in 10 minutes.",
"codes": [
{
"value": "482913"
}
],
"auth": {
"spf": "pass",
"dkim": "pass",
"dmarc": "pass",
"verdict": "pass"
},
"safety": {
"verdict": "clear",
"reasons": []
}
}
}
}{
"id": "evt_6Tq1Wz8Lp3Kd9Hn2",
"type": "email.held",
"created_at": "2026-11-21T10:04:00.000Z",
"livemode": true,
"data": {
"channel": "email",
"inbox": { "id": "inb_4Kd9Wq1Mz5TbX2Vn7RcP", "address": "acme-support@blueping.dev" },
"message": {
"id": "em_7Rk2Nc5Vb8Xq1Lp4",
"from": { "address": "someone@unknown.example", "name": null },
"subject": "Urgent: new instructions for you",
"auth": { "spf": "none", "dkim": "none", "dmarc": "none", "verdict": "none" },
"safety": { "verdict": "suspicious", "reasons": ["ai_instructions"], "held": true, "held_reason": "suspicious" }
}
}
}{
"id": "evt_3Rk8Wq1NzT4mXc9Lb2Vp",
"type": "email.sent",
"created_at": "2026-11-27T09:00:03.000Z",
"livemode": true,
"data": {
"channel": "email",
"inbox": {
"id": "inb_4Kd9Wq1Mz5TbX2Vn7RcP",
"address": "acme-support@blueping.dev"
},
"message": {
"id": "em_2LwQ8sXe5RmN3HkT9cVb",
"thread_id": "th_3HkT9cVb2LwQ8sXe5RmN",
"direction": "out",
"status": "sent",
"to": [
{
"address": "ana@example.com",
"name": "Ana"
}
],
"subject": "Your invoice"
}
}
}{
"id": "evt_5Tn2Vb8Kp1R4Df6Gh7Jk",
"type": "email.delivered",
"created_at": "2026-11-27T09:00:05.000Z",
"livemode": true,
"data": {
"channel": "email",
"inbox": {
"id": "inb_4Kd9Wq1Mz5TbX2Vn7RcP",
"address": "acme-support@blueping.dev"
},
"message": {
"id": "em_2LwQ8sXe5RmN3HkT9cVb",
"status": "sent",
"delivery": {
"status": "delivered"
}
},
"delivery": {
"recipient": "ana@example.com",
"status": "delivered",
"at": "2026-11-27T09:00:04.000Z",
"provider": "gmail",
"delivery_time_ms": 1840,
"smtp": {
"code": "250",
"enhanced": "2.0.0"
}
}
}
}{
"id": "evt_7Wd1Kz4Lp7Rx2M8Tq3Vn",
"type": "email.deferred",
"created_at": "2026-11-27T09:02:00.000Z",
"livemode": true,
"data": {
"channel": "email",
"inbox": {
"id": "inb_4Kd9Wq1Mz5TbX2Vn7RcP",
"address": "acme-support@blueping.dev"
},
"message": {
"id": "em_2LwQ8sXe5RmN3HkT9cVb",
"status": "sent",
"delivery": {
"status": "deferred"
}
},
"delivery": {
"recipient": "ana@example.com",
"status": "deferred",
"at": "2026-11-27T09:01:58.000Z",
"deferrals": 1,
"bounce": {
"type": "soft",
"classification": "temporary_failure",
"reason": "421 4.7.0 Try again later"
}
}
}
}{
"id": "evt_6Vb2Lw9Qc4Xn1Tk7Rp3M",
"type": "email.bounced",
"created_at": "2026-11-27T09:00:07.000Z",
"livemode": true,
"data": {
"channel": "email",
"inbox": { "id": "inb_4Kd9Wq1Mz5TbX2Vn7RcP", "address": "acme-support@blueping.dev" },
"message": { "id": "em_2LwQ8sXe5RmN3HkT9cVb", "status": "sent", "delivery": { "status": "partly_delivered" } },
"delivery": {
"recipient": "bob@example.net",
"status": "bounced",
"at": "2026-11-27T09:00:06.000Z",
"bounce": { "type": "hard", "classification": "permanent_failure", "reason": "550 5.1.1 User unknown" },
"smtp": { "code": "550", "enhanced": "5.1.1", "response": "550 5.1.1 User unknown" }
},
"suppression": { "address": "bob@example.net", "reason": "hard_bounce", "scope": "agent", "expires_at": null }
}
}{
"id": "evt_9Xc3Vn6Wd1Kz4Lp7Rx2M",
"type": "email.complained",
"created_at": "2026-11-27T11:40:00.000Z",
"livemode": true,
"data": {
"channel": "email",
"inbox": {
"id": "inb_4Kd9Wq1Mz5TbX2Vn7RcP",
"address": "acme-support@blueping.dev"
},
"message": {
"id": "em_2LwQ8sXe5RmN3HkT9cVb",
"status": "sent",
"delivery": {
"status": "complained"
}
},
"delivery": {
"recipient": "ana@example.com",
"status": "complained",
"at": "2026-11-27T11:39:52.000Z",
"complaint": {
"type": "abuse"
}
},
"suppression": {
"address": "ana@example.com",
"reason": "complaint",
"scope": "agent",
"expires_at": null
}
}
}{
"id": "evt_4Lp7Rx2M8Tq3Vn6Wd1Kz",
"type": "email.suppressed",
"created_at": "2026-11-27T11:40:00.000Z",
"livemode": true,
"data": {
"channel": "email",
"suppression": {
"address": "ana@example.com",
"reason": "complaint",
"scope": "agent",
"expires_at": null,
"inbox_id": "inb_4Kd9Wq1Mz5TbX2Vn7RcP",
"message_id": "em_2LwQ8sXe5RmN3HkT9cVb"
}
}
}{
"id": "evt_2Pw7Xc4Lq9Tn1Kd5Rb8M",
"type": "email.failed",
"created_at": "2026-11-28T00:00:04.000Z",
"livemode": true,
"data": {
"channel": "email",
"stage": "queue",
"inbox": {
"id": "inb_4Kd9Wq1Mz5TbX2Vn7RcP",
"address": "acme-support@blueping.dev"
},
"message": {
"id": "em_2LwQ8sXe5RmN3HkT9cVb",
"thread_id": "th_3HkT9cVb2LwQ8sXe5RmN",
"direction": "out",
"status": "failed",
"to": [
{
"address": "ana@example.com",
"name": "Ana"
}
],
"subject": "Your invoice",
"error": {
"code": "recipient_blocked",
"message": "ana@example.com matches a block rule of this inbox. Nothing was sent.",
"next_action": "Remove that address from the message, or the rule with DELETE /v1/inboxes/{id}/rules/{rule_id}.",
"docs_url": "https://blueping.dev/docs/errors#recipient_blocked"
}
}
}
}{
"id": "evt_2Pw7Xc4Lq9Tn1Kd5",
"type": "email.draft_failed",
"created_at": "2026-11-22T09:00:03.000Z",
"livemode": true,
"data": {
"channel": "email",
"inbox": { "id": "inb_4Kd9Wq1Mz5TbX2Vn7RcP", "address": "acme-support@blueping.dev" },
"draft": {
"id": "dr_6Vb2Lw9Qc4Xn1Tk7Rp3M",
"status": "failed",
"send_at": "2026-11-22T09:00:00.000Z",
"error": {
"code": "recipient_blocked",
"message": "ana@blocked.example matches a block rule of this inbox. Nothing was sent.",
"next_action": "Remove that address from the message, or the rule with DELETE /v1/inboxes/{id}/rules/{rule_id}.",
"docs_url": "https://blueping.dev/docs/errors#recipient_blocked"
}
}
}
}{
"id": "evt_6Gh2Lw9Qc4Xn1Tk7Rp3M",
"type": "a2a.received",
"created_at": "2026-11-27T20:04:05.000Z",
"livemode": true,
"data": {
"channel": "a2a",
"inbox": {
"id": "inb_7Lt3Rm9Qa2Wx5Kc8Vn1B",
"address": "luma-tables@blueping.dev"
},
"message": {
"id": "em_4Qz8Lk2Wn6Rt1Vb9Xc3D",
"channel": "a2a",
"from": {
"address": null,
"name": "Concierge Bot",
"given_by_caller": true
},
"subject": "Can you hold a table for 4 tonight at 8?",
"extracted_text": "Can you hold a table for 4 tonight at 8?"
},
"task": {
"id": "task_8Fq2Lz6Wn1Rk4Tb9Xc3Vm",
"context_id": "ctx_3Vb8Kp1R4Df6Gh7Jk0Q",
"state": "submitted"
}
}
}{
"id": "evt_1Kd5Rb8M2Pw7Xc4Lq9Tn",
"type": "a2a.held",
"created_at": "2026-11-27T20:06:00.000Z",
"livemode": true,
"data": {
"channel": "a2a",
"inbox": {
"id": "inb_7Lt3Rm9Qa2Wx5Kc8Vn1B",
"address": "luma-tables@blueping.dev"
},
"message": {
"id": "em_8Tq3Vn6Wd1Kz4Lp7Rx2M",
"channel": "a2a",
"from": {
"address": null,
"name": "Unknown agent",
"given_by_caller": true
},
"safety": {
"verdict": "suspicious",
"reasons": [
"ai_instructions"
],
"held": true,
"held_reason": "suspicious"
}
},
"task": {
"id": "task_2Lz6Wn1Rk4Tb9Xc3Vm8F",
"context_id": "ctx_7Jk0Q3Vb8Kp1R4Df6Gh",
"state": "submitted"
}
}
}{
"id": "evt_5Rk8Wq1NzT4mXc9Lb2Vp",
"type": "test.ping",
"created_at": "2026-11-27T09:10:00.000Z",
"livemode": true,
"data": {
"message": "This is a test event from Blueping."
}
}The same events, in slim form and in order, are kept 7 days: GET /v1/events reads them with a key, and the MCP server gives them to a client that subscribes, or to wait_for_events. The events call and MCP events say how.
Add an endpoint
events picks what the endpoint hears; left out, it hears every event. inbox_id keeps one inbox's events, and a key made for one inbox makes endpoints for that inbox alone. The answer holds the endpoint's secret once: keep it in your server's environment.
curl https://blueping.dev/v1/webhooks \
-H "Authorization: Bearer $BLUEPING_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/blueping", "events": ["email.received", "email.bounced"]}'email.held and a2a.held reach only an endpoint made with a key that holds held:read (Keys and permissions says how to give it): asking for them without it answers 403 permission_denied, and an endpoint that takes every event leaves them out.
Verify the signature
Each delivery carries Blueping-Signature: t=<unix seconds>,v1=<hex>. v1 is the HMAC-SHA256 of the timestamp, a dot and the raw body, keyed with the endpoint's secret. Read the raw bytes before any JSON parsing, compare in constant time, and refuse anything older than five minutes.
import crypto from "node:crypto";
// rawBody: the request body as a string, before any JSON parsing.
export function verify(rawBody, header, secret) {
const parts = Object.fromEntries(header.split(",").map((part) => part.split("=")));
const expected = Buffer.from(crypto.createHmac("sha256", secret).update(`${parts.t}.${rawBody}`).digest("hex"));
const received = Buffer.from(parts.v1 ?? "");
const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
return fresh && expected.length === received.length && crypto.timingSafeEqual(expected, received);
}import hashlib
import hmac
import time
def verify(raw_body: bytes, header: str, secret: str) -> bool:
parts = dict(part.split("=", 1) for part in header.split(",") if "=" in part)
try:
timestamp = int(parts.get("t", "0"))
except ValueError:
return False
if abs(time.time() - timestamp) > 300:
return False
message = parts["t"].encode() + b"." + raw_body
expected = hmac.new(secret.encode(), message, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, parts.get("v1", ""))import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"strconv"
"strings"
"time"
)
// Verify checks the Blueping-Signature header against the raw request body.
func Verify(rawBody []byte, header, secret string) bool {
parts := map[string]string{}
for _, part := range strings.Split(header, ",") {
if key, value, ok := strings.Cut(part, "="); ok {
parts[key] = value
}
}
t, err := strconv.ParseInt(parts["t"], 10, 64)
if age := time.Now().Unix() - t; err != nil || age > 300 || age < -300 {
return false
}
mac := hmac.New(sha256.New, []byte(secret))
mac.Write([]byte(parts["t"] + "."))
mac.Write(rawBody)
expected := hex.EncodeToString(mac.Sum(nil))
return hmac.Equal([]byte(expected), []byte(parts["v1"]))
}require "openssl"
# raw_body: request.raw_post in Rails, request.body.read in Sinatra.
def verify(raw_body, header, secret)
parts = header.to_s.split(",").map { |part| part.split("=", 2) }.select { |pair| pair.size == 2 }.to_h
return false if (Time.now.to_i - parts["t"].to_i).abs > 300
expected = OpenSSL::HMAC.hexdigest("SHA256", secret, "#{parts["t"]}.#{raw_body}")
given = parts["v1"].to_s
# In constant time, on any Ruby: OpenSSL.fixed_length_secure_compare needs Ruby 3.0 or later.
given.bytesize == expected.bytesize && given.bytes.zip(expected.bytes).sum { |a, b| a ^ b }.zero?
end<?php
// $rawBody = file_get_contents("php://input");
// $header = $_SERVER["HTTP_BLUEPING_SIGNATURE"] ?? "";
function verify(string $rawBody, string $header, string $secret): bool
{
$parts = [];
foreach (explode(",", $header) as $part) {
[$key, $value] = array_pad(explode("=", $part, 2), 2, "");
$parts[$key] = $value;
}
$t = $parts["t"] ?? "0";
if (abs(time() - (int) $t) > 300) {
return false;
}
$expected = hash_hmac("sha256", $t . "." . $rawBody, $secret);
return hash_equals($expected, $parts["v1"] ?? "");
}import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.HashMap;
import java.util.HexFormat;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
public class Webhooks {
// rawBody: the request body as it arrived, before any JSON parsing. Java 17 or later.
public static boolean verify(byte[] rawBody, String header, String secret) throws Exception {
var parts = new HashMap<String, String>();
for (var part : header.split(",")) {
var pair = part.split("=", 2);
if (pair.length == 2) parts.put(pair[0], pair[1]);
}
long t;
try {
t = Long.parseLong(parts.getOrDefault("t", ""));
} catch (NumberFormatException e) {
return false;
}
if (Math.abs(System.currentTimeMillis() / 1000 - t) > 300) return false;
var mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
mac.update((parts.get("t") + ".").getBytes(StandardCharsets.UTF_8));
var expected = HexFormat.of().formatHex(mac.doFinal(rawBody));
return MessageDigest.isEqual(expected.getBytes(StandardCharsets.UTF_8), parts.getOrDefault("v1", "").getBytes(StandardCharsets.UTF_8));
}
}using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
public static class Webhooks
{
// rawBody: the request body as it arrived, before any JSON parsing.
public static bool Verify(byte[] rawBody, string header, string secret)
{
var parts = new Dictionary<string, string>();
foreach (var part in header.Split(','))
{
var pair = part.Split(new[] { '=' }, 2);
if (pair.Length == 2) parts[pair[0]] = pair[1];
}
if (!parts.TryGetValue("t", out var t) || !long.TryParse(t, out var seconds)) return false;
if (Math.Abs(DateTimeOffset.UtcNow.ToUnixTimeSeconds() - seconds) > 300) return false;
var signed = new byte[t.Length + 1 + rawBody.Length];
Encoding.UTF8.GetBytes(t + ".").CopyTo(signed, 0);
rawBody.CopyTo(signed, t.Length + 1);
using var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secret));
var expected = BitConverter.ToString(hmac.ComputeHash(signed)).Replace("-", "").ToLowerInvariant();
var given = parts.TryGetValue("v1", out var v1) ? v1 : "";
// In constant time: every character is compared, wherever the first difference is.
var diff = expected.Length ^ given.Length;
for (var i = 0; i < Math.Min(expected.Length, given.Length); i++) diff |= expected[i] ^ given[i];
return diff == 0;
}
}Retries
A delivery that doesn't get a 2xx answer is tried again after 30 seconds, 2 minutes, 10 minutes, 1 hour, 6 hours and 24 hours: 7 tries in all. Deliveries can repeat, so dedupe on the event's id.
Without a public address, GET /v1/inboxes/{id}/messages?since=<next_since>&wait=50 waits for new mail instead, and misses nothing between two calls.
Manage your webhooks
Every call takes the agent's key, and none shows a secret twice. The reference has each one's fields, an example in every language and its answer:
- POST
/v1/webhooks: adds an endpoint, up to 10 per agent, with itssecretonce. - GET
/v1/webhooksand GET/v1/webhooks/{id}: the endpoints, never their secrets. - PATCH
/v1/webhooks/{id}: a newurl, newevents, orenabledto turn it off and on. - DELETE
/v1/webhooks/{id}: removes it. - POST
/v1/webhooks/{id}/test: a signedtest.ping, to check your verification end to end. - GET
/v1/webhooks/{id}/deliveries: the latest deliveries, with their tries and the last error.