Skip to content

Conversations ​

Bring the replies to your emails back into Outbound. Send an email with captureReplies: true and every reply to it is collected into a conversation that you can read and answer from the API or the dashboard. Replies still reach your own mailbox as well.

New to Conversations? The Conversations guide explains when conversations are created and how to sync them into your own system, and Show Inbound Conversations in Your Application walks through an inbox for your team, with a full example. This page is the method reference.

All examples assume you've set the API key in the constructor. For multi-tenant usage, pass { apiKey } as the last argument to any method. See Configuration.

How It Works ​

  1. An Outbound admin enables Conversations for your account and assigns you a reply domain, for example reply.outbound.yourcompany.com.
  2. You send with captureReplies: true on email.send, email.bulk, templates.send or templates.bulkSend. The email carries a second Reply-To address on your reply domain. Your own replyTo (or fromEmail when you set none) stays first, so a reply goes to your mailbox and to Outbound. Add createThread: true to open each conversation when the email is sent instead of when its first reply arrives.
  3. Replies arrive as conversations. A conversation is one sent email plus every reply to it and every reply you send from Outbound. Each new message can also notify you through a webhook.
ts
await outbound.email.send({
  toEmail: 'riya@example.com',
  fromEmail: 'admissions@yourcompany.com',
  emailSubject: 'Your application',
  htmlBody: '<p>Hi Riya, reply to this email with any questions.</p>',
  captureReplies: true,
});

for await (const thread of outbound.conversations.listAllThreads({ needsReply: true })) {
  console.log(`${thread.lead.email}: ${thread.lastSnippet}`);
}

Test without a real recipient

Send with captureReplies: true to success@simulator.amazonses.com, then create a reply with sandbox.simulateReply(). Simulated conversations carry simulated: true.

Message Kinds ​

kindDirectionMeaning
originaloutboundThe email that started the conversation
replyinboundA reply written by a person
auto_replyinboundAn automatic reply, such as an out-of-office message
bounceinboundA delivery failure notice sent to the reply address
read_receiptinboundA read receipt
staff_replyoutbound or inboundA reply from your team: outbound when sent from Outbound, inbound when someone on your team replied all from their own mail app

Who Sent a Message ​

participant says who wrote an inbound message:

participantMeaning
recipientThe person the email went to, or one of its CC or BCC recipients
staffSomeone from your own team
externalAnyone else, for example someone the email was forwarded to

senderAuth says whether the sender's address can be trusted:

senderAuthMeaning
verifiedThe sender's domain authenticated the message (DMARC pass)
unverifiedThe sender could not be verified, for example because their domain publishes no DMARC policy
failedAuthentication failed. Treat the sender address with suspicion
internalSent by Outbound

Automated Messages ​

Conversations that contain only automated messages (auto replies, bounce notices and read receipts) are hidden from listThreads() by default and counted separately in summary() as automatedOnly. Pass includeAutomated: true to list them. Conversations opened at send with createThread: true are listed by default, even before anyone replies.

Opt-Out Replies ​

Every human reply (a message of kind reply) is checked for a request to stop, such as "please remove me from this list". Automatic replies, bounce notices, read receipts and replies from your own team are not checked. When a request is found, the message's optOut.detected is true, the conversation's optOutDetected is true, and optOut.action says what happened:

optOut.actionMeaning
flaggedDetected and left for you to review
suppressedThe sender was added to your suppression list
already_suppressedThe sender was already on your suppression list

With autoSuppressOptOuts turned on, a request to stop is acted on automatically when it is unambiguous ("unsubscribe", "stop emailing me", "remove me from your list", a reply of just "STOP", and the Hindi equivalents), comes from the recipient themselves, and senderAuth is verified. Looser phrases such as "remove my email", and every other request, are flagged for your team to review. Once a request is acted on, the conversation no longer needs a reply. When the sender is newly suppressed, an unsubscribe webhook also fires with unsubscribeSource: 'reply' and unsubscribeReason: 'reply'.


