POST
/
sender
/
send
curl --request POST \
  --url https://api.jsxmail.org/sender/send \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "subject": "Hello, world!",
  "html": "<h1>Hello, world!</h1>",
  "to": [
    "test@example.com"
  ],
  "sender": "sender@jsxmail.org",
  "attachmentIds": [
    "<string>"
  ],
  "attachments": [
    {
      "fileName": "<string>",
      "content": "<string>"
    }
  ],
  "bulkSendingId": "b4f8d8c4-3c2e-4f2a-9f2e-3c2e4f2a9f2e",
  "customPayload": {
    "key1": "value1",
    "key2": "value2"
  },
  "contactId": "a1b2c3d4-5e6f-7g8h-9i0j-1k2l3m4n5o6p",
  "priority": "normal",
  "webhook": {
    "url": "<string>",
    "status": [
      "queued"
    ]
  }
}'
{
  "id": "<string>",
  "to": [
    "<string>"
  ],
  "subject": "<string>",
  "senderId": "<string>",
  "status": "<string>",
  "userId": "<string>",
  "sentAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
The data of the email to send
subject
string
required

The subject line of the email.

Example:

"Hello, world!"

html
string
required

The HTML content of the email body.

Example:

"<h1>Hello, world!</h1>"

to
string[]
required

Array of recipient email addresses.

sender
string

Optional email address of the sender. If not provided, the most recently created sender will be used.

Example:

"sender@jsxmail.org"

attachmentIds
string[]

Optional array of files IDs to attach to the email. This is in a close beta and requires a special permission. Contact support to get access.

attachments
object[]

Optional array of temporary attachments. These attachments will not be stored in the database and will be used only for this email.

bulkSendingId
string

Optional ID to associate the email with a bulk sending operation.

Example:

"b4f8d8c4-3c2e-4f2a-9f2e-3c2e4f2a9f2e"

customPayload
object

Optional custom data to associate with the message. This is used to pass data like {{variable}} to the email body or subject.

Example:
{ "key1": "value1", "key2": "value2" }
contactId
string

Optional ID of a contact to associate the email with.

Example:

"a1b2c3d4-5e6f-7g8h-9i0j-1k2l3m4n5o6p"

priority
enum<string>
default:normal

Optional priority of the email. 'high' priority emails will be processed before 'normal' priority emails in the queue.

Available options:
normal,
high
webhook
object

Optional webhook configuration for receiving notifications about message status changes

Response

201
application/json
The email was sent successfully
id
string
required
to
string[]
required
subject
string
required
senderId
string
required
status
string
required
userId
string
required
sentAt
string