Email channel
Ansadesk can take inbound email and turn each message into a conversation in the same inbox your chat widget feeds. Your team answers email and chat side by side, and the AI features work on both.
How it works
Ansadesk exposes a provider-agnostic webhook at /api/email/inbound. You point your email provider's inbound parsing (Postmark, Amazon SES, Resend inbound, etc.) at it. When an email arrives, the provider POSTs the parsed message as JSON and Ansadesk creates or threads a conversation for you.
The webhook expects this shape:
POST /api/email/inbound
x-inbound-secret: <EMAIL_INBOUND_SECRET>
Content-Type: application/json
{
"to": "[email protected]",
"from": "[email protected]",
"fromName": "Jane Doe", // optional
"subject": "Where's my order?", // optional
"text": "Hi, I ordered last week and…"
}Routing to a workspace
The local part of the recipient address is the workspace slug. An email to [email protected] lands in the workspace whose slug is acme. Give each workspace its own inbound address and you can run several workspaces on one inbound domain. Mail to an address whose local part doesn't match a workspace is rejected with a 404.
Threading & sender identity
- Email identity is stable: every message from the same
fromaddress maps to a single visitor, so an agent sees one person's history rather than a new contact each time. - A new email threads into that sender's most recent open email conversation. If they have none open, a fresh conversation is created. Reopen a closed conversation by replying once it's closed and the next email starts a new thread.
- The subject is prepended to the body, and the combined text is stored as the visitor's message (capped at 4,000 characters).
AI works on email too
An inbound email is treated exactly like a widget message. If you've configured an AI knowledge base and an AI key, Ansadesk drafts a reply, and supervised autopilot and triage apply the same way they do on chat — high-confidence autopilot replies send, the rest become drafts with the usual unanswered-message alerts.
Setup
- Set
EMAIL_INBOUND_SECRETto a long random string on the server. Until it's set, the webhook returns503and the channel is off. - In your email provider, enable inbound parsing for your inbound domain (e.g.
inbound.yourdomain.com) and configure the parse webhook to POST to/api/email/inboundwith thex-inbound-secretheader set to the same value. Requests with a missing or wrong secret get401. - Map the JSON fields above. Most providers let you template the parsed
to,from,subject, and plaintextbody into the request.
Replies go back out by email automatically. When an agent answers an email-channel conversation — or autopilot sends a high-confidence reply — Ansadesk emails it to the visitor (subject “Re: your conversation with your brand”). This needs a configured mailer (USESEND_API_KEY + EMAIL_FROM); without one, sending is a no-op and the reply still lives in the inbox. When the visitor emails back, inbound parsing threads it into the same conversation.