Menu

Expand

This documentation is for the SendGrid Web API v2

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

Rate this page:

IP Management

List all IP addresses you have under your account, and retrieve details about those IP addresses.

All

View all IPs under your account.

URI Parameter Required Requirements Description
task Yes Must be set to all Retrieve all IPs available for your account.
ip No Can be a complete or partial IP address. Filter your search results.
system No Must be set to true Include IPs assigned by SendGrid.

These are Reseller only APIs. For more information, see Reseller Overview.

Call

POST https://api.sendgrid.com/apiv2/reseller.ip.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&task=all

Response

[
  {
    "ip": "255.255.255.250"
  },
  {
    "ip": "255.255.255.251"
  },
  {
    "ip": "255.255.255.251"
  },
  {
    "ip": "255.255.255.252"
  },
  {
    "ip": "255.255.255.253"
  },
  {
    "ip": "255.255.255.254"
  }
]

Call

POST https://api.sendgrid.com/apiv2/reseller.ip.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&task=all

Response

<ips>
   <ip>255.255.255.0</ip>
   <ip>255.255.254.0</ip>
   <ip>255.255.253.0</ip>
   <ip>255.255.252.0</ip>
</ips>

Free

A listing of all free IPs under your account. A Free IP is any IP that is either not in use by a user or not linked to an IP grouping.

URI Parameter Required Requirements Description
task Yes Must be set to free Retrieve all free IPs for your account.
ip No Can be a complete or partial IP address. Filter your search results.

Call

POST https://api.sendgrid.com/apiv2/reseller.ip.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&task=free

Response

[
  {
    "ip": "255.255.255.250"
  },
  {
    "ip": "255.255.255.251"
  },
  {
    "ip": "255.255.255.251"
  },
  {
    "ip": "255.255.255.252"
  },
  {
    "ip": "255.255.255.253"
  },
  {
    "ip": "255.255.255.254"
  }
]

Call

POST https://api.sendgrid.com/apiv2/reseller.ip.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&task=free

Response

<ips>
   <ip>255.255.255.0</ip>
   <ip>255.255.254.0</ip>
   <ip>255.255.253.0</ip>
   <ip>255.255.252.0</ip>
</ips>

Taken

A listing of all taken IPs under your account. A Taken IP is any IP that is either in use by a user or linked to an IP grouping.

URI Parameter Required Requirements Description
task Yes Must be set to taken Retrieve all taken IPs for your account.
ip No Can be a complete or partial IP address. Filter your search results.

Call

POST https://api.sendgrid.com/apiv2/reseller.ip.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&task=taken

Response

[
  {
    "ip": "255.255.255.250"
  },
  {
    "ip": "255.255.255.251"
  },
  {
    "ip": "255.255.255.251"
  },
  {
    "ip": "255.255.255.252"
  },
  {
    "ip": "255.255.255.253"
  },
  {
    "ip": "255.255.255.254"
  }
]

Call

POST https://api.sendgrid.com/apiv2/reseller.ip.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&task=taken

Response

<ips>
   <ip>255.255.255.0</ip>
   <ip>255.255.254.0</ip>
   <ip>255.255.253.0</ip>
   <ip>255.255.252.0</ip>
</ips>

Available

A listing of all available IPs under your account. An Available IP is any IP in one of three states: currently free, not linked to an IP grouping, or in use by an inactive user.

URI Parameter Required Requirements Description
task Yes Must be set to available Retrieve all available IPs for your account.
ip No Can be a complete or partial IP address. Filter your search results.

Call

POST https://api.sendgrid.com/apiv2/reseller.ip.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&task=available

Response

[
  {
    "ip": "255.255.255.250"
  },
  {
    "ip": "255.255.255.251"
  },
  {
    "ip": "255.255.255.251"
  },
  {
    "ip": "255.255.255.252"
  },
  {
    "ip": "255.255.255.253"
  },
  {
    "ip": "255.255.255.254"
  }
]

Call

POST https://api.sendgrid.com/apiv2/reseller.ip.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&task=available

Response

<ips>
   <ip>255.255.255.0</ip>
   <ip>255.255.254.0</ip>
   <ip>255.255.253.0</ip>
   <ip>255.255.252.0</ip>
</ips>

Usage

The current breakdown of users who are utilizing your IPs.

URI Parameter Required Requirements Description
task Yes Must be set to usage Retrieve all IPs in use broken down by user.
ip No Can be a complete or partial IP address. Filter your search results.
user No Can be a complete or partial username. Filter your search results.
group No Can be a complete or partial group name. Filter your search results.
system No Must be set to true Include IPs assigned by SendGrid.

Call

POST https://api.sendgrid.com/apiv2/reseller.ip.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&task=usage&user=example.com

Response

[
  {
    "ip": "255.255.253.0",
    "user": "example@example.com"
  },
  {
    "ip": "255.255.254.0",
    "user": "example@example.com"
  }
]

Call

POST https://api.sendgrid.com/apiv2/reseller.ip.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&task=usage&user=example.com

Response

<ips>
   <entry>
      <ip>255.255.253.0</ip>
      <user>example@example.com</user>
   </entry>
   <entry>
      <ip>255.255.254.0</ip>
      <user>example@example.com</user>
   </entry>
</ips>
Rate this page:

Need some help?

We all do sometimes. Get help now from the Twilio SendGrid Support Team.

Running into a coding hurdle? Lean on the wisdom of the crowd by browsing the SendGrid tag on Stack Overflow or visiting Twilio's Stack Overflow Collective.

Loading Code Sample...
        
        
        

        Thank you for your feedback!

        Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        thanks-feedback-gif