Slots & IP Management
This section covers reseller subscription slot and IP management. You can retrieve all active IPs for a specific reseller subscription and then whitelist or blacklist IP addresses for that subscription.
Get Slots
This endpoint returns the slot information for a reseller subscription, including the currently active IPs bound to that subscription. The subscriptionId is required to access the correct reseller subscription.
GET
/api/v1.0/resellers/subscriptions/{subscriptionId}/slotsImportant: Copy the reseller subscription
"id": "su_69af..." from the Get Subscriptions response. This subscriptionId is required for all IP management requests. Note: This endpoint shows all active IPs currently assigned to a specific reseller subscription.
import requests, json
def get_slots(api_key, subscription_id):
url = f"https://api.ghostealth.com/dev/v1.0/resellers/subscriptions/{subscription_id}/slots"
headers = {
"Content-Type": "application/json",
"Authorization": f"ApiKey {api_key}"
}
res = requests.get(url, headers=headers)
print("Get Slots Response:", res.status_code)
print(json.dumps(res.json(), indent=2))
api_key = "xxx"
subscription_id = "su_69afbaa5bc32119ad6daa8fe"
get_slots(api_key, subscription_id)
Example Response:
Reseller Slots Response: 200
{
"data": [
{
"id": "sl_69b13c5b7d16bed7023857bc",
"status": "ENABLED",
"state": "UNBOUND",
"synchronization": "SYNCED",
"type": "IP"
},
{
"id": "sl_69b13c5b7d16bed7023857bd",
"status": "ENABLED",
"state": "UNBOUND",
"synchronization": "SYNCED",
"type": "IP"
},
{
"id": "sl_69b13c5b7d16bed7023857be",
"status": "ENABLED",
"state": "UNBOUND",
"synchronization": "SYNCED",
"type": "IP"
},
{
"id": "sl_69b13c5b7d16bed7023857bf",
"status": "ENABLED",
"state": "UNBOUND",
"synchronization": "SYNCED",
"type": "IP"
},
{
"id": "sl_69b13c5b7d16bed7023857c0",
"status": "ENABLED",
"state": "UNBOUND",
"synchronization": "SYNCED",
"type": "IP"
},
{
"id": "sl_69b13c5b7d16bed7023857c1",
"status": "ENABLED",
"state": "UNBOUND",
"synchronization": "SYNCED",
"type": "IP"
}
],
"meta": {
"pagination": {
"size": 20,
"page": 0,
"pages": 1,
"total": 6,
"next": false,
"previous": false
},
"sorts": [
{
"key": "port",
"direction": "DESC"
}
]
}
}
Whitelist IP
This endpoint adds a public IP address to the whitelist of a specific reseller subscription.
PUT
/api/v1.0/resellers/subscriptions/{subscriptionId}/whitelistImportant: Use the reseller subscription
id from Get Subscriptions. The request only updates the IP whitelist of that specific subscription. import requests, json
def whitelist_ip(api_key, subscription_id, ip_address):
url = f"https://api.ghostealth.com/dev/v1.0/resellers/subscriptions/{subscription_id}/whitelist"
headers = {
"Content-Type": "application/json",
"Authorization": f"ApiKey {api_key}"
}
payload = {"ipAddress": ip_address}
res = requests.put(url, headers=headers, json=payload)
print("Whitelist IP Response:", res.status_code)
print(json.dumps(res.json(), indent=2))
api_key = "xxx"
subscription_id = "su_69afbaa5bc32119ad6daa8fe"
ip_address = "1.2.3.4"
whitelist_ip(api_key, subscription_id, ip_address)
Example Response:
Reseller Whitelist IP Response: 200
{
"data": {
"id": "sl_69b13c5b7d16bed7023857bc",
"status": "ENABLED",
"state": "BOUND",
"synchronization": "SYNCED",
"type": "IP",
"ip": {
"id": "ip_69b142447d16bed702385a07",
"address": "1.2.2.4"
}
}
}
Blacklist IP
This endpoint removes a public IP address from the whitelist of a specific reseller subscription.
PUT
/api/v1.0/resellers/subscriptions/{subscriptionId}/blacklistImportant: Use the reseller subscription
id from Get Subscriptions. Removing an IP only affects that specific subscription. import requests, json
def blacklist_ip(api_key, subscription_id, ip_address):
url = f"https://api.ghostealth.com/dev/v1.0/resellers/subscriptions/{subscription_id}/blacklist"
headers = {
"Content-Type": "application/json",
"Authorization": f"ApiKey {api_key}"
}
payload = {"ipAddress": ip_address}
res = requests.put(url, headers=headers, json=payload)
print("Blacklist IP Response:", res.status_code)
print(json.dumps(res.json(), indent=2))
api_key = "xxx"
subscription_id = "su_69afbaa5bc32119ad6daa8fe"
ip_address = "1.2.3.4"
blacklist_ip(api_key, subscription_id, ip_address)
Example Response:
Reseller Blacklist IP Response: 200
{}
