{ "opencollection": "1.0.0", "info": { "name": "Twilio SendGrid Provisioning Account Contacts API", "version": "1.0.0" }, "request": { "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "items": [ { "info": { "name": "Contacts", "type": "folder" }, "items": [ { "info": { "name": "Get Sample Contacts", "type": "http" }, "http": { "method": "GET", "url": "https://api.sendgrid.com/v3/marketing/contacts" }, "docs": "**This endpoint will return up to 50 of the most recent contacts uploaded or attached to a list**. \n\nThis list will then be sorted by email address.\n\nThe full contact count is also returned.\n\nPlease note that pagination of the contacts has been deprecated.\n\nTwilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data." }, { "info": { "name": "Add or Update a Contact", "type": "http" }, "http": { "method": "PUT", "url": "https://api.sendgrid.com/v3/marketing/contacts", "body": { "type": "json", "data": "{}" } }, "docs": "**This endpoint allows the [upsert](https://en.wiktionary.org/wiki/upsert) (insert or update) of up to 30,000 contacts, or 6MB of data, whichever is lower**.\nBecause the creation and update of contacts is an asynchronous process, the response will not contain immediate feedback on the processing of your upserted contacts. Rather, it will contain an HTTP 202 response indicating the contacts are queued for processing or an HTTP 4XX error containing validation errors. Should you wish to get the res" }, { "info": { "name": "Delete Contacts", "type": "http" }, "http": { "method": "DELETE", "url": "https://api.sendgrid.com/v3/marketing/contacts", "params": [ { "name": "delete_all_contacts", "value": "", "type": "query", "description": "Must be set to `\"true\"` to delete all contacts." }, { "name": "ids", "value": "", "type": "query", "description": "A comma-separated list of contact IDs." } ] }, "docs": "**This endpoint can be used to delete one or more contacts**.\n\nThe query parameter `ids` must set to a comma-separated list of contact IDs for bulk contact deletion.\n\nThe query parameter `delete_all_contacts` must be set to `\"true\"` to delete **all** contacts. \n\nYou must set either `ids` or `delete_all_contacts`.\n\nDeletion jobs are processed asynchronously.\n\nTwilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data." }, { "info": { "name": "Get a Contact by ID", "type": "http" }, "http": { "method": "GET", "url": "https://api.sendgrid.com/v3/marketing/contacts/:id", "params": [ { "name": "id", "value": "", "type": "path" } ] }, "docs": "**This endpoint returns the full details and all fields for the specified contact**.\nThe \"Get Contacts by Identifier\" endpoint can be used to get the ID of a contact." }, { "info": { "name": "Get Batched Contacts by IDs", "type": "http" }, "http": { "method": "POST", "url": "https://api.sendgrid.com/v3/marketing/contacts/batch", "body": { "type": "json", "data": "{}" } }, "docs": "**This endpoint is used to retrieve a set of contacts identified by their IDs.**\n\nThis can be more efficient endpoint to get contacts than making a series of individual `GET` requests to the \"Get a Contact by ID\" endpoint.\n\nYou can supply up to 100 IDs. Pass them into the `ids` field in your request body as an array or one or more strings.\n\nTwilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data." }, { "info": { "name": "Delete a Contact Identifier", "type": "http" }, "http": { "method": "DELETE", "url": "https://api.sendgrid.com/v3/marketing/contacts/:contact_id/identifiers", "params": [ { "name": "contact_id", "value": "", "type": "path", "description": "Must be set to the `contact_id` of the contact you want to remove the identifier from." } ], "body": { "type": "json", "data": "{}" } }, "docs": "**This endpoint can be used to delete one identifier from a contact.**\n\nDeletion jobs are processed asynchronously.\n\nNote this is different from deleting a contact. If the contact has only one identifier, the asynchronous request will fail. All contacts are required to have at least one identifier.\n\nThe request body field `identifier_type` must have a valid value of \"EMAIL\", \"PHONENUMBERID\", \"EXTERNALID\", or \"ANONYMOUSID\".\n" }, { "info": { "name": "Get Total Contact Count", "type": "http" }, "http": { "method": "GET", "url": "https://api.sendgrid.com/v3/marketing/contacts/count" }, "docs": "**This endpoint returns the total number of contacts you have stored.**\n\n\nTwilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data." }, { "info": { "name": "Get All Existing Exports", "type": "http" }, "http": { "method": "GET", "url": "https://api.sendgrid.com/v3/marketing/contacts/exports" }, "docs": "**Use this endpoint to retrieve details of all current exported jobs**.\n\nIt will return an array of objects, each of which records an export job in flight or recently completed. \n\nEach 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 " }, { "info": { "name": "Export Contacts", "type": "http" }, "http": { "method": "POST", "url": "https://api.sendgrid.com/v3/marketing/contacts/exports", "body": { "type": "json", "data": "{}" } }, "docs": "**Use this endpoint to export lists or segments of contacts**.\n\nIf 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.\n\nIf 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).\n\nYou specify the segments and or/contact lists " }, { "info": { "name": "Export Contacts Status", "type": "http" }, "http": { "method": "GET", "url": "https://api.sendgrid.com/v3/marketing/contacts/exports/:id", "params": [ { "name": "id", "value": "", "type": "path" } ] }, "docs": "**This endpoint can be used to check the status of a contact export job**. \n\nTo use this call, you will need the `id` from the \"Export Contacts\" call.\n\nIf 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).\n\nTwilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost da" }, { "info": { "name": "Import Contacts", "type": "http" }, "http": { "method": "PUT", "url": "https://api.sendgrid.com/v3/marketing/contacts/imports", "body": { "type": "json", "data": "{}" } }, "docs": "**This endpoint allows a CSV upload containing up to one million contacts or 5GB of data, whichever is smaller. At least one identifier is required for a successful import.**\n\nImports take place asynchronously: the endpoint returns a URL (`upload_uri`) and HTTP headers (`upload_headers`) which can subsequently be used to `PUT` a file of contacts to be imported into our system.\n\nUploaded CSV files may also be [gzip-compressed](https://en.wikipedia.org/wiki/Gzip).\n\nIn either case, you must include" }, { "info": { "name": "Import Contacts Status", "type": "http" }, "http": { "method": "GET", "url": "https://api.sendgrid.com/v3/marketing/contacts/imports/:id", "params": [ { "name": "id", "value": "", "type": "path" } ] }, "docs": "**This endpoint can be used to check the status of a contact import job**. \n\nUse the `job_id` from the \"Import Contacts,\" \"Add or Update a Contact,\" or \"Delete Contacts\" endpoints as the `id` in the path parameter.\n\nIf there is an error with your `PUT` request, download the `errors_url` file and open it to view more details.\n\nThe job `status` field indicates whether the job is `pending`, `completed`, `errored`, or `failed`. \n\nPending means not started. Completed means finished without any errors" }, { "info": { "name": "Search Contacts", "type": "http" }, "http": { "method": "POST", "url": "https://api.sendgrid.com/v3/marketing/contacts/search", "body": { "type": "json", "data": "{}" } }, "docs": "**Use this endpoint to locate contacts**.\n\nThe request body's `query` field accepts valid [SGQL](https://sendgrid.com/docs/for-developers/sending-email/segmentation-query-language/) for searching for a contact.\n\nBecause contact emails are stored in lower case, using SGQL to search by email address requires the provided email address to be in lower case. The SGQL `lower()` function can be used for this.\n\nOnly the first 50 contacts that meet the search criteria will be returned.\n\nIf the query take" }, { "info": { "name": "Get Contacts by Emails", "type": "http" }, "http": { "method": "POST", "url": "https://api.sendgrid.com/v3/marketing/contacts/search/emails", "body": { "type": "json", "data": "{}" } }, "docs": "**This endpoint allows you to retrieve up to 100 contacts matching the searched `email` address(es), including any `alternate_emails`.** \n\nEmail addresses are unique to a contact, meaning this endpoint can treat an email address as a primary key to search by. The contact object associated with the address, whether it is their `email` or one of their `alternate_emails` will be returned if matched.\n\nEmail addresses in the search request do not need to match the case in which they're stored, but th" }, { "info": { "name": "Get Contacts by Identifiers", "type": "http" }, "http": { "method": "POST", "url": "https://api.sendgrid.com/v3/marketing/contacts/search/identifiers/:identifier_type", "params": [ { "name": "identifier_type", "value": "", "type": "path", "description": "The type of identifier to search for. You can use only one type of identifier per search." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Use this endpoint to retrieve up to 100 contacts that match the requested identifier values for a single identifier type.\n\n`identifier_type` must be a valid identifier type: `email`, `phone_number_id`, `external_id`, or `anonymous_id`.\n\nUse this endpoint instead of the [Search Contacts endpoint](https://www.twilio.com/docs/sendgrid/api-reference/contacts/search-contacts) when you can provide exact identifiers and do not need to include other [Segmentation Query Language (SGQL)](https://www.twili" } ] } ], "bundled": true }