Get Settings ​

ts
const { settings } = await outbound.conversations.getSettings();

Response ​

ts
{
  settings: {
    enabled: true,
    autoSuppressOptOuts: false,
    retentionDays: null,
    captureConfigured: true,
    receivingConfigured: true,
    replyDomains: [
      { hostname: 'reply.outbound.yourcompany.com', isDefault: true, status: 'active' }
    ]
  }
}
FieldDescription
enabledAn Outbound admin has enabled Conversations for your account. While this is true, any send with captureReplies: true captures replies
autoSuppressOptOutsReplies asking to stop are added to your suppression list automatically. See Opt-Out Replies
retentionDaysConversations are deleted this many days after their last message. null keeps them until you delete them
captureConfiguredReply capture is set up on the platform
receivingConfiguredReceiving replies is set up on the platform
replyDomainsYour reply domains. See List Reply Domains

Possible Errors ​

ErrorStatusCause
AuthenticationError401Invalid or missing API key

Update Settings ​

Pass only the fields you want to change.

ts
const { settings } = await outbound.conversations.updateSettings({
  autoSuppressOptOuts: true,
  retentionDays: 365,
});

Parameters ​

FieldTypeRequiredDescription
autoSuppressOptOutsbooleanNoAdd a recipient who replies asking to stop to your suppression list automatically. See Opt-Out Replies
retentionDaysnumber | nullNoDelete a conversation once its last message is this many days old. A whole number from 30 to 3650, or null to keep conversations until you delete them

Pass at least one field. Expired conversations are deleted once a day. Simulated conversations are always deleted 30 days after their last message, whatever retentionDays says.

Response ​

Same shape as Get Settings, with your changes applied.

Possible Errors ​

ErrorStatusCause
BadRequestError400No field given, a field has the wrong type, or retentionDays is not null or a whole number from 30 to 3650
ForbiddenError403An Outbound admin has not enabled Conversations for your account

List Reply Domains ​

The reply domains assigned to your account. Only active domains can be used for sending.

ts
const { replyDomains } = await outbound.conversations.listReplyDomains();
const usable = replyDomains.filter((d) => d.status === 'active');

Response ​

ts
{
  replyDomains: [
    { hostname: 'reply.outbound.yourcompany.com', isDefault: true, status: 'active' },
    { hostname: 'reply.outbound.yourbrand.com', isDefault: false, status: 'pending_dns' }
  ]
}
FieldDescription
hostnameThe domain. Pass it as replyDomain on a send to use it instead of your default
isDefaultUsed when a send sets captureReplies: true without a replyDomain
statusactive (ready to use), pending_dns (waiting for DNS records), verified (DNS verified, not yet active) or retired (no longer available for new sends)

Possible Errors ​

ErrorStatusCause
AuthenticationError401Invalid or missing API key

Get Summary ​

Counts for an inbox badge.

ts
const { summary } = await outbound.conversations.summary();
// { open: 3, needsReply: 2, unread: 1, automatedOnly: 4, noReply: 1 }

Response ​

FieldDescription
openOpen conversations. Includes conversations opened at send with createThread: true, even when nobody has replied yet
needsReplyConversations waiting for your reply
unreadConversations with unread messages
automatedOnlyConversations that contain only automated messages. listThreads() hides these unless you pass includeAutomated: true
noReplyOpen conversations where the recipient has not replied yet

Possible Errors ​

ErrorStatusCause
ForbiddenError403Conversations is not enabled for your account

List Conversations ​

Most recent activity first by default. Pages are cursor based: pass the previous response's pagination.nextCursor as cursor to get the next page.

ts
const page = await outbound.conversations.listThreads({ needsReply: true, limit: 25 });

if (page.pagination.nextCursor) {
  const next = await outbound.conversations.listThreads({
    needsReply: true,
    limit: 25,
    cursor: page.pagination.nextCursor,
  });
}

Parameters ​

