Skip to content

POST /api/v1/daemon/programs/{id}/enable

Enables the program and registers it with supervisord. Use this to activate a previously disabled program.

NameInTypeRequiredDescription
idpathintegerYesUnique numeric identifier of the program
{
"success": true,
"program": {
"id": 1,
"name": "web-server",
"description": "Nginx web server",
"enabled": true,
"command": "nginx -g \"daemon off;\"",
"boot": true,
"delay_seconds": 5,
"autorestart": "unexpected",
"user": "www-data",
"environment": {},
"directory": "/var/www",
"priority": 999
}
}
const result = await client.daemon.control.enable({ id: 1 });

POST /api/v1/daemon/programs/{id}/disable

Disables the program and removes it from supervisord configuration. The program will be stopped if currently running.

NameInTypeRequiredDescription
idpathintegerYesUnique numeric identifier of the program
{
"success": true,
"program": {
"id": 1,
"name": "web-server",
"description": "Nginx web server",
"enabled": false,
"command": "nginx -g \"daemon off;\"",
"boot": true,
"delay_seconds": 5,
"autorestart": "unexpected",
"user": "www-data",
"environment": {},
"directory": "/var/www",
"priority": 999
}
}
const result = await client.daemon.control.disable({ id: 1 });

POST /api/v1/daemon/programs/{id}/start

Starts the program immediately via supervisorctl. For port-range programs, the port parameter is required to specify which instance to start. The optional wait parameter blocks until the program reaches the RUNNING state. The optional if_not_running parameter makes the operation idempotent (safe to call multiple times). Use if_not_running for Hoody Proxy automation. The program must be enabled.

NameInTypeRequiredDescription
idpathintegerYesUnique numeric identifier of the program
FieldTypeRequiredDefaultDescription
portintegerNoPort number to start (required for port-range programs). Range: 1–65535.
waitbooleanNofalseWait for program to reach RUNNING state before returning.
timeoutintegerNo30Timeout in seconds when wait is true. Range: 1–300.
if_not_runningbooleanNofalseOnly start if not already running (idempotent mode). If true, checks if the instance is running first. Returns already_running in the response. Use this for Hoody Proxy automation.

Example — port-range program, specific instance:

{
"port": 8042
}

Example — port-range with wait:

{
"port": 8042,
"wait": true,
"timeout": 60
}

Example — standard program:

{}

Example — standard with wait:

{
"wait": true,
"timeout": 30
}

Example — idempotent start (Hoody Proxy usage):

{
"port": 8042,
"if_not_running": true
}

Example — idempotent start with wait:

{
"port": 8042,
"if_not_running": true,
"wait": true,
"timeout": 60
}

Program started successfully:

{
"success": true,
"instance": {
"port": 8042,
"instance_name": "api-server_8042",
"status": "STARTING"
}
}

Idempotent mode — already running:

{
"success": true,
"already_running": true,
"instance": {
"port": 8042,
"instance_name": "api-server_8042",
"status": "RUNNING",
"pid": 12345,
"uptime": "0:15:30"
}
}

Idempotent mode — just started:

{
"success": true,
"already_running": false,
"instance": {
"port": 8042,
"instance_name": "api-server_8042",
"status": "STARTING"
}
}
const result = await client.daemon.control.start({ id: 1 });

POST /api/v1/daemon/programs/{id}/stop

Stops the program immediately via supervisorctl. For port-range programs, specify port to stop a specific instance or all: true to stop all instances.

NameInTypeRequiredDescription
idpathintegerYesUnique numeric identifier of the program
FieldTypeRequiredDescription
portintegerNoSpecific port to stop. Range: 1–65535.
allbooleanNoStop all instances (for port-range programs).

Example — stop specific port instance:

{
"port": 8042
}

Example — stop all instances:

{
"all": true
}

Example — stop standard program:

{}
{
"success": true
}
const result = await client.daemon.control.stop({ id: 1 });