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
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>
Property nameTypeRequiredDescription
idstringrequired
200400401403404500
Schema
Property nameTypeRequiredDescriptionChild properties
idstring

statusenum<string>

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

Possible values:
pendingreadyfailure

created_atstring

The ISO8601 timestamp when the export was begun.


updated_atstring

The ISO8601 timestamp when the export was updated.


completed_atstring

The ISO8601 timestamp when the export was completed.


expires_atstring

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


urlsarray[string]

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


messagestring

A human readable message if the status is failure.


_metadataobject

contact_countinteger

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 = "ZGkrHSypTsudrGkmdpJJ";
5
6
const request = {
7
url: `/v3/marketing/contacts/exports/${id}`,
8
method: 'GET',
9
10
}
11
12
client.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
});

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.