Remove IPs
The Twilio SendGrid IP Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts' IPs. This API is for companies that have a formal reseller partnership with Twilio SendGrid.
You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio SendGrid Subusers feature, which is available with Pro and Premier plans.
The IP Provisioning API IP operations allow you to add, list, and remove IPs from customer accounts.
The Remove IPs operation allows you to remove one or more IP addresses from a customer account. The Remove IPs operation requires a JSON request body containing an array of specific IP addresses to remove.
The request body contains one required field:
ips: An array of IP addresses (as strings) to remove from the customer account. You can remove between 1 and 10 IP addresses per request. Each IP address must be a valid IPv4 address in standard dotted-decimal notation (e.g., "192.168.1.1").
The account_id parameter in the URL path identifies the customer account from which the IP addresses will be removed. This account ID is the Twilio SendGrid account ID that was returned when the customer account was created. You should have this ID stored in your database for managing customer accounts.
The response to a successful Remove IPs operation returns a 204 No Content status code, indicating that the IP addresses have been successfully removed from the customer account.
DELETE/v3/partners/accounts/{accountID}/ips
Base url: https://api.sendgrid.com (for global users and subusers)
Base url: https://api.eu.sendgrid.com (for EU regional subusers)
Removes IP(s) from the specified account.
Bearer <<YOUR_API_KEY_HERE>>Twilio SendGrid account ID
application/jsonList of specific IP addresses to remove (maximum 10 per request)
1Max items: 10No Content
1const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const accountID = "accountID";5const data = {6ips: ["174.0.0.3", "192.0.0.1"],7};89const request = {10url: `/v3/partners/accounts/${accountID}/ips`,11method: "DELETE",12body: data,13};1415client16.request(request)17.then(([response, body]) => {18console.log(response.statusCode);19console.log(response.body);20})21.catch((error) => {22console.error(error);23});