Skip to main content
You can send an email campaign with a file attached by calling an API operation. Here’s how it works:
  1. You upload the file to the server, which returns a unique identifier for it.
  2. You send the campaign through an operation, passing that identifier in the call. The file is attached to the email.
Here’s a closer look at each step.

1. Upload the attachment to the server

The upload uses the standard file upload method. This section walks through doing it yourself in Postman.
1

Prepare the request

Select the POST method, then build the request URL for your account.The general form of the URL:
One part needs editing: after the = sign in endpointId, put the system name of the integration point the operation will be called through.You can use any integration point from the Integrations section. The system name is in the Endpoint column.A finished URL looks like this:
2

Add the headers

Copy the headers below into the Headers tab. This operation requires a secret key — replace {Secret key} with the secret key of the integration point you specified in endpointId.
3

Attach the file to the request

Go to the Body tab and select form-data.Choose File in the Key field, then click Select files in the Value field. In the file picker, select the file you want to attach to the campaign.
4

Send the request

Click Send and copy the fileId value from the response.

2. Create an automated email campaign

Follow the steps in How to Create Automated Email Campaign.

3. Add an operation with a step that sends the campaign

Create the operation as described in API v3 Methods: Basics. Example of an operation:

Build the call

Open the operation description. When an operation uses the Send Email step, its request specification gains a contract for attaching a file:
  • fileId — the file identifier you got in step 1.
  • fileName — the name the file will have in the sent email.
Both fields are required to send an attachment. Example request body:

FAQ

These formats are supported:
The maximum size of an email including all its attachments is 25 MB.
No. You can attach any number of files.
You can’t view attachments from the account interface. To check one, forward the email to yourself from the customer profile.
Forwarding a campaign with an attachment requires the Forwarding email attachments permission. Out of the box only the Owners group has it, and it can be granted to others. If a user doesn’t have it, the email is forwarded without the attachment.