Skip to main content

Sending Email

This page covers conversational email — one-to-one messages inside a conversation. For bulk newsletters, see Email Campaigns.

There are a few supported ways to send conversational email through the API, and choosing the right one matters — especially when you need attachments.

Required scopes​

ScopePurpose
messages:createSend email messages
channels:readLook up channel and sender options

POST /api/v1/messages is the unified send endpoint used by every channel. For email, it sends into the conversation and reuses the conversation's subject.

curl -X POST "https://api.sendseven.com/api/v1/messages" \
-H "Authorization: Bearer s7_api_a1b2c3d4e5f6789012345678abcdef00" \
-H "Content-Type: application/json" \
-d '{
"conversation_id": "conv_email_99",
"text": "Thanks for reaching out — we have received your inquiry and will respond within 24 hours.",
"message_type": "text"
}'
Subject is required for email

An outbound email needs a subject. Provide one with a subject field, or send into a conversation that already has a subject — SendSeven reuses it (prefixed with Re: for replies). Without either, the send is rejected with EMAIL_SUBJECT_REQUIRED.

# First message on a new email conversation — include the subject
curl -X POST "https://api.sendseven.com/api/v1/messages" \
-H "Authorization: Bearer s7_api_a1b2c3d4e5f6789012345678abcdef00" \
-H "Content-Type: application/json" \
-d '{
"conversation_id": "conv_email_99",
"subject": "Your inquiry",
"text": "Hello! Here is the information you asked for.",
"message_type": "text"
}'

This is the path that supports attachments.

Option 2 — Reply to an inbound email​

When a customer has emailed you and you want to reply within that thread (preserving In-Reply-To / References headers, CC list, and quoted history), reply to the specific inbound email message:

curl -X POST "https://api.sendseven.com/api/v1/email-integrations/email-messages/em_12345/reply" \
-H "Authorization: Bearer s7_api_a1b2c3d4e5f6789012345678abcdef00" \
-H "Content-Type: application/json" \
-d '{
"text_body": "Happy to help — here are the next steps.",
"html_body": "<p>Happy to help — here are the next steps.</p>",
"reply_all": false,
"preserve_cc": true
}'
FieldTypeDescription
text_body / html_bodystringReply body (plain and/or HTML)
cc_emails / bcc_emailsarrayAdditional recipients
preserve_ccboolAuto-include the original CC recipients (default true)
reply_allboolReply to all original recipients
to_emailsarrayExplicit recipient override
subject_overridestringOverride the reply subject (default Re: <original>)
include_thread_historyboolAppend quoted prior thread beneath the reply
attachment_idsarrayAttachments to include — see Attachments
sender_idstringSender override from sender-options
metaobjectOptional, for a reply you translated before sending: {"translations": {"original": "<your text>", "original_language": "de"}, "translated_to": "fr"}. Stored with the sent email so team members can later translate the original. Other keys are ignored.

This path also supports attachments.

You can send html_body alone. The plain-text part of the email is then generated from the HTML (links kept as text (URL)), and the quoted thread history is added to both parts. On the stored email, text_body holds the full plain-text part that was sent, quoted history included. The conversation message created for the reply (GET /messages, text) holds your reply only, without the quoted history. The same applies to emails sent with POST /messages and the compose endpoint below.

Option 3 — Compose a new email in a conversation​

To start a brand-new outbound email (rather than reply to an inbound message) while controlling the subject, CC/BCC and sender explicitly, use the compose endpoint:

curl -X POST "https://api.sendseven.com/api/v1/email-integrations/conversations/conv_email_99/compose-email" \
-H "Authorization: Bearer s7_api_a1b2c3d4e5f6789012345678abcdef00" \
-H "Content-Type: application/json" \
-d '{
"subject": "Your invoice",
"text_body": "Please find your invoice attached.",
"attachment_ids": ["9b3f1a8e-7c2d-4e5b-9f01-12a3b4c5d6e7"]
}'
FieldTypeDescription
subjectstringRequired subject line
text_body / html_bodystringBody (plain and/or HTML)
to_emailstringExplicit recipient; defaults to the contact's primary email
cc_emails / bcc_emailsarrayAdditional recipients
attachment_idsarrayAttachments to include — see Attachments
sender_idstringSender override from sender-options
metaobjectOptional translation info, same as on a reply.

This path supports attachments: attachment_ids takes the same generic attachment IDs the other paths accept, and an ID that does not resolve is rejected with 404 rather than sending the email without the file.

