Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Download CSV



API Overview

api-overview page anchor

You must purchase additional email activity history(link takes you to an external page) to gain access to the Email Activity Feed API.

The Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages.

Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them.

See "Getting Started with the Email Activity Feed API" for help building queries and working with the API.

You can also work with email activity in the Activity section of the Twilio SendGrid App(link takes you to an external page).


GET/v3/messages/download/{download_uuid}

Base url: https://api.sendgrid.com

This endpoint will return a presigned URL that can be used to download the CSV that was requested from the "Request a CSV" endpoint.


Authentication

authentication page anchor
Property nameTypeRequiredDescription
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>
Property nameTypeRequiredDescription
download_uuidstring<uuid>required

UUID used to locate the download csv request entry in the DB.

This is the UUID provided in the email sent to the user when their csv file is ready to download

200404500
SchemaExample
Property nameTypeRequiredDescriptionChild properties
presigned_urlstring<uri>

A signed link that will allow you to download the CSV file requested by the Request a CSV endpoint.


csvstring

Returns the aws signed link to the csv file which mako UI should perform a get on to trigger the csv download for the user

Pattern: ^((http[s]?|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$Min length: 5

Download CSV

download-csv page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
curl

_19
const client = require('@sendgrid/client');
_19
client.setApiKey(process.env.SENDGRID_API_KEY);
_19
_19
const download_uuid = "f15982c1-a82c-4e87-a6b2-a4a63b4b7644";
_19
_19
const request = {
_19
url: `/v3/messages/download/${download_uuid}`,
_19
method: 'GET',
_19
_19
}
_19
_19
client.request(request)
_19
.then(([response, body]) => {
_19
console.log(response.statusCode);
_19
console.log(response.body);
_19
})
_19
.catch(error => {
_19
console.error(error);
_19
});


Rate this page: