Skip to main content
POST
/
v1
/
email
/
send
Send email messages from an inbox
curl --request POST \
  --url https://api.heymarket.com/v1/email/send \
  --header 'Content-Type: application/json' \
  --data '
{
  "creator_id": 123,
  "inbox": 123,
  "text": "<string>",
  "raw_text": "<string>",
  "local_id": "<string>",
  "conv_title": "<string>",
  "targets": [
    "<string>"
  ],
  "convo_id": 123
}
'
{
  "id": 123,
  "convo_id": 123,
  "queued": true,
  "date": "<string>",
  "compliance_results": {}
}
Use this endpoint to send an email from one of your connected email inboxes. You can start a new conversation by specifying recipient addresses, or reply within an existing thread by providing a convo_id. HTML is supported in the message body.

Request body

creator_id
integer
required
The user ID of the sender.
inbox
integer
required
The ID of the email inbox to send from.
text
string
required
The body of the email. HTML is supported.
raw_text
string
A plain-text version of the email body, used as the fallback for recipients whose email clients do not render HTML.
local_id
string
A client-generated unique ID for idempotency. Duplicate requests with the same local_id will not create a second message.
conv_title
string
A title for the new conversation. Only applies when creating a new conversation (not when replying via convo_id).
targets
string[]
An array of recipient email addresses for a new conversation. Each element may contain multiple comma-separated addresses and must be prefixed with to: or cc:. For example:
["to:alice@example.com,bob@example.com", "cc:carol@example.com"]
Use targets when starting a new conversation. To reply in an existing thread, use convo_id instead.
convo_id
integer
The ID of an existing conversation to reply within. Obtain this from the convo_id field in the initial send response. Providing this keeps all messages in the same email thread.

Response

id
integer
The unique ID of the created message.
convo_id
integer
The ID of the conversation the message was added to. Save this value to send follow-up replies in the same thread.
queued
boolean
true if the message has been queued for delivery.
date
string
The ISO 8601 timestamp of when the message was sent.
compliance_results
object
An object containing compliance check results for the message.

Examples

curl --request POST \
  --url https://api.heymarket.com/v1/email/send \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "creator_id": 55,
    "inbox": 202,
    "convo_id": 10045,
    "text": "<p>Thanks for reaching out! We have processed your refund.</p>",
    "raw_text": "Thanks for reaching out! We have processed your refund."
  }'
HTML is fully supported in the text field. Use raw_text to provide a plain-text fallback for email clients that do not render HTML.
To reply within an existing email thread, provide convo_id. You can find this value in the response from the first send request that created the conversation.