Send campaigns via the API
Do you want to send your large-scale direct mail campaign sends more programmatically through the API? Well, now you can, too!
When creating campaigns, you’ll interact with 3 main models: campaigns, creatives, and uploads.
- The campaigns model is used to set up high-level information about your campaign
- The creatives model is used for uploading artwork and artwork settings for your campaign
- The uploads model is used to build your audience and configure any recipient-level details for your campaign
Follow the steps below to create your first campaign in the API.
First, create your campaign. At a minimum, your campaign needs a
"name": "Demo Campaign",
The next step is to create your creative object that will be associated with the campaign. You can only associate a single creative with a campaign. You are required to add a
resource_type, and any requirements for your selected
resource_type. If sending a letter, you will also need a
Creating your audience, or “upload”, is the next step. This can be done prior to Step 2 as well. For more information on how to best structure your upload for Steps 3 and 4, visit our campaign audience guide.
"address_line1": "primary line",
After creating your upload object, you can now upload your file as a byte stream (binary file).
Finally, you can execute your campaign! To see the status of your mail pieces as they are created, use the
First, let us know that you would like to create a failure export. Your response will include an export ID, which will be used to retrieve the export URL in the next step.
You can then retrieve the S3 URL of the export from the
GETresponse above. Your export will include row-level details on why each record failed.