Request a 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.
POST/v3/messages/download
Base url: https://api.sendgrid.com (The Twilio SendGrid v3 API)
This request will kick off a backend process to generate a CSV file. Once generated, the worker will then send an email for the user download the file. The link will expire in 3 days.
The CSV will contain the events from the last 30 days, limited to the last 1 million events maximum. This endpoint will be rate limited to 1 request every 12 hours (rate limit may change).
This endpoint is similar to the GET Single Message endpoint - the only difference is that /download is added to indicate that this is a CSV download requests but the same query is used to determine what the CSV should contain.
Property nameTypeRequiredDescription
Authorizationstring
required
Default:
Bearer <<YOUR_API_KEY_HERE>>Property nameTypeRequiredDescription
querystring
Optional
Uses a SQL like syntax to indicate which messages to include in the CSV
202400429500
SchemaExample
Property nameTypeRequiredDescriptionChild properties
statusenum<string>
Optional
Possible values:
pendingmessagestring
Optional
1const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const request = {5url: `/v3/messages/download`,6method: "POST",7};89client10.request(request)11.then(([response, body]) => {12console.log(response.statusCode);13console.log(response.body);14})15.catch((error) => {16console.error(error);17});