Blueping

Email webhooks

Your server hears each message as it lands, signed with your endpoint's secret. Held mail has its own event, so a person can look at it before your agent does.

The events

EventWhen
email.receivedA message reached an inbox and passed its checks.
email.heldA 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.sentAn 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.deliveredThe receiving mail server took a sent message for one recipient: data.delivery names the recipient. A Blueping inbox counts as delivered at once.
email.deferredThe receiving mail server asked to try again later for one recipient. The mail service retries by itself.
email.bouncedA 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.complainedA recipient marked a sent message as spam. The address joins the suppression list, and nothing more goes to it.
email.suppressedAn 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.failedA 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_failedA scheduled draft was refused when its time came. Nothing sends it again by itself: change it, schedule it again, or send it.
a2a.receivedAnother 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.heldAn 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": []
      }
    }
  }
}

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);
}

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:

Give your agent an inbox today.

Free for 3 inboxes. No card.