Every filter is optional. Filters combine: a conversation must match all of them. See Filtering and Sorting for examples.

FieldTypeRequiredDescription
status'open' | 'closed' | 'all'NoFilter by status. Default 'open'
needsReplybooleanNotrue returns only conversations waiting for your reply. false returns only conversations that do not need one
hasRepliesbooleanNotrue returns only conversations with a reply from the recipient. false returns only conversations where the recipient has not replied, the "who has not replied" view. Combine it with campaignId. When set, includeAutomated is ignored
unreadbooleanNotrue returns only conversations with unread messages. false returns only fully read conversations
optOutbooleanNotrue returns only conversations where a reply asked to stop, false only the others
simulatedbooleanNotrue returns only simulated conversations, false only real ones
hasAttachmentsbooleanNotrue returns only conversations with attachments, false only those without
includeAutomatedbooleanNoInclude conversations that contain only automated messages. Default false. Ignored when hasReplies is set
replyCountnumber | { eq?, gt?, gte?, lt?, lte? }NoFilter by the number of replies. A number matches exactly. An object takes any of eq, gt, gte, lt and lte, each a whole number of 0 or more, and all of them must hold. Replies are counted as in counts.replies: from the recipient or anyone outside your team, excluding the original email, your team's replies and automatic replies
lastMessageDirection'inbound' | 'outbound'NoOnly conversations whose latest message was received (inbound) or sent (outbound). inbound gives the conversations waiting on your team
deliveryStatusstring | string[]NoOnly conversations whose original email has one of these statuses: sent, delivered, opened, clicked, bounced or complained. Pass an array to match any of them
campaignIdstringNoOnly conversations started by an email in this campaign. Case-insensitive
leadEmailstringNoOnly conversations with this recipient
fromEmailstringNoOnly conversations whose original email was sent from this exact address
subjectstringNoOnly conversations whose original subject contains this text. Case-insensitive
qstringNoSearch the recipient's email address and name, and the subject
sincestringNoISO 8601 timestamp. The same as lastMessageFrom. Use it for incremental syncs
sentFrom / sentTostring | DateNoThe original email was sent at or after sentFrom, or before sentTo
lastSentFrom / lastSentTostring | DateNoThe latest message you sent in the conversation (lastOutboundAt) falls in the range
lastMessageFrom / lastMessageTostring | DateNoThe latest message in either direction (lastMessageAt) falls in the range
createdFrom / createdTostring | DateNoThe conversation was created (createdAt) in the range
tzstringNoIANA time zone for date-only values, such as Asia/Kolkata. Default UTC
sortBy'lastMessageAt' | 'sentAt' | 'createdAt' | 'replyCount'NoField to sort by. Default 'lastMessageAt'
sortOrder'desc' | 'asc'NoSort direction. Default 'desc'
limitnumberNoPage size. Default 25, max 100
cursorstringNopagination.nextCursor from the previous page. A cursor only works with the sortBy and sortOrder it was issued for

Date ranges accept a YYYY-MM-DD date, an ISO 8601 date-time, or a JavaScript Date, which is sent as toISOString(). From is inclusive. A date-time To is exclusive, so sentTo: '2026-10-31T00:00:00+05:30' stops before that instant. A date-only To includes that whole day. Date-only values are read in the tz time zone, and in UTC when tz is not set.

Response ​

