Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Export Contacts Status



Operation overview

operation-overview page anchor

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

Base url: https://api.sendgrid.com

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 Status

export-contacts-status page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
curl

_19
const client = require('@sendgrid/client');
_19
client.setApiKey(process.env.SENDGRID_API_KEY);
_19
_19
const id = "ZGkrHSypTsudrGkmdpJJ";
_19
_19
const request = {
_19
url: `/v3/marketing/contacts/exports/${id}`,
_19
method: 'GET',
_19
_19
}
_19
_19
client.request(request)
_19
.then(([response, body]) => {
_19
console.log(response.statusCode);
_19
console.log(response.body);
_19
})
_19
.catch(error => {
_19
console.error(error);
_19
});


Rate this page: