IP Pool Overview
IP Pools are how your subaccount mail gets routed. IP Pools are useful for helping separate mail streams and managing throttling for warmup.
Get all IP Address Allocations
To create an IP Pool, you will need to know what IPs are available to be allocated to the pool. The response from this request will be used to create the IP Pool.
Example Request
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.socketlabs.com/v2/ip-allocation?pageSize=5&pageNumber=0&sortField=ipsum commodo Duis&sortDirection=dsc&filters=[object Object]");
request.Headers.Add("Authorization", "Bearer <token>");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Example Response
{
"data": [
{
"ipAssignmentId": 1,
"accountId": 98765,
"created": "2022-01-01T12:00:00+00:00",
"lastUpdated": "2022-01-01T12:00:00+00:00",
"ipAddress": "127.0.0.1",
"region": "East"
}
],
"total": 1
}
You'll notice that the IP addresses and the "ipAssignmentId" are returned in an example Response. The "ipAssignmentId" parameter will be used in the next step in order to create a new IP pool
Create a new IP pool
Creates a new IP pool with the IPs assigned to it in the body by giving the pool a name. You'll need to use the "ipAssignmentId" parameter from the previous GET call
Endpoint
https://api.socketlabs.com/v2/ip-pool
Attributes
Property Name | Data Type | Details |
ipAssignmentsIDs | string | Unique ID of each IP address to assign |
name | string | IP Pool display name |
Example Request
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.socketlabs.com/v2/ip-pool");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"ipAssignmentIds\": [\n 123,\n 456\n ],\n \"name\": \"Test IP Pool\"\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Example Response
{
"data": {
"ipPoolId": 12345,
"accountId": 98765,
"name": "Test IP Pool",
"status": "Active",
"createdOn": "2022-01-01T12:00:00+00:00",
"isDefault": true,
"streamScore": 85,
"avgDailyVolume": 123456,
"bounceRate": 0,
"assignedIPs": [
{
"id": 123,
"ipAddress": "127.0.0.1",
"region": "East"
}
],
"subaccountCount": 0
}
}
Now that our IP pools are created, Let’s move on to creating new subaccounts