ts
{
  threads: [
    {
      id: '0199f1c2-5a4e-7c1d-9a3b-2f6e8d4c1a10',
      status: 'open',
      needsReply: true,
      hasReplies: true,
      unreadCount: 1,
      subject: 'Your application',
      lead: { email: 'riya@example.com', name: 'Riya Sharma' },
      mailbox: 'admissions@yourcompany.com',
      fromEmail: 'admissions@yourcompany.com',
      senderName: 'Admissions Team',
      campaignId: 'Q3-LEADS',
      originMessageId: '0199f1a0-77b2-7e10-8c4d-5b1f2e9a3c71',
      jobId: '0199f1a0-77b0-7f42-a1d3-0e6b4c8f2d95',
      replyDomain: null,
      counts: { messages: 4, replies: 2, autoReplies: 1, staffReplies: 1 },
      optOutDetected: false,
      simulated: false,
      firstReplyAt: '2026-10-18T09:12:40.000Z',
      lastInboundAt: '2026-10-18T10:02:11.000Z',
      lastOutboundAt: '2026-10-18T09:30:05.000Z',
      lastMessageAt: '2026-10-18T10:02:11.000Z',
      lastMessageDirection: 'inbound',
      sentAt: '2026-10-18T08:00:01.000Z',
      deliveryStatus: 'opened',
      lastSnippet: 'Yes! What are the fees?',
      closedAt: null,
      createdAt: '2026-10-18T08:00:03.000Z'
    }
  ],
  pagination: {
    limit: 25,
    hasMore: true,
    nextCursor: 'eyJ0IjoiMjAyNi0xMC0xOF...',
    sortBy: 'lastMessageAt',
    sortOrder: 'desc'
  }
}

Conversation Fields ​

FieldDescription
idConversation ID
statusopen or closed. A new reply reopens a closed conversation
needsReplyA person replied and nobody from your team has answered since
hasRepliesThe recipient has replied at least once. false for a conversation opened at send that nobody has replied to yet
unreadCountReplies not yet marked read
subjectSubject of the original email, or null
leadThe person the original email was sent to: email, and name or null
mailboxWhere replies to the original email go: its replyTo, or its fromEmail
fromEmail / senderNameSender of the original email. Replies you send from Outbound use them too
campaignIdCampaign of the original email, or null
originMessageIdmessageId of the original email, as returned by the send call and used in webhooks
jobIdJob of the original email
replyDomainReply domain the conversation uses. Set by getThread(), null in lists
countsmessages, replies (human replies), autoReplies (auto replies, bounce notices and read receipts) and staffReplies
optOutDetectedA message in this conversation asked to stop
simulatedCreated with sandbox.simulateReply()
firstReplyAtFirst human reply, or null
lastInboundAt / lastOutboundAtLatest received and latest sent message, or null
lastMessageAtLatest message in either direction. Lists are sorted by this unless you pass sortBy
lastMessageDirectioninbound when the latest message was received, outbound when you or your team sent it last
sentAtWhen the original email was sent
deliveryStatusDelivery status of the original email: sent, delivered, opened, clicked, bounced or complained. null when unknown
lastSnippetPreview of the latest message
closedAtWhen the conversation was closed, or null
createdAtWhen the conversation was created

Pagination ​

pagination has limit, hasMore, nextCursor, and the sortBy and sortOrder the page was sorted by. Keep the same filters and sort on every page. Start again without cursor when you change either of them. On a large account, sort by the field you filter a date range on (for example sortBy: 'sentAt' with sentFrom/sentTo) for the fastest pages.

Filtering and Sorting ​

Each example is a listThreads() call. listAllThreads() accepts the same filters and sort.

Who has not replied to October sends, counted in India time:

ts
const page = await outbound.conversations.listThreads({
  status: 'all',
  hasReplies: false,
  sentFrom: '2026-10-01',
  sentTo: '2026-10-31',
  tz: 'Asia/Kolkata',
});

Conversations with more than three replies:

ts
const page = await outbound.conversations.listThreads({ replyCount: { gt: 3 } });

Conversations with 2 to 5 replies:

ts
const page = await outbound.conversations.listThreads({ replyCount: { gte: 2, lte: 5 } });

Bounced emails to one recipient:

ts
const page = await outbound.conversations.listThreads({
  deliveryStatus: 'bounced',
  leadEmail: 'riya@example.com',
  status: 'all',
});

Conversations waiting on your team, where the recipient wrote last:

ts
const page = await outbound.conversations.listThreads({ lastMessageDirection: 'inbound' });

