Enable and disable programs
Section titled “Enable and disable programs”Use these endpoints to register or deregister a program with supervisord. Enabling activates the program so it can be started; disabling removes it from the supervisord configuration and stops it if it is currently running.
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 |
curl -X POST "https://proj-acme-webapp-daemon-1.us-east-1.containers.hoody.icu/api/v1/daemon/programs/1/enable"await client.daemon.control.enable(1){ "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"}Disable a program
Section titled “Disable a program”POST /api/v1/daemon/programs/{id}/disable
Disables the program and removes it from the supervisord configuration. The program is stopped if it is currently running.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | Yes | Unique numeric identifier of the program |
curl -X POST "https://proj-acme-webapp-daemon-1.us-east-1.containers.hoody.icu/api/v1/daemon/programs/1/disable"await client.daemon.control.disable(1){ "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"}Start and stop programs
Section titled “Start and stop programs”Use these endpoints to control runtime execution of an enabled program via supervisorctl. Both endpoints support port-range programs: start requires a port to identify the instance, and stop accepts either port for a single instance or all: true for every instance.
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. Set wait: true to block until the program reaches the RUNNING state. Set if_not_running: true for idempotent calls — useful for edge proxy automation where the same instance may already be running.
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”| Name | 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 the program to reach the 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 the instance is not already running (idempotent mode). When true, the response includes an already_running field. Recommended for edge proxy automation. |
Start a standard program:
curl -X POST "https://proj-acme-webapp-daemon-1.us-east-1.containers.hoody.icu/api/v1/daemon/programs/1/start" \ -H "Content-Type: application/json" \ -d '{}'Start a specific port instance and wait for the RUNNING state:
curl -X POST "https://proj-acme-webapp-daemon-1.us-east-1.containers.hoody.icu/api/v1/daemon/programs/2/start" \ -H "Content-Type: application/json" \ -d '{"port": 8042, "wait": true, "timeout": 60}'Idempotent start for edge proxy automation:
curl -X POST "https://proj-acme-webapp-daemon-1.us-east-1.containers.hoody.icu/api/v1/daemon/programs/2/start" \ -H "Content-Type: application/json" \ -d '{"port": 8042, "if_not_running": true}'Start a standard program:
await client.daemon.control.start(1)Start a specific port instance:
await client.daemon.control.start(2, { port: 8042 })Start a port instance and wait for RUNNING:
await client.daemon.control.start(2, { port: 8042, wait: true, timeout: 60 })Idempotent start for edge proxy automation:
await client.daemon.control.start(2, { port: 8042, if_not_running: true })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" }}| Name | Type | Required | Description |
|---|---|---|---|
success | boolean | No | Indicates the operation succeeded. |
already_running | boolean | No | Present when if_not_running is true. true if the instance was already running; false if it was started by this call. |
instance | object | No | Details about the started instance. |
instance.port | integer | No | Port number of the instance. |
instance.instance_name | string | No | Supervisord instance name, typically program_port. |
instance.status | string | No | Current status. One of RUNNING, STOPPED, STARTING, STOPPING, BACKOFF, FATAL. |
instance.pid | integer | No | Process ID when the program is running. |
instance.uptime | string | No | Uptime in H:MM:SS format when the program is running. |
Port required for port-range program
{ "success": false, "error": "Port parameter is required for port-range programs"}Port outside valid range
{ "success": false, "error": "Port must be between 1 and 65535"}{ "success": false, "error": "Program with ID 999 not found"}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 single instance or all: true to stop every instance at once.
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”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
port | integer | No | — | Specific port to stop. Range: 1–65535. |
all | boolean | No | — | Stop all instances of a port-range program. Mutually exclusive with port. |
Stop a standard program:
curl -X POST "https://proj-acme-webapp-daemon-1.us-east-1.containers.hoody.icu/api/v1/daemon/programs/1/stop" \ -H "Content-Type: application/json" \ -d '{}'Stop a specific port instance:
curl -X POST "https://proj-acme-webapp-daemon-1.us-east-1.containers.hoody.icu/api/v1/daemon/programs/2/stop" \ -H "Content-Type: application/json" \ -d '{"port": 8042}'Stop every instance of a port-range program:
curl -X POST "https://proj-acme-webapp-daemon-1.us-east-1.containers.hoody.icu/api/v1/daemon/programs/2/stop" \ -H "Content-Type: application/json" \ -d '{"all": true}'Stop a standard program:
await client.daemon.control.stop(1)Stop a specific port instance:
await client.daemon.control.stop(2, { port: 8042 })Stop every instance of a port-range program:
await client.daemon.control.stop(2, { all: true })