Enable a program
Section titled “Enable a program”POST /api/v1/daemon/programs/{id}/enable
Enables the program and registers it with supervisord. Use this to activate a previously disabled program.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | Yes | Unique numeric identifier of the program |
Response
Section titled “Response”{ "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 }}{ "success": false, "error": "Program with ID 999 not found"}SDK Usage
Section titled “SDK Usage”const result = await client.daemon.control.enable({ id: 1 });Disable a program
Section titled “Disable a program”POST /api/v1/daemon/programs/{id}/disable
Disables the program and removes it from supervisord configuration. The program will be stopped if currently running.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | Yes | Unique numeric identifier of the program |
Response
Section titled “Response”{ "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 }}{ "success": false, "error": "Program with ID 999 not found"}SDK Usage
Section titled “SDK Usage”const result = await client.daemon.control.disable({ id: 1 });Start a program or port instance
Section titled “Start a program or port instance”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.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | Yes | Unique numeric identifier of the program |
Request Body
Section titled “Request Body”| Field | Type | Required | Default | Description |
|---|---|---|---|---|
port | integer | No | — | Port number to start (required for port-range programs). Range: 1–65535. |
wait | boolean | No | false | Wait for program to reach RUNNING state before returning. |
timeout | integer | No | 30 | Timeout in seconds when wait is true. Range: 1–300. |
if_not_running | boolean | No | false | Only 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}Response
Section titled “Response”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" }}{ "success": false, "error": "Port is required for port-range program \"api-server\""}{ "success": false, "error": "Program with ID 999 not found"}SDK Usage
Section titled “SDK Usage”const result = await client.daemon.control.start({ id: 1 });Stop a program or port instance
Section titled “Stop a program or port instance”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.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | Yes | Unique numeric identifier of the program |
Request Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
port | integer | No | Specific port to stop. Range: 1–65535. |
all | boolean | No | Stop all instances (for port-range programs). |
Example — stop specific port instance:
{ "port": 8042}Example — stop all instances:
{ "all": true}Example — stop standard program:
{}Response
Section titled “Response”{ "success": true}{ "success": false, "error": "Provide either \"port\" or \"all\", not both"}{ "success": false, "error": "Program with ID 999 not found"}SDK Usage
Section titled “SDK Usage”const result = await client.daemon.control.stop({ id: 1 });