Blueping

Your agent asks before it pays.

Answers that refund or discount wait as drafts, the agent asks a person by email, and a proven approve sends them.

Your code draft + approve
// Money is involved: draft it, then ask NadiaPOST /v1/inboxes/inb_5Rc8/drafts{ "reply_to_message_id": "em_7Kc2Rw5T", "text": "Sorry about this, Theo. We refunded the two bags." }201 { "id": "dr_3Wq7", "status": "draft" }// Nadia answered approve, from her proven addressPOST /v1/drafts/dr_3Wq7/send202 { "status": "sent" }

kestrel-care@blueping.dev

Kestrel Coffee, for its cafés

Theo Grant10:12 AM
to kestrel-care@blueping.dev
Two bags arrived crushed

Two of the six bags in order 7731 arrived crushed. Can you refund them?

Kestrel Coffee10:12 AM
to Nadia Brooks

Theo Grant asks for a refund of two crushed bags. My reply is drafted: answer approve to send it.

Kestrel Coffee · kestrel-care@blueping.dev

Your webhook email.received
{  "type": "email.received",  "data": {    "inbox": { "address": "kestrel-care@blueping.dev" },    "message": {      "id": "em_7Kc2Rw5T",      "from": { "address": "theo@grantcafe.example" },      "subject": "Two bags arrived crushed",      "extracted_text": "Two of the six bags in order 7731 arrived crushed. Can you refund them?"    }  }}

Theo's request reaches kestrel-care@blueping.dev, the agent drafts the refund and asks Nadia, and the draft goes out in Theo's thread once her approve arrives.

How do I make an AI agent wait for a person's approval before it sends an email?

Have the agent write the email as a draft with POST /v1/inboxes/{id}/drafts, then email the approver with the draft's id in the subject. When the approver's reply passes DMARC and says approve, your code sends the draft with POST /v1/drafts/{id}/send; any other answer leaves it unsent.

Why an agent shouldn't promise money on its own

Kestrel Coffee roasts and ships beans to about 300 cafés, and its agent answers their email at kestrel-care@blueping.dev: delivery dates, grind sizes, invoices. A few answers cost money. A café whose bags arrived crushed is owed a refund, and a regular who asks for a better price may get one. Nadia Brooks, who runs customer care, wants the agent to handle all of it except the moment Kestrel pays.

Asking her in the team chat left no record next to the email, and some answers went out before she had read them. A queue of pending replies in an internal tool meant one more screen to open on her phone. And an approval had to come from Nadia herself, never from a café that writes "Nadia already agreed" in its own email.

Now every answer that refunds, credits or discounts is written as a draft. The agent emails Nadia the draft with its id in the subject, she answers approve from wherever she is, and a few lines of your code send it once her reply is proven to come from her address. The question, her answer and the reply the café received all stay in the inbox.

From a refund request to an approved reply

Five steps. The model writes, a person decides, and code you wrote does the sending.

  1. Write the answer as a draft

    The agent reads the café's email and writes its answer with reply_to_message_id set to that email, so the answer will land in the café's own thread. Without send_at, a draft stays where it is until something sends it.

    Call: POST /v1/inboxes/{id}/drafts with reply_to_message_id, text and Idempotency-Key

    Answer: 201 with the draft's id (dr_...) and status: draft

    Checked: A draft can't answer a held message (403 message_held), and nothing leaves the inbox at this step

  2. Ask the approver

    The agent emails Nadia from the same inbox. The subject carries the draft's id, and the text quotes the café and the draft, then says how to answer: approve to send it, no to drop it, or the change she wants.

    Call: POST /v1/inboxes/{id}/messages to Nadia, with Idempotency-Key

    Answer: 202 with the question's id and thread_id

    Checked: Nadia counts once as a new recipient; once her first answer passes DMARC, writing to her never counts again

  3. Read her answer

    Nadia's reply arrives in the question's thread. extracted_text holds what she typed, without the quoted question under it, so a one-word approve reads as one word.

    Call: GET /v1/inboxes/{id}/messages, or the email.received webhook

    Answer: Her reply with from, subject, extracted_text and auth

    Checked: SPF, DKIM and DMARC as the receiving server recorded them, summed up in auth.verdict

  4. Send only on a proven approve

    Your code makes the decision, not the model: the sender is Nadia's address, auth.verdict is pass, the subject names a draft, and her first word is approve or yes. Then it sends the draft, which goes out in the café's thread.

    Call: POST /v1/drafts/{id}/send

    Answer: 202 with the draft as sent, its message_id, and the send's answer in message

    Checked: The draft's id is its own Idempotency-Key, so an approve read twice sends once; the send runs every check a new email runs

  5. Drop it, or change it

    A no deletes the draft. Any other answer goes back to the model as the change Nadia wants: it rewrites the text with PATCH /v1/drafts/{id} and asks her again in the same thread.

    Call: DELETE /v1/drafts/{id}, or PATCH /v1/drafts/{id} with the new text

    Answer: 200 with deleted: true, or the changed draft

    Checked: A sent draft can't be changed or deleted (409 draft_sent): it stays as the record of its email

