Use case: AI email agents

Give your agent a real inbox, with a person in the loop.

An email agent needs to notice new mail, read the whole conversation and answer without sending anything nobody approved. workwae gives it all three across Gmail, Microsoft 365 and IMAP, through one API.

agent.ts
import { changes } from "@workwae/sdk";

const feed = changes(workwae.changes.list, {
  cursor,
  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,
  });
}
What you get

What an email agent needs, nothing it shouldn't do

Your agent works through the same API as any other client. workwae's own AI features are off until you turn them on, and connected account data is never used to train models (Privacy Policy).

New mail as it arrives

Read new mail from an ordered change feed with a resumable cursor, or receive the same events as signed webhooks. Events committed out of order are never skipped.

Webhooks in the product overview

Messages, threads and search

Read text and HTML bodies, attachments and raw MIME, load the whole thread, and run full-text search to find the context an answer needs.

Mail in the product overview

Drafts before sends

Save replies as drafts in the user's own mailbox, where they review and send them, or queue them in the outbox with an undo window.

Mail in the product overview

AI drafting

POST /v1/ai/draft writes an email body from instructions, optionally answering a message or reworking a draft. Nothing is sent or saved: the text is for a person to edit.

AI features in the product overview

Reply classification

Replies to your sends are classified as human replies, auto-replies, opt-outs or delivery failures, with out-of-office return dates and the new contacts named in left-the-company replies.

AI features in the product overview

Calendar actions

Agents that schedule can read free/busy, find common slots and create events with Teams, Meet, Zoom or Webex links on the user's calendar.

Calendar in the product overview
How it fits

From new message to approved reply

  1. Users connect their mailbox

    Through a hosted connect page or your own UI, approving exactly the access your agent needs. They can disconnect at any time.

  2. Your agent follows the feed

    New mail arrives through webhooks or the change feed; the agent reads the message and its thread through the API.

  3. People approve what goes out

    The agent saves its answer as a draft in the user's mailbox, and the user sends it from their own client or from your app.

Early access

Put your agent to work in real inboxes, safely.

We are onboarding a small number of teams. Tell us what you are building.