SSpiderIQ
SSpiderIQ

Docs / api-reference/proxy-agents

Proxy Agents

4 endpoints from the published OpenAPI import.

POST/api/v1/proxy/agents/heartbeat

Agent heartbeat

Submit agent heartbeat with modem statuses.

Should be called every 30 seconds.

The response includes:

  • Pending commands to execute
  • Config updates (if any)

Headers required:

  • X-Location-Code: Location code (e.g., 'ua-odessa-1')
  • X-Agent-Key: Agent API key

Parameters

NameInTypeRequiredDescription
x-location-codeheaderstringtrueLocation code
x-agent-keyheaderstringtrueAgent API key
Try it
Query

Examples

cURL
curl -X POST 'https://spideriq.ai/api/v1/proxy/agents/heartbeat' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "location_code": "string",
  "agent_version": "string",
  "uptime_seconds": 0,
  "modems": [
    {
      "imei": "string",
      "public_ip": "string",
      "signal_strength": 0,
      "status": "online",
      "is_healthy": true,
      "error_message": "string",
      "requests_since_last_heartbeat": 0,
      "bytes_since_last_heartbeat": 0,
      "speed_test": {}
    }
  ],
  "system_stats": {}
}'
Python
import httpx

resp = httpx.post(
    "https://spideriq.ai/api/v1/proxy/agents/heartbeat",
    headers={"Authorization": "Bearer <token>", "Content-Type": "application/json"},
    json={"location_code": "string", "agent_version": "string", "uptime_seconds": 0, "modems": [{"imei": "string", "public_ip": "string", "signal_strength": 0, "status": "online", "is_healthy": true, "error_message": "string", "requests_since_last_heartbeat": 0, "bytes_since_last_heartbeat": 0, "speed_test": {}}], "system_stats": {}},
)
resp.raise_for_status()
print(resp.json())
JavaScript
const resp = await fetch("https://spideriq.ai/api/v1/proxy/agents/heartbeat", {
  method: "POST",
  headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" },
  body: JSON.stringify({"location_code": "string", "agent_version": "string", "uptime_seconds": 0, "modems": [{"imei": "string", "public_ip": "string", "signal_strength": 0, "status": "online", "is_healthy": true, "error_message": "string", "requests_since_last_heartbeat": 0, "bytes_since_last_heartbeat": 0, "speed_test": {}}], "system_stats": {}})
});
const data = await resp.json();
console.log(data);
Go
package main

import (
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{"location_code": "string", "agent_version": "string", "uptime_seconds": 0, "modems": [{"imei": "string", "public_ip": "string", "signal_strength": 0, "status": "online", "is_healthy": true, "error_message": "string", "requests_since_last_heartbeat": 0, "bytes_since_last_heartbeat": 0, "speed_test": {}}], "system_stats": {}}`)
	req, _ := http.NewRequest("POST", "https://spideriq.ai/api/v1/proxy/agents/heartbeat", body)
	req.Header.Set("Authorization", "Bearer <token>")
	req.Header.Set("Content-Type", "application/json")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}

Responses

StatusDescription
200Successful Response
422Validation Error
POST/api/v1/proxy/agents/commands/{command_id}/complete

Complete a command

Report command completion.

Call this after executing a command received in the heartbeat response.

Headers required:

  • X-Location-Code: Location code
  • X-Agent-Key: Agent API key

Parameters

NameInTypeRequiredDescription
command_idpathstringtrue
x-location-codeheaderstringtrueLocation code
x-agent-keyheaderstringtrueAgent API key
Try it
Query

Examples

cURL
curl -X POST 'https://spideriq.ai/api/v1/proxy/agents/commands/{command_id}/complete' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "success": true,
  "result": {},
  "error_message": "string",
  "duration_seconds": 0.0
}'
Python
import httpx

resp = httpx.post(
    "https://spideriq.ai/api/v1/proxy/agents/commands/{command_id}/complete",
    headers={"Authorization": "Bearer <token>", "Content-Type": "application/json"},
    json={"success": true, "result": {}, "error_message": "string", "duration_seconds": 0.0},
)
resp.raise_for_status()
print(resp.json())
JavaScript
const resp = await fetch("https://spideriq.ai/api/v1/proxy/agents/commands/{command_id}/complete", {
  method: "POST",
  headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" },
  body: JSON.stringify({"success": true, "result": {}, "error_message": "string", "duration_seconds": 0.0})
});
const data = await resp.json();
console.log(data);
Go
package main

import (
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{"success": true, "result": {}, "error_message": "string", "duration_seconds": 0.0}`)
	req, _ := http.NewRequest("POST", "https://spideriq.ai/api/v1/proxy/agents/commands/{command_id}/complete", body)
	req.Header.Set("Authorization", "Bearer <token>")
	req.Header.Set("Content-Type", "application/json")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}

Responses

StatusDescription
200Successful Response
422Validation Error
POST/api/v1/proxy/agents/modems/register

Register a new modem

Register a new modem discovered by the agent.

Called when a new USB modem is detected.

Headers required:

  • X-Location-Code: Location code
  • X-Agent-Key: Agent API key

Parameters

NameInTypeRequiredDescription
imeiquerystringtrue
proxy_portqueryintegertrue
iccidqueryanyfalse
phone_numberqueryanyfalse
carrierqueryanyfalse
usb_portqueryanyfalse
x-location-codeheaderstringtrueLocation code
x-agent-keyheaderstringtrueAgent API key
Try it
Query

Examples

cURL
curl -X POST 'https://spideriq.ai/api/v1/proxy/agents/modems/register' \
  -H 'Authorization: Bearer <token>'
Python
import httpx

resp = httpx.post(
    "https://spideriq.ai/api/v1/proxy/agents/modems/register",
    headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())
JavaScript
const resp = await fetch("https://spideriq.ai/api/v1/proxy/agents/modems/register", {
  method: "POST",
  headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);
Go
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("POST", "https://spideriq.ai/api/v1/proxy/agents/modems/register", nil)
	req.Header.Set("Authorization", "Bearer <token>")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}

Responses

StatusDescription
200Successful Response
422Validation Error
POST/api/v1/proxy/agents/sms/log

Log an SMS message

Log an incoming or outgoing SMS message.

Headers required:

  • X-Location-Code: Location code
  • X-Agent-Key: Agent API key

Parameters

NameInTypeRequiredDescription
modem_idquerystringtrue
directionquerystringtrue
messagequerystringtrue
phone_numberqueryanyfalse
sms_id_on_devicequeryanyfalse
x-location-codeheaderstringtrueLocation code
x-agent-keyheaderstringtrueAgent API key
Try it
Query

Examples

cURL
curl -X POST 'https://spideriq.ai/api/v1/proxy/agents/sms/log' \
  -H 'Authorization: Bearer <token>'
Python
import httpx

resp = httpx.post(
    "https://spideriq.ai/api/v1/proxy/agents/sms/log",
    headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())
JavaScript
const resp = await fetch("https://spideriq.ai/api/v1/proxy/agents/sms/log", {
  method: "POST",
  headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);
Go
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("POST", "https://spideriq.ai/api/v1/proxy/agents/sms/log", nil)
	req.Header.Set("Authorization", "Bearer <token>")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}

Responses

StatusDescription
200Successful Response
422Validation Error