Send an email
const url = 'https://api.pingram.io/email';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"type":"example","to":"example","subject":"example","html":"example","fromName":"example","fromAddress":"example","previewText":"example","replyToAddresses":["example"],"ccAddresses":["example"],"bccAddresses":["example"],"openTracking":true,"clickTracking":true,"attachments":[{"filename":"example","url":"example"}],"schedule":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pingram.io/email \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "type": "example", "to": "example", "subject": "example", "html": "example", "fromName": "example", "fromAddress": "example", "previewText": "example", "replyToAddresses": [ "example" ], "ccAddresses": [ "example" ], "bccAddresses": [ "example" ], "openTracking": true, "clickTracking": true, "attachments": [ { "filename": "example", "url": "example" } ], "schedule": "example" }'Send an email. Requires type, to, subject, and html. Optional: fromAddress, fromName, schedule, attachments. To reach people outside your account, use an address on a verified domain. The shared Pingram address can only email the account itself and always sends as noreply.
Authorizations
Request Bodyrequired
Request body for POST /email (send email without a template).
object
The notification type to send.
The email address of the recipient.
The subject of the email.
The HTML body of the email.
The display name of the sender.
The email address of the sender.
The preview text of the email.
The reply-to addresses of the email.
The CC addresses of the email.
The BCC addresses of the email.
When false, this send does not record opens and no open pixel is added. Delivery, bounce, and complaint events are unchanged. Defaults to true.
When false, links are left as written and clicks are not recorded. Delivery, bounce, and complaint events are unchanged. Defaults to true.
URL-based file attachments. Up to 20 MB per file.
object
The ISO 8601 datetime to schedule the email.
Examplegenerated
{ "type": "example", "to": "example", "subject": "example", "html": "example", "fromName": "example", "fromAddress": "example", "previewText": "example", "replyToAddresses": [ "example" ], "ccAddresses": [ "example" ], "bccAddresses": [ "example" ], "openTracking": true, "clickTracking": true, "attachments": [ { "filename": "example", "url": "example" } ], "schedule": "example"}Responses
200
Successful response
Success response for POST /email.
object
Error response for POST /email.
object
Error details for email send failures.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "messages": [ "example" ]}400
Bad Request - validation errors, invalid input
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}401
Unauthorized
402
Payment Required - usage limits exceeded
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}500
Internal Server Error
502
Bad Gateway - provider error
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}