read
Messages, threads, search, the change feed, calendars, contacts and outbox tracking.
Give your agent an API key with read and write but no send: it follows new mail and saves drafts, and every send is refused.
import { changes } from "@workwae/sdk";
// An API key with read and write, without send
const feed = changes(workwae.changes.list, {
cursor: saved,
types: ["message.created"],
});
for await (const event of feed) {
if (event.type !== "message.created") continue;
const { message } = event.data;
if (message.direction !== "inbound") continue;
if (!message.from) continue;
const accountId = event.accountId;
const full = await workwae.messages.get({
accountId,
messageId: message.id,
});
const text = await agent.answer(full); // your model
// A draft in the user's mailbox, for a person to send
await workwae.drafts.create({
accountId,
inReplyToMessageId: message.id,
to: [{ address: message.from.address }],
subject: `Re: ${message.subject}`,
text,
});
}
await save(feed.cursor);from workwae import Workwae, changes
workwae = Workwae()
# An API key with read and write, without send
feed = changes(workwae.changes.list, cursor=saved, types=["message.created"])
for event in feed:
if event.type != "message.created":
continue
message = event.data.message
if message.direction != "inbound":
continue
if not message.from_:
continue
account_id = event.account_id
full = workwae.messages.get(account_id=account_id, message_id=message.id)
text = agent.answer(full) # your model
# A draft in the user's mailbox, for a person to send
workwae.drafts.create(
account_id=account_id,
in_reply_to_message_id=message.id,
to=[{"address": message.from_.address}],
subject=f"Re: {message.subject}",
text=text,
)
save(feed.cursor)Owners and admins set a key's scopes (read, write, send, admin) in the console; other calls fail with missing_scope.
readMessages, threads, search, the change feed, calendars, contacts and outbox tracking.
writeDrafts, labels, events and contacts.
sendSending, scheduling and cancelling mail, and mail merges; leave it off the agent's key.
write still reach?Calendar events, and events with attendees make the provider send invitations. If the agent must reach no one, give it read only.
An account token (wat_...) carries every scope, send included, on its one account. Give agents an API key (wk_...) instead, limited to the accounts they need.
As untrusted data, never as instructions, since anyone can email your users. Keep sending behind a person or a send-scoped service.
Yes, live at https://api.workwae.com/mcp. Its tools search and read mail, calendars and contacts, save drafts, and send only with the send scope. Connect with an API key, whose scopes decide which tools the agent sees; your own team can also sign in with OAuth from Claude, ChatGPT, Cursor and other clients that support it, picking scopes and accounts. Your users have no console login, so give each one an MCP key bound to their own account. See the MCP guide.
On Gmail, Microsoft 365 and IMAP; AI features stay off until you turn them on, and account data never trains models (Privacy Policy).
An ordered, resumable change feed or signed webhooks, with nothing committed out of order skipped.
Bodies, attachments, raw MIME, whole threads and full-text search.
Drafts wait in the user's mailbox until someone sends them, or a send-scoped service queues them with an undo window.
POST /v1/ai/draft writes a body from instructions for a person to edit, without sending or saving it.
Replies classified as human, auto-reply, opt-out or failure, with return dates and new contacts.
Free/busy, common slots and events with Teams, Meet, Zoom or Webex links.
We are onboarding a small number of teams. Tell us what you are building.