Postman Guide
Go to Postman v1
  • 🥳About Postman v1 (Postman Legacy)
  • Campaign Guide - General
    • 🚀How to send a campaign?
      • ☝️Before You Start
        • Demo Mode
  • Campaign Guide - Email
    • 📧Email Campaigns - Basics
      • How do I send an email campaign?
      • Scheduled Sending
      • Bounced Emails and Halted Campaigns
      • Email Statistics
      • Formatting your Message Template
      • Variable Fields
      • Unique URL Link per Recipient
      • Pasting Content from Microsoft Word
      • Manage your Unsubscriptions
      • Understanding Unsubscriptions
    • 🔐Sending Password-Protected Emails
      • Tutorial
      • Template Editor
  • Campaign Guide - SMS
    • 📲SMS Campaigns - Basics
      • Before Starting Out
      • Summary of Costs
    • 🪜SMS Onboarding Overview
      • Step 1: Sender ID Registration
      • Step 2: Sign up for a Twilio account
      • Step 3: Set up your Twilio account
      • Step 4: Configure Your Twilio Account
        • What if I need to buy a phone number?
      • Step 5: Send a Test Message on Twilio
      • Step 6: Fill in your Twilio credentials in Postman!
        • How do I send a campaign with my saved SMS credentials?
    • 🤔What else do I need to know about sending SMSes?
      • More about Sender ID registration
      • Can I see the send status of my campaign?
      • How can I configure my SMS send rate?
      • Sending an SMS to a Foreign Number
      • SMS Best Practices
      • Useful Twilio Links
  • Campaign Guide - Telegram
    • 🤖Telegram Campaigns - Basics
      • How do I set up Telegram to send my campaigns?
      • Add Telegram Bot Token in Postman
      • Instructions for Recipient Onboarding
      • Use the Bot in the Campaign
      • Telegram Formatting
      • Telegram Bot Statistics
  • Email API Guide
    • 📖Overview
      • IM8 Policies
      • Connecting your Intranet Application
      • API Response Formats
    • 🗝️Email API Key Management
      • Bearer Authentication
      • Generate your email API Key
      • Rotate your email API Key
    • 📨Programmatic Email API
      • Getting Started
      • Comparison with AMR
      • SG-Mail Whitelisting
      • Custom From Address
      • Tracking Email Status
      • Send Email API
        • From Name and From Address
        • CC and BCC
        • Recipient Blacklist
        • Email Tagging and Classification
        • Email Body
          • Embedding Images
            • Linked Images
            • Content-ID Images
        • Attachments
        • Rate Limit
      • Get Email by ID API
      • List Emails API
    • 📨Programmatic GovSG WhatsApp API
      • Getting Started
      • Tracking Message Status
      • Get Available Templates API
      • Send Message API
      • Get Message by ID API
      • List Messages API
    • 🎓Frequently Asked Questions
  • FAQ
    • 📶Service Status
    • For Recipients
      • Check Email Authenticity
    • For Senders
      • Messaging Channel Comparison
      • Cost Breakdown
  • Legal
    • Terms & Conditions
    • Privacy Policy
  • Contact Us
  • GitHub
Powered by GitBook
On this page
  • Overview
  • Supported attachment file types
  • Sample API calls
  • API call with one attachment
  • API call with two attachments
  • Sample code
  • JavaScript

Was this helpful?

  1. Email API Guide
  2. Programmatic Email API
  3. Send Email API

Attachments

PreviousContent-ID ImagesNextRate Limit

Last updated 8 months ago

Was this helpful?

Our programmatic email API supports attachments via .

Overview

  • The attachment feature is only available to users who have . If your agency would like to set this up, .

  • Each email can have up to 10 attachments.

  • Each attachment should not exceed 2MB in size.

  • The cumulative size of all attachments should not exceed 10MB.

  • You can find the list of supported attachment file types below.

You will receive a 413 error if the requirements above are not met.

Supported attachment file types

List of supported attachment file types
  • asc

  • avi

  • bmp

  • csv

  • dgn

  • docx

  • dwf

  • dwg

  • dxf

  • ent

  • gif

  • jpeg

  • jpg

  • mpeg

  • mpg

  • mpp

  • odb

  • odf

  • odg

  • ods

  • pdf

  • png

  • pptx

  • rtf

  • sxc

  • sxd

  • sxi

  • sxw

  • tif

  • tiff

  • txt

  • wmv

  • xlsx

Sample API calls

API call with one attachment

curl --location --request POST 'https://api.postman.gov.sg/v1/transactional/email/send' \
--header 'Authorization: Bearer your_api_key' \
--form 'body="<p>Hello <b>there</b></p>"' \
--form 'recipient="recipient@agency.gov.sg"' \
--form 'attachments=@"/your/local/path-to-file"' \
--form 'subject="Test email"'
--form 'from="user@agency.gov.sg"'

API call with two attachments

curl --location --request POST 'https://api.postman.gov.sg/v1/transactional/email/send' \
--header 'Authorization: Bearer your_api_key' \
--form 'body="<p>Hello <b>there</b></p>"' \
--form 'recipient="recipient@agency.gov.sg"' \
--form 'attachments=@"/your/local/path-to-file-1"' \
--form 'attachments=@"/your/local/path-to-file-2"' \
--form 'subject="Test email"'
--form 'from="user@agency.gov.sg"'

Sample code

JavaScript

const data = new FormData();
data.append("recipient", "recipient@agency.gov.sg");
data.append("subject", "Test email");
data.append("body", "<p>Hello <b>there</b></p>");
data.append("from", "user@agency.gov.sg");
data.append("attachments", "/your/local/path-to-file-1");
data.append("attachments", "/your/local/path-to-file-2");

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.postman.gov.sg/v1/transactional/email/send");
xhr.setRequestHeader("Authorization", "Bearer your_api_key");

xhr.send(data);

📨
multipart/form-data requests
set up sending emails from their own domains
contact us