IP Pools

Note: This endpoint is available for SparkPost customers only. SparkPost Enterprise customers, contact your TAM for details.

Using Postman

If you use Postman you can click the following button to import the SparkPost API as a collection:

Run in Postman

IP Pool Properties

Property Type Description Notes
id string Unique pool identifier Autogenerated on create, used for Transmissions API & SMTP
name string Pool name
ips array of objects Sending IPs within the pool Sending IP objects include fields external_ip & hostname

IP Pools

List IP Pools

GET/api/v1/ip-pools

Lists all IP Pools.

Examples

Request

GET /api/v1/ip-pools

Response (HTTP status code: 200)

{
  "results": [
    {
      "id": "marketing_ip_pool",
      "name": "Marketing IP Pool",
      "ips": []
    },
    {
      "id": "default",
      "name": "Default",
      "ips": [
        {
          "external_ip": "54.244.54.135",
          "hostname": "mta472a.sparkpostmail.com"
        }
      ]
    }
  ]
}

Create an IP Pool

POST/api/v1/ip-pools

Creates an IP Pool and returns a unique ID based on the name. This ID is used for sending with this pool.

Request Body Attributes

Field Type Description Required
name string Name of the IP Pool yes

Examples

Request

POST /api/v1/ip-pools

{
  "name": "Marketing IP Pool"
}

Response (HTTP status code: 200)

{
  "results": {
    "id": "marketing_ip_pool"
  }
}

IP Pools Resource

Get IP Pool

GET/api/v1/ip-pools/{id}
URI Parameters
id(required)  

The IP Pool’s ID

Example: marketing

Retrieves a specific IP Pool.

Examples

Request

GET /api/v1/ip-pools/marketing

Response (HTTP status code: 200)

{
  "results": {
    "id": "marketing_ip_pool",
    "name": "Marketing IP Pool",
    "ips": [
      {
        "external_ip": "54.244.54.135",
        "hostname": "mta472a.sparkpostmail.com"
      },
      {
        "external_ip": "54.244.54.137",
        "hostname": "mta474a.sparkpostmail.com"
      }
    ]
  }
}

Response (HTTP status code: 404)

{
  "errors": [
    {
      "message": "IP pool not found."
    }
  ]
}

Update an IP Pool

PUT/api/v1/ip-pools/{id}
URI Parameters
id(required)  

The IP Pool’s ID

Example: marketing

Updates an IP pool’s name. To update sending IP pool assignments see Sending IPs.

Request Body Attributes

Field Type Description Required
name string Name of the IP Pool yes

Examples

Request

PUT /api/v1/ip-pools/marketing

{
  "name": "Updated Marketing Pool"
}

Response (HTTP status code: 200)

{
  "results": {
    "name": "Updated Marketing Pool",
    "id": "marketing"
  }
}

Response (HTTP status code: 400)

{
  "errors": [
    {
      "message": "IP Pool default is reserved and cannot be updated."
    }
  ]
}

Response (HTTP status code: 404)

{
  "errors": [
    {
      "message": "IP Pool not_a_real_pool does not exist."
    }
  ]
}

Delete an IP Pool

DELETE/api/v1/ip-pools/{id}
URI Parameters
id(required)  

The IP Pool’s ID

Example: marketing

Deletes an IP Pool and moves all sending IPs in that pool to the default pool.

The default pool cannot be deleted.

Examples

Request

DELETE /api/v1/ip-pools/marketing

Response (HTTP status code: 204)

Empty response body

Response (HTTP status code: 400)

{
  "errors": [
    {
      "message": "IP Pool default is reserved."
    }
  ]
}

Response (HTTP status code: 404)

{
  "errors": [
    {
      "message": "IP Pool marketing does not exist."
    }
  ]
}