{ "opencollection": "1.0.0", "info": { "name": "Twilio SendGrid Provisioning Account Recipients API", "version": "1.0.0" }, "request": { "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "items": [ { "info": { "name": "Recipients", "type": "folder" }, "items": [ { "info": { "name": "Retrieve recipients", "type": "http" }, "http": { "method": "GET", "url": "https://api.sendgrid.com/v3/contactdb/recipients", "headers": [ { "name": "on-behalf-of", "value": "" } ], "params": [ { "name": "page", "value": "", "type": "query", "description": "Page index of first recipients to return (must be a positive integer)" }, { "name": "page_size", "value": "", "type": "query", "description": "Number of recipients to return at a time (must be a positive integer between 1 and 1000)" } ] }, "docs": "**This endpoint allows you to retrieve all of your Marketing Campaigns recipients.**\n\nBatch deletion of a page makes it possible to receive an empty page of recipients before reaching the end of\nthe list of recipients. To avoid this issue; iterate over pages until a 404 is retrieved." }, { "info": { "name": "Add recipients", "type": "http" }, "http": { "method": "POST", "url": "https://api.sendgrid.com/v3/contactdb/recipients", "headers": [ { "name": "on-behalf-of", "value": "" } ], "body": { "type": "json", "data": "{}" } }, "docs": "**This endpoint allows you to add a Marketing Campaigns recipient.**\n\nYou can add custom field data as a parameter on this endpoint. We have provided an example using some of the default custom fields SendGrid provides.\n\nThe rate limit is three requests every 2 seconds. You can upload 1000 contacts per request. So the maximum upload rate is 1500 recipients per second." }, { "info": { "name": "Update Recipient", "type": "http" }, "http": { "method": "PATCH", "url": "https://api.sendgrid.com/v3/contactdb/recipients", "headers": [ { "name": "on-behalf-of", "value": "" } ], "body": { "type": "json", "data": "{}" } }, "docs": "**This endpoint allows you to update one or more recipients.**\n\nThe body of an API call to this endpoint must include an array of one or more recipient objects.\n\nIt is of note that you can add custom field data as parameters on recipient objects. We have provided an example using some of the default custom fields SendGrid provides." }, { "info": { "name": "Delete Recipients", "type": "http" }, "http": { "method": "DELETE", "url": "https://api.sendgrid.com/v3/contactdb/recipients", "headers": [ { "name": "on-behalf-of", "value": "" } ], "body": { "type": "json", "data": "{}" } }, "docs": "**This endpoint allows you to deletes one or more recipients.**\n\nThe body of an API call to this endpoint must include an array of recipient IDs of the recipients you want to delete." }, { "info": { "name": "Retrieve a single recipient", "type": "http" }, "http": { "method": "GET", "url": "https://api.sendgrid.com/v3/contactdb/recipients/:recipient_id", "headers": [ { "name": "on-behalf-of", "value": "" } ], "params": [ { "name": "recipient_id", "value": "", "type": "path", "description": "The ID of the recipient that you want to retrieve." } ] }, "docs": "**This endpoint allows you to retrieve a single recipient by ID from your contact database.**" }, { "info": { "name": "Delete a Recipient", "type": "http" }, "http": { "method": "DELETE", "url": "https://api.sendgrid.com/v3/contactdb/recipients/:recipient_id", "headers": [ { "name": "on-behalf-of", "value": "" } ], "params": [ { "name": "recipient_id", "value": "", "type": "path", "description": "The ID of the recipient that you want to retrieve." } ] }, "docs": "**This endpoint allows you to delete a single recipient with the given ID from your contact database.**\n\n> Use this to permanently delete your recipients from all of your contact lists and all segments if required by applicable law." }, { "info": { "name": "Retrieve the lists that a recipient is on", "type": "http" }, "http": { "method": "GET", "url": "https://api.sendgrid.com/v3/contactdb/recipients/:recipient_id/lists", "headers": [ { "name": "on-behalf-of", "value": "" } ], "params": [ { "name": "recipient_id", "value": "", "type": "path", "description": "The ID of the recipient for whom you are retrieving lists." } ] }, "docs": "**This endpoint allows you to retrieve the lists that a given recipient belongs to.**\n\nEach recipient can be on many lists. This endpoint gives you all of the lists that any one recipient has been added to." }, { "info": { "name": "Retrieve the count of billable recipients", "type": "http" }, "http": { "method": "GET", "url": "https://api.sendgrid.com/v3/contactdb/recipients/billable_count", "headers": [ { "name": "on-behalf-of", "value": "" } ] }, "docs": "**This endpoint allows you to retrieve the number of Marketing Campaigns recipients that you will be billed for.**\n\nYou are billed for marketing campaigns based on the highest number of recipients you have had in your account at one time. This endpoint will allow you to know the current billable count value." }, { "info": { "name": "Retrieve a Count of Recipients", "type": "http" }, "http": { "method": "GET", "url": "https://api.sendgrid.com/v3/contactdb/recipients/count", "headers": [ { "name": "on-behalf-of", "value": "" } ] }, "docs": "**This endpoint allows you to retrieve the total number of Marketing Campaigns recipients.**" }, { "info": { "name": "Search recipients", "type": "http" }, "http": { "method": "GET", "url": "https://api.sendgrid.com/v3/contactdb/recipients/search", "headers": [ { "name": "on-behalf-of", "value": "" } ], "params": [ { "name": "{field_name}", "value": "", "type": "query" } ] }, "docs": "**This endpoint allows you to perform a search on all of your Marketing Campaigns recipients.**\n\nfield_name:\n\n* is a variable that is substituted for your actual custom field name from your recipient.\n* Text fields must be url-encoded. Date fields are searchable only by unix timestamp (e.g. 2/2/2015 becomes 1422835200)\n* If field_name is a 'reserved' date field, such as created_at or updated_at, the system will internally convert\nyour epoch time to a date range encompassing the entire day. For e" }, { "info": { "name": "Search recipients", "type": "http" }, "http": { "method": "POST", "url": "https://api.sendgrid.com/v3/contactdb/recipients/search", "body": { "type": "json", "data": "{}" } }, "docs": "Search using segment conditions without actually creating a segment.\nBody contains a JSON object with `conditions`, a list of conditions as described below, and an optional `list_id`, which is a valid list ID for a list to limit the search on.\n\nValid operators for create and update depend on the type of the field for which you are searching.\n\n- Dates:\n - `\"eq\"`, `\"ne\"`, `\"lt\"` (before), `\"gt\"` (after)\n - You may use MM/DD/YYYY for day granularity or an epoch for second granularity.\n - `\"emp" }, { "info": { "name": "Get Recipient Upload Status", "type": "http" }, "http": { "method": "GET", "url": "https://api.sendgrid.com/v3/contactdb/status", "headers": [ { "name": "on-behalf-of", "value": "" } ] }, "docs": "**This endpoint allows you to check the upload status of a Marketing Campaigns recipient.**" }, { "info": { "name": "Get All Existing Exports", "type": "http" }, "http": { "method": "GET", "url": "https://api.sendgrid.com/v3/contactdb/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 Recipients", "type": "http" }, "http": { "method": "POST", "url": "https://api.sendgrid.com/v3/contactdb/exports", "body": { "type": "json", "data": "{}" } }, "docs": "**Use this endpoint to export lists or segments of recipients**.\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 Recipients 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/recipient " }, { "info": { "name": "Export Recipients Status", "type": "http" }, "http": { "method": "GET", "url": "https://api.sendgrid.com/v3/contactdb/exports/:id", "params": [ { "name": "id", "value": "", "type": "path" } ] }, "docs": "**This endpoint can be used to check the status of a recipient export job**. \n\nTo use this call, you will need the `id` from the \"Export Recipients\" call.\n\nIf you would like to download a list, take the `id` that is returned from the \"Export Recipients\" 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 recipients regularly as a backup to avoid issues or" } ] } ], "bundled": true }