DocumentationAPI Reference

Power & Console

Start, stop, restart servers and send console commands.

POST/servers/:id/power

Execute a power action on the server.

Body Parameters

NameTypeRequiredDescription
actionstringYesstart, stop, restart or kill
curl -X POST "https://www.mado-hosting.com/api/v1/servers/srv_abc123/power" \
  -H "Authorization: Bearer rsk_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "action": "restart" }'
kill forces an immediate process termination. Use stop for a graceful shutdown.
POST/servers/:id/command

Send a console command to the running server.

Body Parameters

NameTypeRequiredDescription
commandstringYesConsole command (max 2000 chars)
curl -X POST "https://www.mado-hosting.com/api/v1/servers/srv_abc123/command" \
  -H "Authorization: Bearer rsk_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "command": "say Hello from the API!" }'
HTTPCodeDescription
400VALIDATION_ERRORInvalid action or empty command
404SERVER_NOT_FOUNDServer not found
409SERVER_INSTALLINGServer still provisioning