Authentication

Slots & IP Management

This section covers the datacenter proxy authentication workflow. You can first retrieve your available subscription slot information and then manage whitelisted IP addresses for proxy access.

Get Slots

Get Slots

This endpoint returns your current datacenter subscription details, including the subscription ID, active plan, concurrency, proxy amount, expiration date, and additional IP slots.

GET/dev/v1.0/subscriptions/datacenter
Limit: 10 requests / 60s
Required:API-Key
Important: Copy the "id": "su_69af..." value from the response. This subscription ID is required for IP whitelist and blacklist requests.
import requests, json

def get_slots(api_key):
  url = "https://api.ghostealth.com/dev/v1.0/subscriptions/datacenter"
  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"
get_slots(api_key)
Example Response:
Toggle Response
{
        "data": {
        "id": "su_69afba98bc32119ad6daa8f0",
        "status": "ACTIVE",
        "type": "STANDARD",
        "canceled": false,
        "period": {
        "start": {
        "timestamp": 1773124248080,
        "date": 1773124248080
        },
        "end": {
        "timestamp": 1773729048080,
        "date": 1773729048080
        }
        },
        "consumption": {
        "bytes": 0,
        "requests": 0
        },
        "plan": {
        "id": "pl_69afba85bc32119ad6daa8e8",
        "title": "GS-DAT 100",
        "description": "Weekly billing",
        "billingCycle": "WEEKLY",
        "price": {
        "currency": "USD",
        "netAmount": 1681,
        "grossAmount": 2000,
        "taxAmount": 319,
        "feeAmount": 0,
        "taxRate": 19.0
        },
        "configuration": {
        "type": "DATACENTER",
        "connections": 100,
        "authentications": 1
        }
        },
        "slots": [
        {
        "id": "sl_69afba98bc32119ad6daa8f2",
        "status": "ENABLED",
        "state": "UNBOUND",
        "synchronization": "SYNCED",
        "type": "IP"
        }
        ]
        }
      }
Note: Save the subscription ID from this response. It is required for all IP whitelist changes.
Whitelist IP

Whitelist IP

This endpoint adds a public IP address to your datacenter subscription whitelist so it can authenticate and use the proxies.

PUT/api/v1.0/subscriptions/{subscriptionId}/whitelist
Limit: 10 requests / 60s
Required:API-KeysubscriptionIdipAddress
Important: Use the subscription id from the Get Slots response and replace {subscriptionId} before sending the request.
import requests, json

def whitelist_ip(api_key, subscription_id, ip_address):
  url = f"https://api.ghostealth.com/dev/v1.0/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_69af3f2c91b24e8baf123456"
ip_address = "1.2.3.4"
whitelist_ip(api_key, subscription_id, ip_address)
Example Response:
Toggle Response
Whitelist IP Response: 200
        {
        "data": {
        "id": "sl_69afba98bc32119ad6daa8f2",
        "status": "ENABLED",
        "state": "BOUND",
        "synchronization": "SYNCED",
        "type": "IP",
        "ip": {
        "id": "ip_69b11550f28cc7a9fe250299",
        "address": "1.2.3.4"
        }
        }
        }
      
Note: Only public IPs should be whitelisted. Repeat this request for each additional IP you want to allow.
Blacklist IP

Blacklist IP

This endpoint removes a public IP address from your datacenter subscription whitelist and revokes its proxy access.

PUT/api/v1.0/subscriptions/{subscriptionId}/blacklist
Limit: 10 requests / 60s
Required:API-KeysubscriptionIdipAddress
Important: Make sure the correct whitelisted IP is removed. Once blacklisted, that IP can no longer authenticate until it is added again.
import requests, json

def blacklist_ip(api_key, subscription_id, ip_address):
  url = f"https://api.ghostealth.com/dev/v1.0/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_69af3f2c91b24e8baf123456"
ip_address = "1.2.3.4"
blacklist_ip(api_key, subscription_id, ip_address)
Example Response:
Toggle Response
Blacklist IP Response: 200
        {}
      
Note: Removing an IP takes effect immediately for future authentication attempts from that address.