Four kinds of reply
Each reply is opt_out, auto_reply, bounce or human_reply, with a probability for each.
Two optional features, off until you turn them on: classifying replies to the mail you send, and drafting email text for a person to edit.
// A reply to one of your sends, as your webhook gets it
{
"type": "message.classified",
"data": {
"classification": {
"kind": "auto_reply",
"autoReplyCategory": "left_company",
"optOutProbability": 0.02,
"returnDate": null,
"alternateContacts": ["sam.lee@example.com"],
"outboxId": "7b9d1f3a-5c7e-4a9b-8d1f-3a5c7e9b1d3f"
}
}
} Classification runs on replies to your own sends, drafting only on request, and nothing else calls the AI gateway.
Each reply is opt_out, auto_reply, bounce or human_reply, with a probability for each.
Out of office, left the company, address changed, ticket acknowledgment, challenge-response or other, with auto-reply headers only a hint.
Read in the sender's time zone, and left empty if not real, before the reply or over a year after it.
Up to five addresses the reply names, as alternateContacts, read from its text, never the model.
A likely opt-out from your own recipient is ignored, held for review, or suppressed, per your setting.
By thread or In-Reply-To and References headers, carrying the send's outboxId.
An email body from instructions, in plain text or Markdown, never sent or saved.
Every answered classification counts toward aiClassifications and every draft toward aiDrafts in your daily usage.
Classification waits for your workspace to turn it on, since reply text goes to a third party.
Our providers don't train models on the data we send, and we never use it to train any model.
Failed replies are retried, backing off to an hour, for up to seven days.
Past a daily cap, replies wait for the next UTC day; drafts past a per-minute limit get rate_limited.
Switch on classification, pick how opt-outs are handled, and let a person decide on the held ones.
await workwae.settings.update({
aiReplyClassification: true,
optOutHandling: "review",
});
// Opt-outs and recipients who moved on, waiting for a person
const reviews = workwae.suppressionReviews;
const { items } = await reviews.list({});
for (const review of items) {
const ok = await askOwner(review.address, review.source);
const input = { reviewId: review.id };
await (ok ? reviews.approve(input) : reviews.dismiss(input));
}workwae.settings.update(
ai_reply_classification=True,
opt_out_handling="review",
)
# Opt-outs and recipients who moved on, waiting for a person
reviews = workwae.suppression_reviews
for review in reviews.list().items:
ok = ask_owner(review.address, review.source)
if ok:
reviews.approve(review_id=review.id)
else:
reviews.dismiss(review_id=review.id)Pause a sequence until someone is back, suggest the new contact when someone left, and stop following up once a person answers.
parseWebhookparse_webhook checks the signature
and narrows the event on its type.
outboxIdoutbox_id ties back to the send, and the event carries
the message and its mailboxes.
autoReplyCategoryauto_reply_category is null for every kind but
auto-replies.
import { parseWebhook } from "@workwae/sdk";
const body = await request.text();
const event = await parseWebhook(secret, request.headers, body);
if (event.known && event.type === "message.classified") {
const { message, classification: c } = event.data;
switch (c.autoReplyCategory) {
case "out_of_office":
if (c.returnDate) await pause(c.outboxId, c.returnDate);
break;
case "left_company":
case "address_changed":
await suggest(message.threadId, c.alternateContacts);
break;
}
if (c.kind === "human_reply") await stopFollowUps(c.outboxId);
}from workwae import UnknownEvent, parse_webhook
body = request.get_data()
event = parse_webhook(secret, request.headers, body)
if not isinstance(event, UnknownEvent) and event.type == "message.classified":
message, c = event.data.message, event.data.classification
if c.auto_reply_category == "out_of_office":
if c.return_date:
pause(c.outbox_id, c.return_date)
elif c.auto_reply_category in ("left_company", "address_changed"):
suggest(message.thread_id, c.alternate_contacts)
if c.kind == "human_reply":
stop_follow_ups(c.outbox_id) POST /v1/ai/draft returns { text }
from instructions and powers "Draft with AI" in the console's compose and template
editor.
accountId with replyToMessageId) and the draft so far
(currentDraft).
text or markdown, with an API key
that has the write scope.
ai_refused when the model declines,
ai_unavailable when the gateway fails or times out.
import { isApiError } from "@workwae/sdk";
try {
const { text } = await workwae.ai.draft({
instructions: "Shorter, and offer a call on Thursday",
context: {
accountId,
replyToMessageId: messageId,
currentDraft,
},
format: "markdown",
});
editor.setValue(text);
} catch (error) {
if (!isApiError(error, "ai_refused")) throw error;
showHint("Try rewording the request");
}
// Classifications and drafts per day, next to the rest of your usage
const { days } = await workwae.usage.get({ from: "2026-10-01" });
const ai = days.map((d) => [d.day, d.aiClassifications, d.aiDrafts]);from datetime import date
from workwae import APIError
try:
draft = workwae.ai.draft(
instructions="Shorter, and offer a call on Thursday",
context={
"account_id": account_id,
"reply_to_message_id": message_id,
"current_draft": current_draft,
},
format="markdown",
)
editor.set_value(draft.text)
except APIError as error:
if error.code != "ai_refused":
raise
show_hint("Try rewording the request")
# Classifications and drafts per day, next to the rest of your usage
days = workwae.usage.get(from_=date(2026, 10, 1)).days
ai = [(d.day, d.ai_classifications, d.ai_drafts) for d in days]classification and announced as message.classified.
Your workspace's optOutHandling setting decides,
review by default, for replies from the send's own
recipient; an opt-out counts at a probability of 0.9 or more.
| Setting | Reply asking to opt out | Left the company or changed address |
|---|---|---|
off | Ignored. The reply is still classified. | Ignored. |
review | Waits in the review queue with the message it came from and how sure the detection was. | Waits for review on the global list (source inactive), with the alternate contacts. |
suppress | Suppressed at once. Sent to several people, it waits for review unless the receiving server shows DMARC, or an aligned SPF or DKIM, passing for the sender. | Waits for review, never suppressed at once. |
When a feature is on, Workwae sends only the text it needs to Gatewae, the AI gateway we use, which forwards it to a language model provider and returns the results.
| Feature | Sent | Not sent |
|---|---|---|
| Reply classification | The reply's subject, the first 2,000 characters of its own text, and whether it carries standard auto-reply headers. For an out-of-office reply, its subject and text again, with the date it was sent. | Quoted history, the rest of the thread, attachments, and anything about the account or the recipient. |
| Draft writing | The person's instructions, their draft so far and, when answering a message, that message's sender, subject and first 4,000 characters. | Anything else in the mailbox. |
The same list is in the Privacy Policy, and Gatewae is listed among our subprocessors.
| Event | When |
|---|---|
message. | A reply to one of your sends was classified; carries the message, its mailboxes and the classification. |
suppression. | A detected opt-out was suppressed, at once or on approval (source reply), or an approved review of a recipient who moved on put the address on the global list (source inactive). |
Yes. With optOutHandling set to
off, replies are still classified and announced, and
only unsubscribe links suppress.
Replies are retried, backing off to an hour, until they are seven days old, so an
outage delays classification rather than losing replies. A draft request answers
ai_unavailable.
Workwae is in early access. Tell us what you are building, and read the docs in the meantime.