Skip to contentSkip to navigationSkip to topbar
On this page

Get all existing exports



API Overview

api-overview page anchor
(warning)

Legacy Marketing Campaigns

You are viewing the Legacy Marketing Campaigns API reference. For guidance migrating to the current version of Marketing Campaigns, see Migrating from Legacy Marketing Campaigns

(information)

Info

You can use this endpoint only after your system has been upgraded. Learn more about the updates to the SendGrid Legacy API.

You can export recipients, get all existing exports, or check the export status using the /v3/contactdb/exports and /v3/contactdb/exports/{id} endpoints.


GET/v3/contactdb/exports

Base url: https://api.sendgrid.com (The Twilio SendGrid v3 API)

Use this endpoint to retrieve details of all current exported jobs.

It will return an array of objects, each of which records an export job in flight or recently completed.

Each object's export_type field will tell you which kind of export it is and its status field will indicate what stage of processing it has reached. Exports which are ready will be accompanied by a urls field which lists the URLs of the export's downloadable files — there will be more than one if you specified a maximum file size in your initial export request.

Use this endpoint if you have exports in flight but do not know their IDs, which are required for the "Export Recipients Status" endpoint.


Authentication

authentication page anchor
Property nameTypeRequiredDescription
authorizationstring
required
Default: Bearer <<YOUR_API_KEY_HERE>>
200400401403404500
Schema
Property nameTypeRequiredDescriptionChild properties
resultarray[object]

Optional


Metadataobject

Optional

Get all existing exportsLink to code sample: Get all existing exports
1
const client = require("@sendgrid/client");
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const request = {
5
url: `/v3/contactdb/exports`,
6
method: "GET",
7
};
8
9
client
10
.request(request)
11
.then(([response, body]) => {
12
console.log(response.statusCode);
13
console.log(response.body);
14
})
15
.catch((error) => {
16
console.error(error);
17
});