REST API: send email with attachments (E-MAIL API)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 05:19 AM
Hello All,
I would like to send email with attachments using REST API.
Here's what's working:
- Adding attachment and getting its sys_id
- Sending email associated with specific record.
But how to send e-mail with attachment, Currently I don't see option to specify attachment sys_id in E-MAIL API request.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 10:35 AM
For the system to send an email with an attachment you have to attach the attachment to the sys_email record. Or you have to store the attachment and then just include a link in the email to the attachment. I don't believe the Email API supports including an attachment directly.
Depending on the other details it may be easier to create a table that will have the email details so you can create a record there and then add the attachment to that record then use a system notification to send the message.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 10:58 AM
In which parameter should I attach the attachment link? I already have the attachments with the case, but I want to compose an email and send them with the message via the Email API.
Email API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 01:44 PM
Hi @derick3778 - What's the use case? Also, it might be helpful if you share the current configuration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 05:06 PM
I have an open case and after completing all operations, another system generates a PDF and I attach it to the case. Therefore, I would like to simulate the "compose email" option with attachment, which is available in the graphical version of the website through the REST Email API. However, there is no option there to send the email with attachment to the client. The idea of what is implemented is below:
BASE_URL = BASE_URL_SN + "api/now/v1/email"
def send_email(
self,
to: list[str] = None,
subject: str = None,
text: str = None,
table_name: str = "sn_case",
table_record_id: str = None,
content_type: str = "application/json",
attachement_file = None, #idea of variable
):
data = {
"to": to,
"subject": subject,
"text": text,
"table_name": table_name,
"table_record_id": table_record_id,
}
output = requests.post(
url=self.BASE_URL,
headers={
"Authorization": f"Bearer {self.access_token}",
"Accept": "application/json",
"Content-Type": content_type,
},
files=attachement_file,
data=json.dumps(data),
)
return output
However, there is no option to send an attachment in this Email API like there is in the "compose email" option on the case page.