Option 4 — Forward an email​

Forward any email of a conversation (received or sent) to new recipients:

curl -X POST "https://api.sendseven.com/api/v1/email-integrations/email-messages/em_12345/forward" \
-H "Authorization: Bearer s7_api_a1b2c3d4e5f6789012345678abcdef00" \
-H "Content-Type: application/json" \
-d '{
"to_emails": ["[email protected]"],
"cc_emails": ["[email protected]"],
"intro_text": "FYI, see the customer request below.",
"open_new_conversation": false
}'

The forward is a new email thread for the recipients (no In-Reply-To / References to the original). The body is your intro followed by a standard ---------- Forwarded message --------- block with the original From, Date, Subject, To and Cc, then the original content. It is sent and billed like a reply.

FieldTypeDescription
to_emailsarrayRequired, at least one address
cc_emails / bcc_emailsarrayOptional additional recipients
subjectstringOptional. Default Fwd: <original subject> (never a double Fwd:)
intro_html / intro_textstringOptional intro above the forwarded message (HTML is sanitized)
include_attachment_idsarrayAttachments of the original email to forward. Omitted or null: all of them. []: none
attachment_idsarrayExtra uploaded attachments, see Attachments
include_signatureboolAppend your email signature, same as on a reply
channel_idstringEmail channel to send from. Default: the source conversation's email channel
open_new_conversationboolfalse (default): the forward is stored in the source conversation. true: a new email conversation is opened and the forward is its first message
assigned_user_idstringAssignee of the new conversation. Only with open_new_conversation: true
contact_idstringExisting contact for the first To address. Only with open_new_conversation: true
new_contactobjectContact to create for the first To address: first_name, last_name, display_name, custom_fields, duplicate_mode (dont_allow_duplicates or allow_duplicates). Only with open_new_conversation: true

Each entry must be a single plain address such as [email protected] (no display names, angle brackets or comma-separated lists). Addresses are validated and de-duplicated across To, CC and BCC (case-insensitive; an address in To is dropped from CC and BCC). A forward has at most 50 recipients in total.

Opening a new conversation​

With open_new_conversation: true SendSeven always opens a new email conversation (it never reuses an open one) with the contact of the first To address:

  1. contact_id given: that contact must have the address as an email contact method, otherwise 422 contact_email_mismatch.
  2. new_contact given: the contact is created exactly like POST /contacts, including your workspace's duplicate rules. A duplicate returns the same 409 body as POST /contacts and nothing is sent.
  3. Neither: the oldest contact with that email address is used. If there is none, a contact with just the email address is created. If the only matching contact is one you are not allowed to see, the request fails with 409 contact_already_exists and nothing is sent.

A created contact fires the usual contact.created events.

Scopes​

WhenScope
Alwaysmessages:create or email_integrations:update
open_new_conversation: truealso conversations:create
A contact is created (new_contact, or no contact has the first To address yet)also contacts:create
assigned_user_id is setalso conversations:update

You also need access to the source conversation. A missing extra scope returns 403 with detail.code = "missing_scope" and detail.scope naming it. Forwarding is not available on plans without Conversations (403 feature_disabled).

Response​

201 Created:

{
"email_message_id": "em_67890",
"message_id": null,
"status": "queued",
"conversation_id": "conv_email_99",
"created_conversation": false,
"contact_id": null,
"created_contact": false,
"assigned_user_id": null,
"to_emails": ["[email protected]"],
"cc_emails": ["[email protected]"],
"bcc_emails": []
}

message_id (the RFC 5322 Message-ID) is always null here: it is assigned when the email is actually sent. Read it later from the email thread. conversation_id is where the forward lives: the source conversation, or the new one. In the email thread of a conversation, a forwarded email lists its forwards under forwards, and the forward itself carries forwarded_from.

Forward errors​

All errors carry detail.code:

