POST
/
poll
curl --request POST \
  --url https://{appDomain}/poll \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: text/plain' \
  --data 'name=MyDevice;serial-number=ABC123XYZ;...uptime=2d0h5m10s;cpu-load=10;free-memory=850000000;...'
"# Job Wrapper Script Start\n:local jobId \"jobTokenExample\";\n:local busyUrl \"https://api.altostrat.io/job/job-uuid-here/update?status=busy&signature=...\";\n:local doneUrl \"https://api.altostrat.io/job/job-uuid-here/update?status=done&signature=...\";\n:local failUrl \"https://api.altostrat.io/job/job-uuid-here/update?status=fail&signature=...\";\n:do { /tool fetch url=\\$busyUrl keep-result=no } on-error={};\n:do {\n  # Actual Job Payload Start\n  /ip address add address=192.168.99.1/24 interface=ether2 comment=\"Managed by Altostrat\";\n  # Actual Job Payload End\n  :do { /tool fetch url=\\$doneUrl keep-result=no } on-error={};\n} on-error={ :do { /tool fetch url=\\$failUrl keep-result=no } on-error={} };\n:log info (\"Job \" . \\$jobId . \" finished. Remaining: 0\");\n# Job Wrapper Script End\n"

Authorizations

Authorization
string
header
required

Device-specific authentication token (encrypted site ID) obtained during adoption. Required for /poll and /notify/delete endpoints.

Body

text/plain · string

RouterOS script output containing device status info (similar to adoption, but potentially less fields or updated values).

The body is of type string.

Example:

"name=MyDevice;serial-number=ABC123XYZ;...uptime=2d0h5m10s;cpu-load=10;free-memory=850000000;..."

Response

200
text/plain

OK. Returns the next pending job script for the device to execute.

The response is of type string.

Example:

"# Job Wrapper Script Start\n:local jobId \"jobTokenExample\";\n:local busyUrl \"https://api.altostrat.io/job/job-uuid-here/update?status=busy&signature=...\";\n:local doneUrl \"https://api.altostrat.io/job/job-uuid-here/update?status=done&signature=...\";\n:local failUrl \"https://api.altostrat.io/job/job-uuid-here/update?status=fail&signature=...\";\n:do { /tool fetch url=\\$busyUrl keep-result=no } on-error={};\n:do {\n # Actual Job Payload Start\n /ip address add address=192.168.99.1/24 interface=ether2 comment=\"Managed by Altostrat\";\n # Actual Job Payload End\n :do { /tool fetch url=\\$doneUrl keep-result=no } on-error={};\n} on-error={ :do { /tool fetch url=\\$failUrl keep-result=no } on-error={} };\n:log info (\"Job \" . \\$jobId . \" finished. Remaining: 0\");\n# Job Wrapper Script End\n"