Most replies first, across every page:

ts
for await (const thread of outbound.conversations.listAllThreads({ sortBy: 'replyCount', sortOrder: 'desc' })) {
  console.log(thread.lead.email, thread.counts.replies);
}

Auto-Pagination ​

Iterate through every matching conversation without handling cursors yourself:

ts
for await (const thread of outbound.conversations.listAllThreads({ status: 'all', campaignId: 'Q3-LEADS' })) {
  console.log(thread.lead.email, thread.counts.replies);
}

Possible Errors ​

ErrorStatusCause
BadRequestError400A filter or sort option has an invalid value, replyCount is not a whole number of 0 or more, cursor is invalid or was issued for a different sortBy or sortOrder, or since is not an ISO 8601 timestamp
ForbiddenError403Conversations is not enabled for your account

Get a Conversation ​

The conversation and all of its messages, oldest first.

ts
const { thread, messages } = await outbound.conversations.getThread(threadId);

for (const m of messages) {
  console.log(`[${m.kind}] ${m.from.email}: ${m.newText ?? m.snippet}`);
}

Response ​

ts
{
  thread: { /* conversation fields, with replyDomain set */ },
  messages: [
    {
      id: '0199f1c3-1d2e-7a4b-9c8d-6e5f4a3b2c1d',
      threadId: '0199f1c2-5a4e-7c1d-9a3b-2f6e8d4c1a10',
      direction: 'inbound',
      kind: 'reply',
      from: { email: 'riya@example.com', name: 'Riya Sharma' },
      to: ['admissions@yourcompany.com'],
      cc: [],
      subject: 'Re: Your application',
      snippet: 'Yes! What are the fees?',
      newText: 'Yes! What are the fees?',
      text: 'Yes! What are the fees?\n\nOn Sat, 18 Oct 2026, Admissions Team wrote:\n> Hi Riya, ...',
      hasHtml: true,
      hasRaw: true,
      attachmentCount: 1,
      attachments: [
        {
          id: '0199f1c3-1d30-7b11-8e2f-3a4b5c6d7e8f',
          filename: 'marksheet.pdf',
          contentType: 'application/pdf',
          size: 12345,
          contentId: null,
          inline: false
        }
      ],
      participant: 'recipient',
      recipient: { email: 'riya@example.com', role: 'to' },
      senderAuth: 'verified',
      outOfOffice: false,
      optOut: { detected: false, phrase: null, action: null },
      originMessageId: null,
      rfcMessageId: '<CAJx9f2kq7@mail.gmail.com>',
      inReplyTo: '<...>',
      sentVia: null,
      sentBy: null,
      simulated: false,
      delivery: null,
      occurredAt: '2026-10-18T10:02:11.000Z'
    }
  ]
}

Message Fields ​

FieldDescription
directioninbound (received) or outbound (sent)
kindSee Message Kinds
fromSender email and name. Either can be null
to / ccAddresses on the message
newTextOnly what this message added, with the quoted history removed. The best field for previews and for processing replies
textFull plain text, including the quoted history
snippetA short preview
hasHtmlAn HTML body is available from getMessageHtml()
hasRawThe original email file is stored. See Attachments and Original Files
attachmentsid, filename, contentType, size in bytes, contentId, and inline (an image shown inside the HTML body)
participantSee Who Sent a Message. null on the original email
recipientWhich recipient this message belongs to: email and role (to, cc or bcc). null when it is not known
senderAuthSee Who Sent a Message
outOfOfficeThe message is an out-of-office reply
optOutdetected, the phrase that matched, and the action taken. See Opt-Out Replies
originMessageIdOn sent messages, the messageId of that email. null on received messages
rfcMessageId / inReplyToThe email's threading headers
sentViaFor replies sent from Outbound: ui (dashboard), api, or admin (an Outbound admin answered on your behalf). Otherwise null
sentByThe dashboard user who sent the reply, or null
simulatedCreated with sandbox.simulateReply()
deliveryOn sent messages: status, error, sentAt, deliveredAt and openedAt. null on received messages
occurredAtWhen the message was sent or received