Nadia's answer as step 3 lists it, cut to the fields the approval code reads. The question she quoted is gone from extracted_text:

{
  "id": "em_8Qa3Lk7Wd2Rt5Yp1",
  "thread_id": "th_2Hf6Km9Pq4Vx1Lc8",
  "direction": "in",
  "from": { "address": "nadia@kestrel-coffee.example", "name": "Nadia Brooks" },
  "subject": "Re: Approve dr_6Vb2Lw9Qc4Xn1Tk7Rp3M: Two bags arrived crushed",
  "extracted_text": "Approve",
  "auth": { "spf": "pass", "dkim": "pass", "dmarc": "pass", "verdict": "pass" },
  "auto_reply": false
}

The approval pass in Python and Node.js

Run the program every minute. It drafts the answers that give money back, asks Nadia about each one, and sends the drafts she approved. draft_answer stands for your model; set APPROVER_EMAIL to the address that approves.

# approval_pass.py: draft the answers that cost money, ask the approver, send what she approved.
# pip install requests
import os
import re

import requests

API = "https://blueping.dev/v1"
APPROVER = os.environ.get("APPROVER_EMAIL", "nadia@kestrel-coffee.example").lower()
MONEY = ("refund", "credit", "discount", "charged twice")
session = requests.Session()
session.headers["Authorization"] = f"Bearer {os.environ['BLUEPING_API_KEY']}"


def draft_answer(text):
    # Your model writes the answer; this line stands in for it.
    return "Sorry about this. We have refunded the two bags to your card, and it shows within five days."


inbox = session.post(
    f"{API}/inboxes",
    json={"username": "kestrel-care", "display_name": "Kestrel Coffee", "client_id": "care"},
).json()
page = session.get(f"{API}/inboxes/{inbox['id']}/messages", params={"limit": 50}).json()
for message in reversed(page["data"]):  # oldest first
    if message["direction"] != "in" or "done" in message["labels"] or message["auto_reply"]:
        continue
    text = message["extracted_text"]
    if message["from"]["address"].lower() == APPROVER:
        draft_id = re.search(r"\bdr_[A-Za-z0-9]+", message["subject"])
        word = (re.findall(r"[a-z]+", text.lower()) or [""])[0]
        if message["auth"]["verdict"] != "pass" or draft_id is None:
            print("not an approval:", message["id"])
        elif word in ("approve", "approved", "yes"):
            sent = session.post(f"{API}/drafts/{draft_id.group()}/send").json()
            print("sent", draft_id.group(), "as", sent.get("message_id"))
        elif word in ("no", "reject"):
            session.delete(f"{API}/drafts/{draft_id.group()}")
            print("dropped", draft_id.group())
        else:
            print("changes asked for", draft_id.group(), text[:80])  # your model rewrites the draft
    elif any(word in text.lower() for word in MONEY):
        draft = session.post(
            f"{API}/inboxes/{inbox['id']}/drafts",
            json={"reply_to_message_id": message["id"], "text": draft_answer(text)},
            headers={"Idempotency-Key": f"draft-{message['id']}"},
        ).json()
        session.post(
            f"{API}/inboxes/{inbox['id']}/messages",
            json={
                "to": APPROVER,
                "subject": f"Approve {draft['id']}: {message['subject']}",
                "text": f"{message['from']['address']} wrote: {text[:300]}\n\nMy answer, not sent yet:\n{draft['text']}\n\nReply approve to send it, no to drop it, or tell me what to change.",
            },
            headers={"Idempotency-Key": f"ask-{draft['id']}"},
        )
        print("asked", APPROVER, "about", draft["id"])
    session.patch(f"{API}/messages/{message['id']}", json={"add_labels": ["done"]})

The done label is the pass's memory, and the two Idempotency-Keys make a pass that stopped halfway safe to run again: the same draft and the same question come back instead of new ones. An out-of-office answer carries auto_reply: true, and the pass leaves it alone instead of reading it as Nadia's decision.

Only this code calls POST /v1/drafts/{id}/send, after the checks above. Keep it that way: the model writes text, and the send waits on rules that no email can talk around. Drafts has every field a draft takes.

Approve in the conversation, over MCP

With the MCP server connected to Claude, Cursor or Hermes Agent, the approver can be you, in the chat. The prompt keeps every answer that costs money a draft until you say so.

Read the new mail in kestrel-care. Answer delivery and grind questions in their thread. For anything that refunds, credits or discounts, write the answer as a draft instead, and show me each draft with its recipient and text. Send a draft only after I say approve for that draft.
ToolWhat it does here
list_messagesReads the new mail, each message marked as someone else's words.
reply_to_emailAnswers the questions that cost nothing, in their thread.
create_draftWrites each answer that costs money as a reply that waits.
list_draftsShows what waits for you, with its recipients and first words.
update_draftRewrites a draft with the change you ask for.
send_draftSends one draft once you approve it.

