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

List 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 List IPs operation allows you to retrieve all IP addresses associated with a specific customer account. IPs are returned ordered by most recently added, with each IP including its address and the region where it is provisioned.

Pagination

pagination page anchor

This endpoint returns 10 results per request by default. You can receive a maximum of 5,000 results per request by setting the limit query parameter. If the customer account has more IPs than the limit, you can use the offset and limit query parameters to iterate through the IPs in successive API calls to the endpoint. The offset parameter should be set to the last IP address from the previous response.

The account_id parameter in the URL path identifies the customer account whose IPs you want to retrieve. This account ID is the Twilio SendGrid account ID that was returned when the customer account was created.

The response contains an array of IP objects, each with an ip field (the IP address) and a region field (either us or eu). The response also includes a pages object for pagination.


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

Retrieves a paginated list of IPs associated with the specified account, ordered by most recently added IP.


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

Twilio SendGrid account ID

Property nameTypeRequiredDescription
limitinteger

Optional

Number of items to return

Default: 10Minimum: 1Maximum: 5000

offsetstring<ipv4>

Optional

The last item successfully retrieved

200400401403404500502503504

OK

SchemaExample
Property nameTypeRequiredDescriptionChild properties
resultarray[object]

Optional


pagesPagination

Optional

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