Priya, I'm copying my scheduling assistant to find 30 minutes next week.
Copy the agent, get the meeting.
People copy the agent on a thread, and it offers times to everyone, books the one they pick and sends the invitation.
// Offer three times to everyone in the threadPOST /v1/messages/em_3Fs8Kd1P/reply{ "text": "Hi Priya, Dana is free Monday at 9 AM …", "reply_all": true }202 { "status": "sent" }
dana-scheduling
Scheduling for Dana Whitfield
Hi Priya, Dana is free Monday at 9 AM, Tuesday at 2:30 PM or Wednesday at 11 AM. Which one suits you?
Dana's scheduling assistant · dana-scheduling
{ "type": "email.received", "data": { "inbox": { "address": "dana-scheduling@blueping.dev " }, "message": { "id": "em_3Fs8Kd1P", "from": { "name": "Dana Whitfield" }, "cc": [ { "address": "dana-scheduling@blueping.dev" } ], "subject": "Intro call next week" } }}
Dana copies dana-scheduling@blueping.dev on her thread with Priya, and the agent answers everyone in it with three free times.
How can an AI agent schedule meetings over email?
Give the scheduling agent an address people copy on their threads, have it offer free times to everyone with POST /v1/messages/{id}/reply and reply_all, and book the slot the other side picks with a calendar invitation attached. A draft with a send_at the day before sends the reminder by itself, and a reschedule request moves or cancels it.
Why scheduling by email eats a morning
Dana Whitfield runs a small advisory firm and books about 15 meetings a week with clients, candidates and investors. Each one takes a thread of four to six emails: someone asks for time, Dana offers slots, the other side picks one or proposes another, someone sends the invitation, and half the time a reschedule follows. Scheduling links help with strangers, but clients expect a reply from a person, in the thread they started.
A human assistant does this by being copied on the thread. An agent can do the same work in minutes, as long as it has an address people can copy, reads the whole thread with everyone in it, writes to all of them at once, and can schedule a reminder that goes by itself.
Dana writes "copying my assistant to find a time", copies dana-scheduling@blueping.dev, and moves on. The agent offers times to everyone, books the one they pick, attaches the calendar invitation and keeps track of the reminder until the meeting happens.
From a copied thread to a booked meeting
The agent reads the calendar and writes the emails; Blueping keeps the thread, the attachments and the scheduled reminder.
Give the assistant an address to copy
One inbox with a
display_namepeople recognize, such as Dana's scheduling assistant. Anyone in a thread can copy it, and its replies show that name.Call: POST
/v1/inboxeswithclient_idanddisplay_nameAnswer:
201withidandaddressChecked: The address receives at once; the display name can't pose as another company
Read the request with everyone in it
When a copied email arrives, the agent reads its thread: who asked, who else is in it, and whether it already offered times.
Call: GET
/v1/threads/{id}Answer: The thread's
subject,participantsandmessages, oldest first, each with itslabelsChecked: Held messages stay out of the thread's people and subject
Offer times to everyone
The agent replies to all with three free slots from the calendar, and labels its offer with the slots so the next step knows what was offered without keeping any state of its own.
Call: POST
/v1/messages/{id}/replywithreply_all: true, then PATCH/v1/messages/{id}Answer:
202with the offer'sid, then itslabelsChecked: The first message to someone who never wrote, such as the client copied by Dana, counts toward the ramp of new recipients
Book the slot they pick
When the client answers in the thread, the agent matches the time they wrote to the offered slots and replies to all with the confirmation and an
.icsinvitation attached, which calendar apps import.Call: POST
/v1/messages/{id}/replywithreply_allandattachmentsAnswer:
202with the confirmation'sidChecked: A client who wrote back is never a new recipient again
Schedule the reminder
A draft to the thread's participants with
send_atthe day before goes by itself. A reschedule request unschedules it withsend_at: null, or moves it.Call: POST
/v1/inboxes/{id}/draftswithto,reply_to_message_idandsend_atAnswer:
201withstatus: scheduledChecked: Between one minute and 30 days ahead; a refusal at send time fires
email.draft_failed
Step 2's answer for a request Dana copied the agent on, cut to the fields the assistant reads:
{
"id": "th_3HkT9cVb2LwQ8sXe5RmN",
"subject": "Intro call next week",
"participants": ["dana@whitfield-advisory.example", "priya@client-co.example"],
"message_count": 1,
"held_count": 0,
"labels": [],
"messages": [
{
"id": "em_9PzR4fYc1KwM6tDq3VxB",
"from": { "address": "dana@whitfield-advisory.example", "name": "Dana Whitfield" },
"to": [{ "address": "priya@client-co.example", "name": "Priya Raman" }],
"cc": [{ "address": "dana-scheduling@blueping.dev", "name": null }],
"extracted_text": "Priya, I'm copying my scheduling assistant to find 30 minutes next week.",
"labels": []
}
]
}The scheduling assistant in Python and Node.js
The program handles every new email in a copied thread once: a new request gets three offered times, an answer that names one of them gets the booking, the invitation and the reminder. free_slots() stands for your calendar API, and matching the time in the answer stands for your model.
# scheduler_pass.py: offer times to everyone in a meeting request, book the one they pick, remind them.
# pip install requests
import base64
import os
from datetime import datetime, timedelta, timezone
import requests
API = "https://blueping.dev/v1"
session = requests.Session()
session.headers["Authorization"] = f"Bearer {os.environ['BLUEPING_API_KEY']}"
def free_slots():
# Your calendar API stands in here: three 30-minute slots a week from now, in UTC.
start = (datetime.now(timezone.utc) + timedelta(days=7)).replace(hour=9, minute=0, second=0, microsecond=0)
return [start + timedelta(days=day, hours=2 * day) for day in range(3)]
def invitation(slot, subject):
stamp = lambda moment: moment.strftime("%Y%m%dT%H%M%SZ")
lines = [
"BEGIN:VCALENDAR", "VERSION:2.0", "PRODID:-//Example//Scheduler//EN", "BEGIN:VEVENT",
f"UID:{stamp(slot)}@scheduler.example", f"DTSTAMP:{stamp(datetime.now(timezone.utc))}",
f"DTSTART:{stamp(slot)}", f"DTEND:{stamp(slot + timedelta(minutes=30))}", f"SUMMARY:{subject}",
"END:VEVENT", "END:VCALENDAR", "",
]
data = base64.b64encode("\r\n".join(lines).encode()).decode()
return {"filename": "invite.ics", "content_type": "text/calendar", "content_base64": data}
def label(message_id, names):
session.patch(f"{API}/messages/{message_id}", json={"add_labels": names})
inbox = session.post(f"{API}/inboxes", json={"client_id": "scheduling", "display_name": "Dana's scheduling assistant"}).json()
page = session.get(f"{API}/inboxes/{inbox['id']}/messages", params={"limit": 50}).json()
for message in reversed(page["data"]):
if message["direction"] != "in" or any(name.startswith("sched:") for name in message["labels"]):
continue
thread = session.get(f"{API}/threads/{message['thread_id']}").json()
offers = [item for item in thread["messages"] if "sched:offer" in item["labels"]]
if not offers: # a new request: offer three times to everyone in the thread
slots = free_slots()
listed = "\n".join(f"- {slot:%A %d %B, %H:%M} UTC" for slot in slots)
sent = session.post(
f"{API}/messages/{message['id']}/reply",
json={"text": f"Happy to find a time. Dana is free for 30 minutes at:\n{listed}\nReply with the one that suits you.", "reply_all": True},
headers={"Idempotency-Key": f"offer-{message['id']}"},
).json()
label(sent["id"], ["sched:offer"] + [f"slot:{slot:%Y%m%dt%H%M}" for slot in slots])
label(message["id"], ["sched:request"])
print("offered", len(slots), "slots in", message["thread_id"])
continue
slots = [datetime.strptime(name[5:], "%Y%m%dt%H%M").replace(tzinfo=timezone.utc) for name in offers[-1]["labels"] if name.startswith("slot:")]
picked = next((slot for slot in slots if f"{slot:%H:%M}" in message["extracted_text"]), None)
if picked is None:
label(message["id"], ["sched:unclear"]) # a person reads it
print("unclear answer in", message["thread_id"])
continue
session.post(
f"{API}/messages/{message['id']}/reply",
json={"text": f"Booked: {picked:%A %d %B, %H:%M} UTC, for 30 minutes. The invitation is attached.", "reply_all": True, "attachments": [invitation(picked, thread["subject"])]},
headers={"Idempotency-Key": f"booked-{message['id']}"},
)
reminder = session.post(
f"{API}/inboxes/{inbox['id']}/drafts",
json={"to": thread["participants"], "reply_to_message_id": message["id"], "text": f"A reminder: we meet tomorrow at {picked:%H:%M} UTC.", "send_at": (picked - timedelta(days=1)).isoformat()},
headers={"Idempotency-Key": f"reminder-{message['id']}"},
).json()
label(message["id"], ["sched:booked"])
print("booked", f"{picked:%Y-%m-%d %H:%M}", "reminder", reminder["id"])// scheduler-pass.mjs: offer times to everyone in a meeting request, book the one they pick, remind them.
// Node.js 18 or later, nothing to install.
const API = "https://blueping.dev/v1";
const headers = { Authorization: `Bearer ${process.env.BLUEPING_API_KEY}`, "Content-Type": "application/json" };
const call = async (method, path, body, extra = {}) =>
(await fetch(API + path, { method, headers: { ...headers, ...extra }, body: body && JSON.stringify(body) })).json();
const label = (id, names) => call("PATCH", `/messages/${id}`, { add_labels: names });
const day = (date) => date.toLocaleDateString("en-GB", { weekday: "long", day: "2-digit", month: "long", timeZone: "UTC" });
const hhmm = (date) => date.toISOString().slice(11, 16);
const slotLabel = (date) => `slot:${date.toISOString().slice(0, 16).replace(/[-:]/g, "").toLowerCase()}`;
const fromLabel = (name) => new Date(`${name.slice(5, 9)}-${name.slice(9, 11)}-${name.slice(11, 13)}T${name.slice(14, 16)}:${name.slice(16, 18)}:00Z`);
// Your calendar API stands in here: three 30-minute slots a week from now, in UTC.
function freeSlots() {
const start = new Date(Date.now() + 7 * 86_400_000);
start.setUTCHours(9, 0, 0, 0);
return [0, 1, 2].map((n) => new Date(start.getTime() + n * 86_400_000 + 2 * n * 3_600_000));
}
function invitation(slot, subject) {
const stamp = (date) => date.toISOString().replace(/[-:]/g, "").slice(0, 15) + "Z";
const ics = ["BEGIN:VCALENDAR", "VERSION:2.0", "PRODID:-//Example//Scheduler//EN", "BEGIN:VEVENT", `UID:${stamp(slot)}@scheduler.example`, `DTSTAMP:${stamp(new Date())}`, `DTSTART:${stamp(slot)}`, `DTEND:${stamp(new Date(slot.getTime() + 30 * 60_000))}`, `SUMMARY:${subject}`, "END:VEVENT", "END:VCALENDAR", ""].join("\r\n");
return { filename: "invite.ics", content_type: "text/calendar", content_base64: Buffer.from(ics).toString("base64") };
}
const inbox = await call("POST", "/inboxes", { client_id: "scheduling", display_name: "Dana's scheduling assistant" });
const page = await call("GET", `/inboxes/${inbox.id}/messages?limit=50`);
for (const message of page.data.reverse()) {
if (message.direction !== "in" || message.labels.some((name) => name.startsWith("sched:"))) continue;
const thread = await call("GET", `/threads/${message.thread_id}`);
const offers = thread.messages.filter((item) => item.labels.includes("sched:offer"));
if (!offers.length) {
// a new request: offer three times to everyone in the thread
const slots = freeSlots();
const listed = slots.map((slot) => `- ${day(slot)}, ${hhmm(slot)} UTC`).join("\n");
const sent = await call("POST", `/messages/${message.id}/reply`, { text: `Happy to find a time. Dana is free for 30 minutes at:\n${listed}\nReply with the one that suits you.`, reply_all: true }, { "Idempotency-Key": `offer-${message.id}` });
await label(sent.id, ["sched:offer", ...slots.map(slotLabel)]);
await label(message.id, ["sched:request"]);
console.log("offered", slots.length, "slots in", message.thread_id);
continue;
}
const slots = offers.at(-1).labels.filter((name) => name.startsWith("slot:")).map(fromLabel);
const picked = slots.find((slot) => message.extracted_text.includes(hhmm(slot)));
if (!picked) {
await label(message.id, ["sched:unclear"]); // a person reads it
console.log("unclear answer in", message.thread_id);
continue;
}
await call("POST", `/messages/${message.id}/reply`, { text: `Booked: ${day(picked)}, ${hhmm(picked)} UTC, for 30 minutes. The invitation is attached.`, reply_all: true, attachments: [invitation(picked, thread.subject)] }, { "Idempotency-Key": `booked-${message.id}` });
const reminder = await call("POST", `/inboxes/${inbox.id}/drafts`, { to: thread.participants, reply_to_message_id: message.id, text: `A reminder: we meet tomorrow at ${hhmm(picked)} UTC.`, send_at: new Date(picked.getTime() - 86_400_000).toISOString() }, { "Idempotency-Key": `reminder-${message.id}` });
await label(message.id, ["sched:booked"]);
console.log("booked", picked.toISOString().slice(0, 16).replace("T", " "), "reminder", reminder.id);
}The offered slots live in labels on the offer itself, such as slot:20261130t0900, so the program keeps no database: any run can read the thread and know what was offered. Labels hold lowercase letters, digits and . _ : / -, 20 per message.
The reminder goes to participants, everyone in the thread but the assistant itself, in the meeting's own thread.
Schedule from a conversation with an MCP client
Dana can also hand the inbox to a model in Claude or Cursor with the MCP server, with her calendar connected as another tool.
Check dana-scheduling for new meeting requests. For each one, read the thread, offer three 30-minute slots from my free times next week to everyone in it, and when someone picks one, confirm to everyone and schedule a reminder for the day before. If someone asks to move a meeting, cancel its reminder and offer new times.| Tool | What it does here |
|---|---|
list_messages | Reads the copied emails that are new. |
read_thread | Shows the request with everyone in it, oldest first. |
reply_to_email | Offers times and confirms, with reply_all. |
create_draft | Schedules the day-before reminder with send_at. |
list_drafts | Finds the reminders waiting, with status scheduled. |
update_draft | Moves a reminder, or unschedules it with send_at null. |
reply_to_email sends text; the .ics invitation goes through the API's attachments, as in the program above. The tools ask the model to check with you before scheduling a send.
Pull the reminder when someone asks to move
A reschedule request should stop the reminder before it goes, even if it arrives an hour before. Subscribe to email.received, check the signature as Webhooks shows, and let the handler below unschedule the thread's reminders the moment someone asks to move.
// reschedule-hook.mjs: the part of your webhook server that unschedules a meeting's reminder when someone asks to move it.
// Check the Blueping-Signature header before calling handle(): /docs/webhooks#verify has the code.
const API = "https://blueping.dev/v1";
const headers = { Authorization: `Bearer ${process.env.BLUEPING_API_KEY}`, "Content-Type": "application/json" };
const call = async (method, path, body) => (await fetch(API + path, { method, headers, body: body && JSON.stringify(body) })).json();
const MOVE = /\b(reschedule|move it|move the|another time|can't make|cannot make)\b/i;
export async function handle(event) {
if (event.type !== "email.received") return;
const { inbox, message } = event.data;
if (!MOVE.test(message.extracted_text)) return;
const thread = await call("GET", `/threads/${message.thread_id}`);
const ids = new Set(thread.messages.map((item) => item.id));
const scheduled = await call("GET", `/inboxes/${inbox.id}/drafts?status=scheduled&limit=100`);
const reminders = scheduled.data.filter((draft) => ids.has(draft.reply_to_message_id));
for (const draft of reminders) await call("PATCH", `/drafts/${draft.id}`, { send_at: null });
await call("PATCH", `/threads/${message.thread_id}`, { add_labels: ["sched:reschedule"] });
console.log(`unscheduled ${reminders.length} reminder(s) in ${message.thread_id}`);
}An unscheduled reminder stays as a draft: the next booking can schedule it again with a new send_at, or delete it.
Who the assistant writes to, and why
A scheduling assistant writes to people outside the company every day, so the rules that pace and check its mail matter.
People in the thread, and only them
The agent writes to the people Dana copied and to whoever answers, with reply_all. A client it never wrote to counts once as a new recipient; 3 in the first hour, 10 in the first day and 25 in the first week after the claim is plenty for a person's calendar.
A forged acceptance
An acceptance forged in the client's name fails the DMARC policy of the client's domain: it is turned away or held as unauthenticated, and never books a slot. A held one shows in the thread's held_count.
Invitations from strangers
Calendar files arrive as attachments like any other. A held message's files open only with include=held, to a key that holds held:read, so a planted invitation never reaches the model unless you allow it.
Every reminder can be stopped
A scheduled reminder is a draft until its time: DELETE /v1/drafts/{id} cancels it, and the answer says status: canceled.
What one busy calendar needs
Fifteen meetings a week take about four emails each to two or three people, and every recipient counts as one send: about 800 sends a month, in bursts on Monday mornings.
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 NylasAll use cases
Last checked against the API on .
Questions about scheduling
What builders ask before they set it up. The docs answer the rest.
Does the agent see Dana's whole mailbox?
No. It sees the threads it is copied on, in its own inbox, and nothing else. Dana's mailbox stays hers.
Can it send real calendar invitations?
It attaches an .ics file, which calendar apps import, with the time, the length and the title. Creating the event in Dana's own calendar is a call to her calendar's API.
What about time zones?
The program writes times in UTC; your model writes them in each person's zone. The invitation file carries UTC, which calendar apps convert.
How many people can be in a thread?
A message goes to 10 addresses at most, to, cc and bcc together, which covers almost every meeting.
What if nobody answers?
Schedule a nudge as a draft with send_at two days out, and delete it when someone replies. The sales leads page shows that pattern.
How does the agent know Dana's free times?
From her calendar's API, which your code calls where free_slots() stands. Over MCP, connect a calendar tool next to Blueping's and the model reads both.
Can the reminder go to Dana alone?
Yes. Set its to to Dana's address instead of the thread's participants; it still goes in the meeting's thread.
More agents at work
- Answers Ridgeway's candidates,ridgeway-jobs
@blueping.dev. Interview scheduling with candidates, inside a hiring pipeline. - Assists Olderwick's partners,olderwick-assistant
@blueping.dev. Everything else in a busy person's mail, forwarded with a note. - Books trips for Marlow's team,marlow-travel
@blueping.dev. The trips behind the meetings, with reminders that go by themselves.
Give your calendar an assistant to copy
Times offered to everyone, an invitation, and a reminder the day before.