Skip to contentSkip to navigationSkip to topbar
On this page

Export Contacts Status



Operation overview

operation-overview page anchor

GET/v3/marketing/contacts/exports/{id}

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

This endpoint can be used to check the status of a contact export job.

To use this call, you will need the id from the "Export Contacts" call.

If you would like to download a list, take the id that is returned from the "Export Contacts" endpoint and make an API request here to get the urls. Once you have the list of URLs, make a GET request on each URL to download your CSV file(s).

Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.


Authentication

authentication page anchor
Property nameTypeRequiredDescription
authorizationstring
required
Default: Bearer <<YOUR_API_KEY_HERE>>
Property nameTypeRequiredDescription
idstring
required
200400401403404500
Schema
Property nameTypeRequiredDescriptionChild properties
idstring

Optional


statusenum<string>

Optional

The export job's status. Allowed values: pending, ready, or failure.

Possible values:
pendingreadyfailure

createdAtstring

Optional

The ISO8601 timestamp when the export was begun.


updatedAtstring

Optional

The ISO8601 timestamp when the export was updated.


completedAtstring

Optional

The ISO8601 timestamp when the export was completed.


expiresAtstring

Optional

The ISO8601 timestamp when the exported file on S3 will expire.


urlsarray[string]

Optional

One or more download URLs for the contact file if the status is ready.


messagestring

Optional

A human readable message if the status is failure.


Metadatametadata

Optional


contactCountinteger

Optional

The total number of exported contacts.

Export Contacts StatusLink to code sample: Export Contacts Status
1
const client = require("@sendgrid/client");
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const id = "id";
5
6
const request = {
7
url: `/v3/marketing/contacts/exports/${id}`,
8
method: "GET",
9
};
10
11
client
12
.request(request)
13
.then(([response, body]) => {
14
console.log(response.statusCode);
15
console.log(response.body);
16
})
17
.catch((error) => {
18
console.error(error);
19
});