Migration APIs
Sendgrid Migration API
Domain API
Suppression API
Template API
Tags API
Subaccount API
Events API
GDPR API
Webhooks
Powered by Stoplight
post

/sendEmail

This endpoint is solely responsible for sending emails over Pepipost’s v2 API.

This is the most recent version of our API. Pepipost do provide the advance examples on how to personalize your emails.

Pepipost provides libraries to help you quickly and easily integrate with v2 API in 7 different languages: C#, Java, Node JS, PHP, Python, and Ruby.

Using this API, you can pass the components of the messages such as To/Recipient, From, Subject, HTML/Content, attachments, etc. Pepipost will build a MIME representation of the message and send it.

In case you want to get an advanced control of MIME. Then it is suggested to use your own SMTP to generate the emails and submit to Pepipost’s SMTP to deliver. In case of SMTP, it’s you who is actually building the MIME.

While there is no limit on the number of personalization objects which you can add in a single API call, but still it is recommended to not include more than 5000 personalizations per API request. If you need to include more than 5000 personalizations, please divide these across multiple API requests.

Request Parameters

1 Header

Request Body

1 Example
Schema
object
attachments
array[object]
content
string

The HTML content to be sent in your email. You can use attributes to display dynamic values such as name, account number, etc. for ex. [% NAME %] for NAME , [% AGE %] for AGE etc.

1 validation
ampcontent
string

The AMP HTML content to be sent in your email. You can use attributes to display dynamic values such as name, account number, etc. for ex. [% NAME %] for NAME , [% AGE %] for AGE etc.

Make sure you also add HTML in content parameter which will be rendered in case AMP HTML doesn’t work on a given client.

from
object
required
personalizations
array[object]

An array of recipients and their metadata. Each object within personalizations can be thought of as an envelope - it defines who should receive an individual message and how that message should be handled.

2 validations + required
replyToId
string

Email address which need to be used as Reply-To

1 validation
settings
object
subject
string

The subject line for your email. You can also use attributes in subject like [% NAME %], [% AGE %] and these will be replaced with the respective value for the recipient.

2 validations + required
tags
string

Tags can help organize your email analytics by enabling you to “tag” emails by type or broad topic. You can define your own custom tags like “OTP Emails”, “Order Confirmation emails” etc.

Any space before and after the tag will be ignored. For instance: " New Tag " will be considered “New Tag”.

templateId
integer

You can upload the HTML content in your Pepipost account and can just pass the TemplateID here. This will save the data transfer in API call in case you are going to repeatedly use same HTML template for all your emails.

Responses

1 Example
Schema
object
data
object
message
string

Send a Test Request

Send requests directly from the browser (CORS must be enabled)
$$.env
No $$.env variables are being used in this request.