Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

IP Management


(warning)

This documentation is for the SendGrid Web API v2

To access all the latest features and upcoming developments, please see our v3 API.


List

list page anchor

Obtain a complete list of all IPs associated with your account and whether they are free, taken, or available.

URI ParameterRequiredRequirementsDescription
listYesMust be set to one of the following: all free

taken

available
Will return the IPs on the account that match the argument

The list argument will restrict the IPs returned:

  • all : All IP addresses available on account, regardless of whether or not the IP is used by a subuser.
  • free : All free IP addresses for the account. IPs that are not in use by any subusers.
  • taken : All taken IP addresses for the account. IP addresses that are in use by one or more subusers.
  • available : All available IP addresses for the account including all free IP addresses. If a subuser is deactivated and assigned an IP, that IP will show up on this list since that IP address is not actually being used.
JSONXML

Call

POSThttps://api.sendgrid.com/apiv2/customer.ip.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&list=all

Response


_11
[
_11
{
_11
"ip": "255.255.255.250"
_11
},
_11
{
_11
"ip": "255.255.255.251"
_11
},
_11
{
_11
"ip": "255.255.255.252"
_11
}
_11
]



URI ParameterRequiredRequirementsDescription
taskYesMust be set to listTask to return the IPs in use by the subuser
userYesSubuser must be under your accountSubuser to get the IPs of
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.sendip.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&task=list&user=subuser_username

_24
{
_24
"success": "success",
_24
"outboundcluster": "SendGrid MTA",
_24
"ips": [
_24
{
_24
"ip": "255.255.255.250"
_24
},
_24
{
_24
"ip": "255.255.255.251"
_24
},
_24
{
_24
"ip": "255.255.255.251"
_24
},
_24
{
_24
"ip": "255.255.255.252"
_24
},
_24
{
_24
"ip": "255.255.255.253"
_24
},
_24
{
_24
"ip": "255.255.255.254"
_24
}
_24
]
_24
}



You need to assign at least ONE IP to your subuser.

URI ParameterRequiredRequirementsDescription
taskYesMust be set to appendTask to add IP to a subuser
userYesSubuser must be under your accountSubuser that is adding IPs
setYesMust be either: none all specifynone: Remove all IPs. all: Apply all possible IPs to subuser. specify: Specify the IPs to the subser
ip[]NoMust be a valid set of IPs (use the list call to determine valid IPs)If the set parameter is specify, then you must specify the IPs. Use the IP[] parameter to specify an IP: ip[]=255.255.255.0[]=255.255.255.1
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.sendip.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&task=append&set=specify&user=subuser_username&ip[]=255.255.255.250&ip[]=255.255.255.255

_10
{
_10
"message": "success"
_10
}


Rate this page: