Download CSV
- To gain access to the Email Activity Feed API, purchase additional email activity history.
- To purchase additional history, go to Account Details > Your Products > Add-ons in the Twilio SendGrid console.
- To query all of your stored messages, query individual messages, and download a CSV with data about the stored messages, use the Email Activity API.
- To learn how to build queries and use the API, see Getting Started with the Email Activity Feed API or go to Activity in the Twilio SendGrid console.
GET/v3/messages/download/{download_uuid}
Base url: https://api.sendgrid.com (The Twilio SendGrid v3 API)
This endpoint will return a presigned URL that can be used to download the CSV that was requested from the "Request a CSV" endpoint.
Property nameTypeRequiredDescription
Authorizationstring
required
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>
Optional
A signed link that will allow you to download the CSV file requested by the Request a CSV endpoint.
1const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const download_uuid = "f15982c1-a82c-4e87-a6b2-a4a63b4b7644";56const request = {7url: `/v3/messages/download/${download_uuid}`,8method: "GET",9};1011client12.request(request)13.then(([response, body]) => {14console.log(response.statusCode);15console.log(response.body);16})17.catch((error) => {18console.error(error);19});