StatuscodeMeaning
403missing_scopeAn extra scope from the table above is missing
403feature_disabledYour plan does not include Conversations
404The email does not exist or you cannot open its conversation, or an attachment_ids upload is not one you can use
409duplicate_contactnew_contact matches an existing contact (same body as POST /contacts)
409contact_already_existsThe first To address belongs to a contact you cannot see (with new_contact, or when no contact was given)
409contact_blockedThe contact of the first To address, or one of the recipient addresses, is blocked. Nothing is sent
422forward_to_own_mailboxA recipient is one of your own connected mailboxes. detail.addresses lists them
422contact_email_mismatchcontact_id does not have the first To address
422invalid_assigneeThe assignee is not an active member with access to that inbox
422assignee_requires_new_conversationassigned_user_id sent without open_new_conversation: true
422contact_requires_new_conversationcontact_id or new_contact sent without open_new_conversation: true
422invalid_channelchannel_id is not an email channel you can send from
422invalid_attachmentAn attachment ID is not one of the original's or not yours
422invalid_contactThe contact for the first To address could not be created (for example an address the contact rules reject)
500forward_queue_failedThe forward could not be queued for sending. Nothing was sent; retry later

Invalid addresses, an empty to_emails, more than 50 recipients, or both contact_id and new_contact return a standard 422 validation error.

Overriding the sender​

Both options accept a sender override. Fetch the available senders for the conversation from GET /api/v1/conversations/{id}/sender-options and pass the id as sender_id. See Mailboxes.

Sender errors​

The compose and template endpoints never queue an email that cannot be sent. Instead they return:

StatuserrorMeaning
422SENDER_INACTIVEThe sender's email connection is switched off or was deleted. With an explicit sender_id, the request fails rather than sending from a different address. Without one, SendSeven first tries the conversation's other senders and then your Default Support Mailbox, and returns this error only when none of them can send.
422NO_SENDER_ADDRESSThe connection has no verified sender address.
403SENDER_NOT_ALLOWEDYou may not send from this sender_id.
{
"detail": {
"error": "SENDER_INACTIVE",
"message": "The email connection for this sender is switched off or was removed. Switch it back on or choose a different sender.",
"sender_id": "mbx_002"
}
}

To fix it, switch the connection back on, or pick another sender from sender-options. That list only includes senders whose connection is active.

Translate an email​

Received and sent emails can be translated on request. This is the Translate button below an email in the app. Call it only on an explicit request from a team member: SendSeven never translates customer emails automatically.

curl -X POST "https://api.sendseven.com/api/v1/email-messages/em_12345/translate" \
-H "Authorization: Bearer s7_api_a1b2c3d4e5f6789012345678abcdef00" \
-H "Content-Type: application/json" \
-d '{"target_language": "en"}'
FieldTypeMeaning
target_languagestringISO 639-1 code, optionally with a region (pt-BR).
sourcestringsent (the default) translates the email as sent. original translates the author's original text of a sent email that was written in another language and sent translated (its meta.translations.original, see the reply and compose meta field).

Only the newest message is translated: quoted earlier messages and the signature are left out, as plain text. Required scope: messages:read. An email in a conversation you cannot open returns 404.

Response 200 (source sent):

{
"original": "Bonjour Madame, merci pour votre message.",
"translated": "Hello Madam, thank you for your message.",
"language": "en",
"message_id": "em_12345",
"truncated": false,
"cached": false
}

Response 200 (source original):

{
"translated": "Hello Madam, thank you for your message.",
"target_language": "en",
"source": "original",
"cached": false,
"message_id": "em_12345",
"truncated": false
}

cached is true when the translation was already stored on the email: no new translation is made. With source original, asking for the original's own language returns the original text with cached true. Translations are stored with the email (at most 8 languages each for the sent text and the original), so every team member gets the same text. Translation is available on Professional, Scale and Enterprise with AI features and Chat Translation switched on. It is free on the workspace's Fast translation level and charged by usage on Advanced (see AI credits).

StatusBodyWhen
400{"detail": "Email message has no text content to translate"}source sent and the email has no text.
403{"detail": {"code": "feature_disabled", "feature": "translation"}}Translation is not available on the plan or is switched off for the workspace.
404{"detail": "Email message not found"}Unknown email, or a conversation you cannot open.
413{"detail": {"code": "translate_too_large", ...}}The email is too long to translate in one go.
422{"detail": {"code": "no_original", ...}}source original on a received email or on a sent email without a stored original.
422{"detail": {"code": "invalid_source", ...}}source is not sent or original.
422{"detail": {"code": "invalid_language", ...}}target_language is not a supported language code.
429{"detail": {"code": "translation_rate_limited", ...}}Too many translations; honour Retry-After.

Email events​

Outbound and inbound email produce dedicated webhook events (email.sent, email.delivered, email.bounced, email.opened, email.complained, email.received). See Webhook Events.

Next steps​