provider Contacts POST
/marketing/contacts/exports @utdk/sendgrid
/marketing/contacts/exports Export Contacts
**Use this endpoint to export lists or segments of contacts**.
If you would just like to have a link to the exported list sent to your email set the `notifications.email` option to `true` in the `POST` payload.
If you would like to download the list, take the `id` that is returned and use the "Export Contacts Status" endpoint to get the `urls`. Once you have the list of URLs, make a `GET` request to each URL provided to download your CSV file(s).
You specify the segements and or/contact lists you wish to export by providing the relevant IDs in, respectively, the `segment_ids` and `list_ids` fields in the request body.
The lists will be provided in either JSON or CSV files. To specify which of these you would required, set the request body `file_type` field to `json` or `csv`.
You can also specify a maximum file size (in MB). If the export file is larger than this, it will be split into multiple files.
Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.
Try it
Authentication
Configure credentials for Email Activity (beta)
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.
Saved automatically to browser storage.
Code snippet
Updates live as you fill in the form above.
TypeScript
import sendgrid from '@utdk/sendgrid';
await sendgrid.postMcContactsExports({
"file_type": "csv",
"max_file_size": 5000
})