Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

Remove IPs


API Overview

api-overview page anchor

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(link takes you to an external page).

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.

Request body

request-body page anchor

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.


Property nameTypeRequiredDescription
Authorizationstring
required
Default: Bearer <<YOUR_API_KEY_HERE>>
Property nameTypeRequiredDescription
accountIDstring
required

Twilio SendGrid account ID

Encoding type:application/json
SchemaExample
Property nameTypeRequiredDescriptionChild properties
ipsarray[string<ipv4>]
required

List of specific IP addresses to remove (maximum 10 per request)

Min items: 1Max items: 10
204400401403404500502503504

No Content

Remove IPs from a customer accountLink to code sample: Remove IPs from a customer account
1
const client = require("@sendgrid/client");
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const accountID = "accountID";
5
const data = {
6
ips: ["174.0.0.3", "192.0.0.1"],
7
};
8
9
const request = {
10
url: `/v3/partners/accounts/${accountID}/ips`,
11
method: "DELETE",
12
body: data,
13
};
14
15
client
16
.request(request)
17
.then(([response, body]) => {
18
console.log(response.statusCode);
19
console.log(response.body);
20
})
21
.catch((error) => {
22
console.error(error);
23
});