Possible Errors ​

ErrorStatusCause
NotFoundError404No conversation with this ID for your account
ForbiddenError403Conversations is not enabled for your account

Update a Conversation ​

Close or reopen a conversation, or mark it read or unread.

ts
await outbound.conversations.updateThread(threadId, { status: 'closed' });
await outbound.conversations.updateThread(threadId, { read: true });

Parameters ​

FieldTypeRequiredDescription
status'open' | 'closed'NoClosing also clears needsReply. A new reply reopens the conversation
readbooleanNotrue marks every message read. false marks the conversation unread

Pass at least one field.

Response ​

ts
{
  thread: { /* the updated conversation */ }
}

Possible Errors ​

ErrorStatusCause
BadRequestError400No field given, or a field has an invalid value
NotFoundError404No conversation with this ID for your account
ForbiddenError403Conversations is not enabled for your account

Reply to a Conversation ​

Send a reply from Outbound.

ts
const reply = await outbound.conversations.reply(threadId, {
  text: 'Hi Riya, the fee schedule is on our admissions page.',
  idempotencyKey: `reply:${threadId}:${draftId}`,
});

console.log(`Reply ${reply.replyId} queued to ${reply.to}`);

How the reply is sent:

  • From the original email's fromEmail and senderName, with the subject Re: <original subject>.
  • To the person who wrote the latest reply, or to the lead when nobody has replied yet or the latest reply came from your team.
  • It threads under the message it answers in the recipient's mail app, and quotes that message unless you pass includeQuote: false.
  • It captures replies too, so the answer comes back into the same conversation.
  • A copy goes to the conversation's mailbox by BCC, so your team's inbox keeps the whole exchange.
  • It counts as one email against your quota. It marks the conversation read, clears needsReply and fires a reply webhook with replyType: staff_reply.

Parameters ​

FieldTypeRequiredDescription
textstringOne of text / htmlPlain-text body, up to 50,000 characters
htmlstringOne of text / htmlHTML body, up to 500,000 characters
includeQuotebooleanNoQuote the message you are answering below your reply. Default true
idempotencyKeystringNoMakes retries safe: a repeat with the same key returns the first response with duplicate: true instead of sending again. Keys expire after 24 hours

Response ​

ts
{
  message: 'Reply queued',
  threadId: '0199f1c2-5a4e-7c1d-9a3b-2f6e8d4c1a10',
  replyId: '0199f1d0-0b1c-7d2e-8f3a-4b5c6d7e8f90',
  messageId: '0199f1d0-0b1a-7c3d-9e4f-5a6b7c8d9e0f',
  jobId: '0199f1d0-0b19-7a2b-8c3d-4e5f6a7b8c9d',
  to: 'riya@example.com',
  replyDomain: 'reply.outbound.yourcompany.com'
}
FieldDescription
replyIdID of the new message in the conversation
messageIdMessage ID of the sent email, as used by email.getMessageStatus() and webhooks
jobIdJob ID of the sent email, for email.status()
toWho the reply was sent to
replyDomainReply domain the reply uses
duplicatetrue when an idempotencyKey was replayed. Nothing new was sent

Possible Errors ​

ErrorStatusCause
BadRequestError400Neither text nor html given, a body is too long, or idempotencyKey is empty
ForbiddenError403Conversations is not enabled for your account
NotFoundError404No conversation with this ID for your account
ConflictError409A request with the same idempotencyKey is still being processed
OutboundError422The recipient is on your suppression list (details.email, details.reason), your account has no active reply domain, or the conversation has nobody to reply to
RateLimitError429Rate limit exceeded, or the daily sending quota is exhausted
ServerError503Reply capture is not configured on the platform

Get Message HTML ​

The HTML body of one message, cleaned up for safe display. Remote images are blocked by default, so opening a reply does not tell its sender that you read it.

