Adopt Device
Endpoint called by the device during bootstrapping to finalize adoption. It receives device information (heartbeat data), creates or finds the site record, and returns the final adoption script including the scheduler setup. Requires Heartbeat
and RunbookToken
middleware. Accepts x-ros-debug
header.
Authorizations
Standard JWT token obtained via a separate authentication process. Required for most user-facing API endpoints.
Path Parameters
The base62 encoded UUID representing the Runbook token used for bootstrapping.
"4KuKNp3QzpfwLcg3BUnn1a"
Body
RouterOS script output containing device identity, resource, license, and routerboard info, formatted as key=value pairs separated by semicolons.
The body is of type string
.
"name=MikroTik;serial-number=ABC123XYZ;architecture-name=arm;routerboard=true;platform=MikroTik;model=RB4011iGS+;board-name=RB4011iGS+;revision=;cpu=ARM 32-bit;cpu-count=4;cpu-frequency=1400;cpu-load=5;total-memory=1073741824;free-memory=900000000;total-hdd-space=536870912;free-hdd-space=400000000;software-id=ABCD-EFGH;build-time=Dec/15/2023 10:00:00;level=6;version=7.12;factory-software=7.1;factory-firmware=7.1;current-firmware=7.12;upgrade-firmware=7.12;firmware-type=arm;uptime=1d10h30m15s"
Response
RouterOS script confirming adoption and setting up the scheduler.
The response is of type string
.
":global write do={ :put \"Altostrat-SDX: Site 'MyRouter - 15th Dec 23' adopted successfully using runbook 'Default Policy'.\"; :put \"Manage Site: https://sdx.altostrat.io/deployments/your-new-site-uuid/overview\"; :put \"Quote: Be the change you wish to see in the world.\";}; :execute $write;\n# Scheduler script content here... based on site->getScheduler()\n/system scheduler add name=\"altostrat-poll\" interval=30s policy=read,write,test,api on-event={ ... } start-time=startup;\n# Backup script content here... based on site->generateSftp()\n"