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

Add 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 Add IPs operation allows you to provision and add one or more IP addresses to a customer account. The Add IPs operation requires a JSON request body specifying the number of IPs to provision and the region where they should be provisioned.

Request body

request-body page anchor

The request body contains two required fields:

  • count: The number of IP addresses to provision and add to the customer account. You can add between 1 and 10 IP addresses per request.
  • region: The geographic region where the IP addresses should be provisioned. Valid values are eu (Europe) or us (United States). All IP addresses in a single request must be from the same region.

The account_id parameter in the URL path identifies the customer account to which the IP addresses will be added. 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 Add IPs operation returns a 201 Created status code. The response body contains an array of the provisioned IP addresses and the region where they are located.


POST/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)

Adds IP(s) to 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
countinteger<int64>
required

Number of IPs to add (maximum 10 per request)

Minimum: 1Maximum: 10

regionenum<string>
required

The region where the IPs should be provisioned (all IPs in a single request must be from the same region)

Possible values:
euus
201400401403404500502503504

Created

SchemaExample
Property nameTypeRequiredDescriptionChild properties
ipsarray[string<ipv4>]

Optional


regionenum<string>

Optional

The region where the IP addresses are located

Possible values:
euus
Add IPs to a customer account in US regionLink to code sample: Add IPs to a customer account in US region
1
const client = require("@sendgrid/client");
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const accountID = "accountID";
5
const data = {
6
count: 2,
7
region: "us",
8
};
9
10
const request = {
11
url: `/v3/partners/accounts/${accountID}/ips`,
12
method: "POST",
13
body: data,
14
};
15
16
client
17
.request(request)
18
.then(([response, body]) => {
19
console.log(response.statusCode);
20
console.log(response.body);
21
})
22
.catch((error) => {
23
console.error(error);
24
});
Add IPs to a customer account in EU regionLink to code sample: Add IPs to a customer account in EU region
1
const client = require("@sendgrid/client");
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const accountID = "accountID";
5
const data = {
6
count: 2,
7
region: "us",
8
};
9
10
const request = {
11
url: `/v3/partners/accounts/${accountID}/ips`,
12
method: "POST",
13
body: data,
14
};
15
16
client
17
.request(request)
18
.then(([response, body]) => {
19
console.log(response.statusCode);
20
console.log(response.body);
21
})
22
.catch((error) => {
23
console.error(error);
24
});