ts
const { html, remoteImagesBlocked } = await outbound.conversations.getMessageHtml(messageId);

iframe.setAttribute('sandbox', '');
iframe.srcdoc = html;

if (remoteImagesBlocked > 0) {
  showImagesButton.onclick = async () => {
    const withImages = await outbound.conversations.getMessageHtml(messageId, { images: true });
    iframe.srcdoc = withImages.html;
  };
}

Parameters ​

FieldTypeRequiredDescription
messageIdstringYesA message id from getThread(). First argument
imagesbooleanNoLoad remote images. Default false

Response ​

ts
{
  html: '<div dir="ltr">Yes! What are the fees?</div><div class="gmail_quote">...</div>',
  displayHtml: '<div dir="ltr">Yes! What are the fees?</div>',
  remoteImagesBlocked: 2,
  inlineImagesOmitted: 0
}
FieldDescription
htmlThe sanitized HTML. Render it inside a sandboxed iframe
displayHtmlThe same message with the quoted earlier emails removed, or null when there was nothing to trim. Show it by default and put html behind a "Show trimmed content" toggle, as Gmail does
remoteImagesBlockedRemote images that were removed. When above 0, offer a "Show images" action that refetches with images: true
inlineImagesOmittedImages embedded in the email that were too large to include

Possible Errors ​

ErrorStatusCause
NotFoundError404No message with this ID, or the message has no HTML body (hasHtml is false, or the content of the original email is no longer stored)
ForbiddenError403Conversations is not enabled for your account

Attachments and Original Files ​

Downloading attachments and the original .eml file is not part of the SDK yet. Use the dashboard, or call the REST API with your API key:

  • GET /v1/conversations/messages/:messageId/attachments/:attachmentId
  • GET /v1/conversations/messages/:messageId/raw
ts
const res = await fetch(
  `https://outbound-api.unionstack.in/v1/conversations/messages/${messageId}/attachments/${attachmentId}`,
  { headers: { 'X-Api-Key': process.env.OUTBOUND_API_KEY! } },
);
const file = Buffer.from(await res.arrayBuffer());

Erase a Person's Conversations ​

Permanently delete everything Conversations stores about one person, for example to honor a data deletion request.

ts
const { erasure } = await outbound.conversations.erase({ email: 'riya@example.com' });

console.log(`Deleted ${erasure.threadsDeleted} conversations and ${erasure.messagesDeleted} messages`);

This is permanent

Erasure cannot be undone. It deletes:

  • every conversation where this person is the lead, with all of its messages and files
  • every message this person sent in other conversations, for example as a CC recipient
  • the stored copies of emails received from this person
  • the logged webhook deliveries of reply, auto_reply and unsubscribe events that carried their conversations or messages

It works even if Conversations has since been disabled for your account. It does not change your email logs, suppression list or contact lists, and it cannot recall webhooks your endpoint has already received.

Parameters ​

FieldTypeRequiredDescription
emailstringYesThe person's email address. Matched case-insensitively

Response ​

ts
{
  erasure: {
    email: 'riya@example.com',
    threadsDeleted: 2,
    messagesDeleted: 7,
    filesDeleted: 9,
    receivedEmailsDeleted: 5,
    webhookLogsDeleted: 3
  }
}
FieldDescription
emailThe address that was erased, lowercased
threadsDeletedConversations deleted because this person was the lead
messagesDeletedMessages deleted, in those conversations and in others
filesDeletedStored files deleted: message bodies, attachments and original email files
receivedEmailsDeletedStored emails received from this person that were deleted
webhookLogsDeletedLogged webhook deliveries that were deleted because they carried this person's conversations or messages

Erasure is safe to retry. A repeat call for the same address only deletes what has arrived since the last one.

Possible Errors ​

ErrorStatusCause
BadRequestError400email is missing or is not an email address
AuthenticationError401Invalid or missing API key

Released under the MIT License.