# Get a List of all IP Addresses on your Account

## API Overview

The IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](/docs/sendgrid/api-reference/ip-address) and [IP Pools API](/docs/sendgrid/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. More details about each operation can be found in the descriptions and schemas for each endpoint.

> \[!NOTE]
>
> Regional Email sending in the European Union (EU) is available for [Twilio SendGrid Pro plan or above](https://sendgrid.com/en-us/pricing). EU Regional Email sending requires use of an EU IP address and EU subuser. Learn more about [sending emails with Twilio SendGrid on EU servers](https://www.twilio.com/en-us/blog/send-emails-in-eu).

> \[!WARNING]
>
> The IP Address Management API is in public beta at this time. This means the API and documentation are still in development and subject to change without advanced notice.

## Operation overview

```json
{"path":"https://api.sendgrid.com/v3/send_ips/ips","method":"get","servers":[{"url":"https://api.sendgrid.com","description":"for global users and subusers"},{"url":"https://api.eu.sendgrid.com","description":"for EU regional subusers"}]}
```

This operation returns a list of all IP addresses associated with your account. A sample of IP details is returned with each IP, including which Pools the IP is associated with, whether the IP is set to warm up automatically, and when the IP was last updated.

### Limitations

The `is_parent_assigned` parameter and `pool` parameter cannot be used at the same time. By definition, an IP cannot be assigned to a Pool if it is not first enabled. You can use either the `before_key` or `after_key` in combination with the `limit` parameter to iterate through paginated results but not both.

## Operation details

### Authentication

API Key

### Headers

```json
[{"in":"header","name":"Authorization","required":true,"default":"Bearer <<YOUR_API_KEY_HERE>>","schema":{"type":"string"}}]
```

### Query string

```json
[{"name":"ip","in":"query","required":false,"schema":{"type":"string"},"description":"Specifies an IP address. The `ip` query parameter can be used to filter results by IP address.","refName":"#/components/parameters/IpAddressManagementQueryIp","modelName":"__components_parameters_IpAddressManagementQueryIp"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"},"description":"Specifies the number of results to be returned by the API. This parameter can be used in combination with the `before_key` or `after_key` parameters to iterate through paginated results.","refName":"#/components/parameters/IpAddressManagementLimit","modelName":"__components_parameters_IpAddressManagementLimit"},{"name":"after_key","in":"query","required":false,"schema":{"type":"integer"},"description":"Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results.","refName":"#/components/parameters/IpAddressManagementAfterKey","modelName":"__components_parameters_IpAddressManagementAfterKey"},{"name":"before_key","in":"query","required":false,"schema":{"type":"string"},"description":"Specifies which items to be returned by the API. When the `before_key` is specified, the API will return items beginning from the first item before the item specified. This parameter can be used in combination with `limit` to iterate through paginated results.","refName":"#/components/parameters/IpAddressManagementBeforeKey","modelName":"__components_parameters_IpAddressManagementBeforeKey"},{"name":"is_leased","in":"query","required":false,"schema":{"type":"boolean"},"description":"Indicates whether an IP address is leased from Twilio SendGrid. If `false`, the IP address is not a Twilio SendGrid IP; it is a customer's own IP that has been added to their Twilio SendGrid account.","refName":"#/components/parameters/IpAddressManagementIsLeased","modelName":"__components_parameters_IpAddressManagementIsLeased"},{"name":"is_enabled","in":"query","required":false,"schema":{"type":"boolean"},"description":"Indicates if the IP address is billed and able to send email. This parameter applies to non-Twilio SendGrid APIs that been added to your Twilio SendGrid account. This parameter's value is `null` for Twilio SendGrid IP addresses.","refName":"#/components/parameters/IpAddressManagementIsEnabled","modelName":"__components_parameters_IpAddressManagementIsEnabled"},{"name":"is_parent_assigned","in":"query","required":false,"schema":{"type":"boolean"},"description":"A parent must be assigned to an IP address before the parent can send mail from the IP and before the address can be assigned to an IP pool. Set this parameter value to true to allow the parent to send mail from the IP and make the IP eligible for IP pool assignment using the IP pool endpoints.","refName":"#/components/parameters/IpAddressManagementIsParentAssigned","modelName":"__components_parameters_IpAddressManagementIsParentAssigned"},{"name":"pool","in":"query","required":false,"schema":{"type":"string"},"description":"Specifies the unique ID for an IP Pool. When included, only IP addresses belonging to the specified Pool will be returned.","refName":"#/components/parameters/IpAddressManagementPool","modelName":"__components_parameters_IpAddressManagementPool"},{"name":"start_added_at","in":"query","required":false,"schema":{"type":"integer"},"description":"The `start_added_at` and `end_added_at` parameters are used to set a time window. IP addresses that were added to your account in the specified time window will be returned. The `start_added_at` parameter sets the beginning of the time window.","refName":"#/components/parameters/IpAddressManagementStartAddedAt","modelName":"__components_parameters_IpAddressManagementStartAddedAt"},{"name":"end_added_at","in":"query","required":false,"schema":{"type":"integer"},"description":"The `start_added_at` and `end_added_at` parameters are used to set a time window. IP addresses that were added to your account in the specified time window will be returned. The `end_added_at` parameter sets the end of the time window.","refName":"#/components/parameters/IpAddressManagementEndAddedAt","modelName":"__components_parameters_IpAddressManagementEndAddedAt"},{"name":"region","in":"query","required":false,"description":"Allowed values are `all`, `eu`, and `us`. If you provide a specific region, results will include all pools that have at least one IP in the filtered region. If `all`, pools with at least one IP (regardless of region) will be returned. If the `region` filter is not provided, the query returns all pools, including empty ones.","schema":{"type":"string","enum":["all","eu","us"],"refName":"Region7","modelName":"Region7"},"refName":"#/components/parameters/IpAddressManagementRegion","modelName":"__components_parameters_IpAddressManagementRegion"},{"name":"include_region","in":"query","required":false,"description":"Boolean indicating whether or not to return the IP Pool's region information in the response.","schema":{"type":"boolean","default":false},"refName":"#/components/parameters/IpAddressManagementIncludeRegion","modelName":"__components_parameters_IpAddressManagementIncludeRegion"}]
```

### Responses

```json
[{"responseCode":"200","schema":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"ip":{"type":"string","description":"An IP address on your account."},"pools":{"type":"array","description":"An array of IP Pools the IP address is assigned to.","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of the IP Pool."},"id":{"type":"string","description":"The unique ID of the IP Pool."}}}},"is_auto_warmup":{"type":"boolean","description":"Indicates if the IP address is set to automatically [warmup](/docs/sendgrid/ui/sending-email/warming-up-an-ip-address)."},"is_parent_assigned":{"type":"boolean","nullable":true,"description":"Indicates if a parent on the account is able to send email from the IP address. This parameter will be returned only if the request was made by the parent account."},"updated_at":{"type":"integer","nullable":true,"description":"A timestamp indicating when the IP was last updated."},"is_enabled":{"type":"boolean","nullable":true,"description":"Indicates if the IP address is billed and able to send email. This parameter applies to non-Twilio SendGrid APIs that been added to your Twilio SendGrid account. This parameter's value is `null` for Twilio SendGrid IP addresses."},"is_leased":{"type":"boolean","description":"Indicates whether an IP address is leased from Twilio SendGrid. If `false`, the IP address is not a Twilio SendGrid IP; it is a customer's own IP that has been added to their Twilio SendGrid account."},"added_at":{"type":"integer","description":"A timestamp representing when the IP address was added to your account."},"region":{"type":"string","description":"The region to which the IP address is assigned. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request.","enum":["eu","us"],"refName":"Region","modelName":"Region"}}}},"_metadata":{"type":"object","properties":{"next_params":{"type":"object","properties":{"after_key":{"type":"string","nullable":true,"description":"Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. The `after_key` cannot be used in combination with the `before_key` parameter."},"before_key":{"type":"string","nullable":true,"description":"Specifies which items to be returned by the API. When the `before_key` is specified, the API will return items beginning from the first item before the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. The `before_key` cannot be used in combination with the `after_key` parameter."},"ip":{"type":"string","description":"The IP address specified in the request with the `ip` query parameter. This parameter is returned only when an IP is included in the request."},"is_leased":{"type":"boolean","description":"Indicates whether an IP address is leased from Twilio SendGrid. If `false`, the IP address is not a Twilio SendGrid IP; it is a customer's own IP that has been added to their Twilio SendGrid account. This parameter is returned only if the IP address is leased."},"is_enabled":{"type":"boolean","description":"Indicates if the IP address is billed and able to send email. This parameter applies to non-Twilio SendGrid APIs that been added to your Twilio SendGrid account. This parameter's value is `null` for Twilio SendGrid IP addresses. This parameter is returned only if the IP address is enabled."},"is_parent_assigned":{"type":"boolean","description":"Indicates if a parent on the account is able to send email from the IP address. This parameter is returned only if the IP address is parent assigned."},"pool":{"type":"string","description":"The IP Pool ID specified in the request with the `pool` query parameter. This parameter is returned only when an IP Pool is included in the request."},"start_added_at":{"type":"string","description":"The beginning of the time window specified in the request with the `start_added_at` query parameter. This parameter is returned only when the `start_added_at` parameter is included in the request."},"end_added_at":{"type":"string","description":"The end of the time window specified in the request with the `end_added_at` query parameter. This parameter is returned only when the `end_added_at` parameter is included in the request."},"limit":{"type":"string","description":"The number of items returned in the request. This parameter is returned only when a `limit` is set using the `limit` query parameter in the request."},"region":{"type":"string","description":"The region to which the IP address is assigned. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request,","enum":["all","us","eu"],"refName":"Region1","modelName":"Region1"},"include_region":{"type":"string","description":"Indicates whether or not to include the IP address's region. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request."}}}}}}},"examples":{"200":{"value":{"result":[{"ip":"127.0.0.1","pools":[{"name":"marketing_pool","id":"12345"}],"is_auto_warmup":true,"is_parent_assigned":true,"updated_at":null,"is_enabled":true,"is_leased":true,"added_at":1664390835,"region":"us"}],"_metadata":{"after_key":null,"before_key":null,"ip":"127.0.0.1","is_leased":true,"is_enabled":true,"is_parent_assigned":true,"pool":"marketing_pool","start_added_at":"1664390835","end_added_at":"1664390835"}}}}}}}},{"responseCode":"400","schema":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","example-1":{"errors":[{"field":"after_key","message":"must be a numeric value"}]},"description":"IP Address Management Error Response Schema","refName":"IpAddressManagementErrorResponse","modelName":"IpAddressManagementErrorResponse","properties":{"errors":{"type":"array","description":"An array of error objects.","items":{"type":"object","properties":{"field":{"type":"string","description":"Indicates which field caused the error. This may be an empty string if no specific field is responsible for the error."},"message":{"type":"string","description":"An error-specific message that provides more information about the error's cause."}}}}}},"examples":{"limit length error":{"value":{"errors":[{"field":"limit","message":"should be > 0 and ≤ 5000"}]}},"pool not found":{"value":{"errors":[{"field":"pool","message":"not found"}]},"refName":"#/components/examples/IpAddressManagement400PoolMissingError","modelName":"__components_examples_IpAddressManagement400PoolMissingError"},"pool type error":{"value":{"errors":[{"field":"pool","message":"must be numeric"}]},"refName":"#/components/examples/IpAddressManagement400PoolTypeError","modelName":"__components_examples_IpAddressManagement400PoolTypeError"},"is_parent_assigned subuser error":{"value":{"errors":[{"field":"is_parent_assigned","message":"cannot be used for a sub user account"}]},"refName":"#/components/examples/IpAddressManagement400IsParentAssignedSubuserError","modelName":"__components_examples_IpAddressManagement400IsParentAssignedSubuserError"},"is_parent_assigned value error":{"value":{"errors":[{"field":"is_parent_assigned","message":"must be one of the following: true, false"}]},"refName":"#/components/examples/IpAddressManagement400IsParentAssignedValueError","modelName":"__components_examples_IpAddressManagement400IsParentAssignedValueError"},"is_enabled value error":{"value":{"errors":[{"field":"is_enabled","message":"must be one of the following: true, false"}]},"refName":"#/components/examples/IpAddressManagement400IsEnabledValueError","modelName":"__components_examples_IpAddressManagement400IsEnabledValueError"},"is_leased value error":{"value":{"errors":[{"field":"is_leased","message":"must be one of the following: true, false"}]},"refName":"#/components/examples/IpAddressManagement400IsLeasedValueError","modelName":"__components_examples_IpAddressManagement400IsLeasedValueError"},"start_added_at type error":{"value":{"errors":[{"field":"start_added_at","message":"must be numeric"}]},"refName":"#/components/examples/IpAddressManagement400StartAddedAtTypeError","modelName":"__components_examples_IpAddressManagement400StartAddedAtTypeError"},"end_added_at type error":{"value":{"errors":[{"field":"end_added_at","message":"must be numeric"}]},"refName":"#/components/examples/IpAddressManagement400EndAddedAtTypeError","modelName":"__components_examples_IpAddressManagement400EndAddedAtTypeError"},"pool parent_assigned":{"value":{"errors":[{"field":"pool","message":"cannot be used with ‘is_parent_assigned’"}]},"refName":"#/components/examples/IpAddressManagement400PoolIsParentAssignedError","modelName":"__components_examples_IpAddressManagement400PoolIsParentAssignedError"},"after_key invalid ip":{"value":{"errors":[{"field":"after_key","message":"invalid IP address"}]},"refName":"#/components/examples/IpAddressManagement400AfterKeyInvalidIpError","modelName":"__components_examples_IpAddressManagement400AfterKeyInvalidIpError"},"after_key and before_key included":{"value":{"errors":[{"field":"after_key","message":"cannot be used with ‘before_key’"}]},"refName":"#/components/examples/IpAddressManagement400AfterKeyBeforeKeyError","modelName":"__components_examples_IpAddressManagement400AfterKeyBeforeKeyError"},"before_key invalid ip":{"value":{"errors":[{"field":"before_key","message":"invalid IP address"}]},"refName":"#/components/examples/IpAddressManagement400BeforeKeyInvalidIpError","modelName":"__components_examples_IpAddressManagement400BeforeKeyInvalidIpError"}}}}}},{"responseCode":"401","schema":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","example-1":{"errors":[{"field":"after_key","message":"must be a numeric value"}]},"description":"IP Address Management Error Response Schema","x-examples":{"example-1":{"errors":[{"field":"","message":"missing required scope: scope1, scope2"}]}},"refName":"IpAddressManagementErrorResponse","modelName":"IpAddressManagementErrorResponse","properties":{"errors":{"type":"array","description":"An array of error objects.","items":{"type":"object","properties":{"field":{"type":"string","description":"Indicates which field caused the error. This may be an empty string if no specific field is responsible for the error."},"message":{"type":"string","description":"An error-specific message that provides more information about the error's cause."}}}}}},"examples":{"Missing required scope":{"value":{"errors":[{"field":"","message":"missing required scope: scope1, scope2"}]}}}},"application/xml":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}},"x-examples":{"example-1":{"errors":[{"field":"","message":"missing required scope: scope1, scope2"}]}}}}},"refName":"#/components/responses/IpAddressManagement401","modelName":"__components_responses_IpAddressManagement401"}},{"responseCode":"500","schema":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","example-1":{"errors":[{"field":"after_key","message":"must be a numeric value"}]},"description":"IP Address Management Error Response Schema","x-examples":{"example-1":{"errors":[{"field":"","message":"internal server error"}]}},"refName":"IpAddressManagementErrorResponse","modelName":"IpAddressManagementErrorResponse","properties":{"errors":{"type":"array","description":"An array of error objects.","items":{"type":"object","properties":{"field":{"type":"string","description":"Indicates which field caused the error. This may be an empty string if no specific field is responsible for the error."},"message":{"type":"string","description":"An error-specific message that provides more information about the error's cause."}}}}}},"examples":{"Generic 500":{"value":{"errors":[{"field":"","message":"internal server error"}]}}}}},"refName":"#/components/responses/IpAddressManagement500","modelName":"__components_responses_IpAddressManagement500"}}]
```

Get a List of all IP Addresses on your Account

```js
const client = require("@sendgrid/client");
client.setApiKey(process.env.SENDGRID_API_KEY);

const request = {
  url: `/v3/send_ips/ips`,
  method: "GET",
};

client
  .request(request)
  .then(([response, body]) => {
    console.log(response.statusCode);
    console.log(response.body);
  })
  .catch((error) => {
    console.error(error);
  });
```

```python
import os
from sendgrid import SendGridAPIClient


sg = SendGridAPIClient(os.environ.get("SENDGRID_API_KEY"))


response = sg.client.send_ips.ips.get()

print(response.status_code)
print(response.body)
print(response.headers)
```

```csharp
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using SendGrid;

public class Program {
    public static async Task Main() {
        string apiKey = Environment.GetEnvironmentVariable("SENDGRID_API_KEY");
        var client = new SendGridClient(apiKey);

        var response =
            await client.RequestAsync(method: SendGridClient.Method.GET, urlPath: "send_ips/ips");

        Console.WriteLine(response.StatusCode);
        Console.WriteLine(response.Body.ReadAsStringAsync().Result);
        Console.WriteLine(response.Headers.ToString());
    }
}
```

```java
import com.sendgrid.*;
import java.io.IOException;

public class Example {
    public static void main(String[] args) throws IOException {
        try {
            SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY"));
            Request request = new Request();
            request.setMethod(Method.GET);
            request.setEndpoint("/send_ips/ips");
            Response response = sg.api(request);
            System.out.println(response.getStatusCode());
            System.out.println(response.getBody());
            System.out.println(response.getHeaders());
        } catch (IOException ex) {
            throw ex;
        }
    }
}
```

```go
package main

import (
	"fmt"
	"github.com/sendgrid/sendgrid-go"
	"os"
)

func main() {
	apiKey := os.Getenv("SENDGRID_API_KEY")
	host := "https://api.sendgrid.com"
	request := sendgrid.GetRequest(apiKey, "/v3/send_ips/ips", host)
	request.Method = "GET"
	response, err := sendgrid.API(request)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		fmt.Println(response.StatusCode)
		fmt.Println(response.Body)
		fmt.Println(response.Headers)
	}
}
```

```php
<?php
// Uncomment the next line if you're using a dependency loader (such as Composer) (recommended)
// require 'vendor/autoload.php';

// Uncomment next line if you're not using a dependency loader (such as Composer)
// require_once '<PATH TO>/sendgrid-php.php';

$apiKey = getenv("SENDGRID_API_KEY");
$sg = new \SendGrid($apiKey);

try {
    $response = $sg->client
        ->send_ips()
        ->ips()
        ->get();
    print $response->statusCode() . "\n";
    print_r($response->headers());
    print $response->body() . "\n";
} catch (Exception $ex) {
    echo "Caught exception: " . $ex->getMessage();
}
```

```ruby
require 'sendgrid-ruby'
include SendGrid

sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])

response = sg.client.send_ips.ips.get()
puts response.status_code
puts response.headers
puts response.body
```

```bash
curl -X GET "https://api.sendgrid.com/v3/send_ips/ips" \
--header "Authorization: Bearer $SENDGRID_API_KEY"
```
