Skip to content

The Program Control API lets you toggle program registration with supervisord and start or stop running processes. Use these endpoints to activate or deactivate programs, and to trigger lifecycle transitions on demand. For port-range programs, individual instances are controlled by specifying a port.


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

This endpoint takes no request body.

Terminal window
curl -X POST "https://api.hoody.com/api/v1/daemon/programs/1/enable" \
-H "Authorization: Bearer <token>"

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

This endpoint takes no request body.

Terminal window
curl -X POST "https://api.hoody.com/api/v1/daemon/programs/1/disable" \
-H "Authorization: Bearer <token>"

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 (safe to invoke multiple times) — recommended for Hoody Proxy automation. The program must be enabled.

NameInTypeRequiredDescription
idpathintegerYesUnique numeric identifier of the program
NameTypeRequiredDefaultDescription
portintegerNoPort number to start (required for port-range programs). Range: 1–65535.
waitbooleanNofalseWait for the 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). Returns an already_running field in the response. Use this for Hoody Proxy automation.

Example: Start specific port instance

{
"port": 8042
}

Example: Start and wait for RUNNING state

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

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
}
Terminal window
curl -X POST "https://api.hoody.com/api/v1/daemon/programs/42/start" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"port": 8042,
"wait": true,
"timeout": 60
}'

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
NameTypeRequiredDefaultDescription
portintegerNoSpecific port instance 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
}
Terminal window
curl -X POST "https://api.hoody.com/api/v1/daemon/programs/42/stop" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"port": 8042
}'