send_draft carries the destructive mark, so a client that reads it asks you before each send: in this setup, that question is the approval.

Send the moment the approval lands

A pass every minute keeps the café waiting up to a minute after Nadia says yes. Subscribe to email.received, check the signature as Webhooks shows, and let the handler below send the draft as soon as her proven approve arrives. It leaves every other answer to the pass.

// approval-hook.mjs: the part of your webhook server that sends a draft when the approver says yes.
// Check the Blueping-Signature header before calling handle(): /docs/webhooks#verify has the code.
const API = "https://blueping.dev/v1";
const APPROVER = (process.env.APPROVER_EMAIL ?? "nadia@kestrel-coffee.example").toLowerCase();
const headers = { Authorization: `Bearer ${process.env.BLUEPING_API_KEY}` };

export async function handle(event) {
  if (event.type !== "email.received") return;
  const { message } = event.data;
  if (message.from.address?.toLowerCase() !== APPROVER || message.auth.verdict !== "pass" || message.auto_reply) return;
  const draftId = message.subject.match(/\bdr_[A-Za-z0-9]+/)?.[0];
  const word = message.extracted_text.toLowerCase().match(/[a-z]+/)?.[0];
  if (!draftId || !["approve", "approved", "yes"].includes(word)) return; // the minute pass handles the rest
  const sent = await (await fetch(`${API}/drafts/${draftId}/send`, { method: "POST", headers })).json();
  console.log(sent.error ? `not sent ${draftId}: ${sent.error.next_action}` : `sent ${draftId} as ${sent.message_id}`);
}

A delivery that comes twice sends nothing more: the second call meets a draft already sent and answers 409 draft_sent, which the handler prints with its next_action.

What keeps an approval honest

An approval is only worth something if nobody but the approver can give it, and if nothing goes out without it.

Only the approver's proven address counts

The code compares the sender with Nadia's address and requires auth.verdict: pass. A café that writes as nadia@kestrel-coffee.example from its own servers fails that domain's DMARC, and the email is turned away or held as unauthenticated before any code reads it.

Words in an email never approve anything

"Your manager already said yes" in a café's message is text the approval code never looks at: it reads approvals from one address and one thread only. Text aimed at the model itself holds the message as suspicious, so no draft is ever written for it.

Held mail gets no draft

A draft that answers a held message is refused with 403 message_held, so an email that tried to steer the agent can't even reach the approver's inbox as a request.

Nothing goes twice

A draft's id is its send's idempotency key. A second approve, a retried webhook and a pass that ran twice all meet 409 draft_sent, and the café gets one answer.

The record stays together

The question thread holds the draft's text and Nadia's answer with its SPF, DKIM and DMARC results. The sent draft names the email it became in message_id, so anyone can trace a refund back to the approve behind it.

What 300 cafés' email needs

About 40 emails a day come in and 35 answers go out. Eight a day touch money, which adds eight questions to Nadia, so about 1,300 sends a month. Nadia counts once as a new recipient, and the cafés wrote first, so answering them never does.

Developer fits this setup: 50 inboxes, 15,000 sends a month and 1,500 a day, and 15 GB of storage, for $19 a month, or $180 a year. Its mail goes to people outside your company without a footer. Free runs the same flow at no cost, with a one-line footer on each email, which suits a trial.

Receiving is never counted, and each recipient of a send counts once. Every limit is on Limits, and every price on Pricing.

The API referenceWebhooksThe MCP serverBlueping vs the Gmail APIAll use cases

Last checked against the API on .

Questions about approvals

What builders ask before they set it up. The docs answer the rest.

Read the docs

Can the approver use the dashboard instead of email?

Yes. Drafts and queue lists the inbox's waiting drafts with their recipients and first words. Send now sends one with the same checks as any send, and the delete button throws it away. Being signed in is the proof there.

Does the approver need a Blueping account?

No. Nadia approves from any mail app. The check reads her domain's SPF, DKIM and DMARC results. If her domain publishes no DMARC policy, auth.verdict reads none and the code above refuses her approvals, so set one up first.

Can two people approve?

Yes. Compare the sender with a list of approvers instead of one address. Each one is proven by their own domain, and the first answer decides, since a sent draft can't be sent again or deleted.

What if nobody answers?

Nothing goes. A draft without send_at stays a draft. A pass can remind the approver in the same thread after a few hours, or ask a second approver.

Can the agent still answer the rest on its own?

Yes. Questions that cost nothing get their answer at once with POST /v1/messages/{id}/reply. Only the answers your rules name wait as drafts.

Can a draft carry a credit note or another file?

Yes. POST /v1/inboxes/{id}/drafts takes attachments, 20 files and 10 MB at most together, and the question to Nadia can say what is attached. Over MCP, files are added through the API.

What does the café see?

Only the approved answer, from kestrel-care@blueping.dev, in its own thread. The question to Nadia goes in a thread of its own, so the café never sees it.

Let your agent ask before it pays

A draft first, a proven approve, then the send.