Create Location
/api/v1/admin/proxy/locationsThis endpoint requires Admin API Key authentication via the X-Admin-Key header.
Save the agent_api_key returned in the response! It's needed to authenticate the SpiderHub agent and cannot be retrieved later.
Request Body
location_codestringrequiredShort unique code (e.g., "ua-odesa-1", "us-nyc-1")
location_namestringrequiredHuman-readable name (e.g., "SpiderHub Odesa")
country_codestringrequiredISO 3166-1 alpha-2 country code (e.g., "UA", "US")
max_modemsintegerdefault: 20Maximum number of modems this location can support
wireguard_ipstringWireGuard VPN IP address for this location (e.g., "10.100.0.2")
Response
location_idstringUUID of the created location
location_codestringThe location code you specified
agent_api_keystringIMPORTANT: Save this key! Used by SpiderHub agent for authentication.
Request Example
curl -X POST "https://spideriq.ai/api/v1/admin/proxy/locations" \
-H "X-Admin-Key: your_admin_key" \
-H "Content-Type: application/json" \
-d '{
"location_code": "ua-odesa-1",
"location_name": "SpiderHub Odesa",
"country_code": "UA",
"max_modems": 20,
"wireguard_ip": "10.100.0.2"
}'
import requests
response = requests.post(
"https://spideriq.ai/api/v1/admin/proxy/locations",
headers={
"X-Admin-Key": "your_admin_key",
"Content-Type": "application/json"
},
json={
"location_code": "ua-odesa-1",
"location_name": "SpiderHub Odesa",
"country_code": "UA",
"max_modems": 20,
"wireguard_ip": "10.100.0.2"
}
)
location = response.json()
print(f"Location created: {location['location_id']}")
print(f"Agent key (SAVE THIS): {location['agent_api_key']}")
Response Example
{
"location_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"location_code": "ua-odesa-1",
"location_name": "SpiderHub Odesa",
"country_code": "UA",
"max_modems": 20,
"wireguard_ip": "10.100.0.2",
"agent_api_key": "your_generated_agent_key_save_this",
"status": "offline",
"created_at": "2025-01-01T10:00:00.000000",
"updated_at": "2025-01-01T10:00:00.000000"
}
Next Steps
After creating a location:
-
Configure SpiderHub with the
agent_api_key:# SpiderHub/.env
SPIDERPROXY_API_URL=https://spideriq.ai
SPIDERPROXY_LOCATION_CODE=ua-odesa-1
SPIDERPROXY_AGENT_KEY=your_generated_agent_key_save_this -
Start SpiderHub agent - it will begin sending heartbeats and registering modems
-
Monitor location status via the List Locations endpoint