Skip to content

API Endpoints

ZestSSH’s automation API exposes five actions. Each can be invoked via the zestssh:// URL scheme (all platforms) or Android intents (Android only).

Connects to a server, runs a single command, captures output, and disconnects.

zestssh://execute?connection=LABEL_OR_ID&command=COMMAND&key=API_KEY
  • Action: com.affluentlabs.zestssh.EXECUTE
  • Extras:
    • connection_id (String) --- connection label or UUID
    • command (String) --- the shell command
    • key (String) --- API key
    • timeout (int, optional) --- seconds, default 30
ParameterRequiredDefaultDescription
connectionYes---Connection label (case-insensitive) or UUID
commandYes---Shell command to execute
keyYes---API key
timeoutNo30Timeout in seconds
grepNo---Regex pattern to filter output lines
headNo---Keep only first N lines after grep
tailNo---Keep only last N lines after head
callbackNo---HTTPS webhook URL to POST results to

Returns to the calling app via Android’s result mechanism:

  • stdout --- command output (filtered if grep/head/tail were specified)
  • exit_code --- 0 for success, non-zero for failure

Runs a snippet by name on a connection. Supports variable substitution.

zestssh://snippet?connection=LABEL_OR_ID&name=SNIPPET_NAME&key=API_KEY
  • Action: com.affluentlabs.zestssh.SNIPPET
  • Extras:
    • connection_id (String)
    • snippet_name (String)
    • key (String)
    • var_VARNAME (String, optional) --- one extra per variable
ParameterRequiredDefaultDescription
connectionYes---Connection label or UUID
nameYes---Snippet label (case-insensitive exact match)
keyYes---API key
var_*No---Variable substitutions. var_branch=main replaces {{branch}} in the snippet

If a snippet’s command contains {{placeholder}} patterns, pass matching variables with the var_ prefix:

zestssh://snippet?connection=prod&name=deploy&var_branch=main&var_tag=v2.1&key=KEY

This replaces {{branch}} with main and {{tag}} with v2.1 in the snippet command before execution.


Executes the same command across multiple connections, either in parallel or sequentially.

zestssh://batch?connections=A,B,C&command=COMMAND&key=API_KEY
ParameterRequiredDefaultDescription
connectionsYes---Comma-separated list of connection labels or UUIDs
commandYes---Shell command
keyYes---API key
timeoutNo30Timeout in seconds (per connection)
parallelNotruetrue for concurrent, false for sequential
grepNo---Regex filter applied to each connection’s output
headNo---First N lines per connection
tailNo---Last N lines per connection
callbackNo---HTTPS webhook URL

Combined output with headers per connection:

=== Web1 (exit=0) ===
output from Web1
=== Web2 (exit=0) ===
output from Web2
=== Web3 (exit=1) ===
STDERR: error message

Overall exit code is 0 only if all connections succeeded.


Triggers a saved multi-step workflow by name or ID.

zestssh://workflow?name=WORKFLOW_NAME&key=API_KEY

Or by ID:

zestssh://workflow?id=WORKFLOW_UUID&key=API_KEY
  • Action: com.affluentlabs.zestssh.WORKFLOW
  • Extras:
    • workflow_name (String) or workflow_id (String)
    • key (String)
ParameterRequiredDefaultDescription
nameYes*---Workflow name (case-insensitive)
idYes*---Workflow UUID
keyYes---API key

*Either name or id is required.

Summary of workflow execution including step count, success count, and total elapsed time.


Tests that a connection can be established and authenticated. Runs echo "ZestSSH: connected successfully" and disconnects.

  • Action: com.affluentlabs.zestssh.CONNECT
  • Extras:
    • connection_id (String)
    • key (String)

There is no dedicated connect URL scheme endpoint. Use execute with a simple command like echo ok for the same effect.

  • stdout --- “Connected to [connection] successfully” or error message
  • exit_code --- 0 for success, 1 for failure

When a callback URL is provided, ZestSSH sends an HTTPS POST with:

{
"connection": "server-label",
"command": "the executed command",
"stdout": "command output",
"stderr": "error output if any",
"exit_code": 0,
"elapsed_ms": 1234,
"timestamp": "2025-01-15T10:30:00.000Z"
}

Requirements:

  • The callback URL must use HTTPS. HTTP URLs are rejected.
  • The POST is fire-and-forget --- ZestSSH does not retry on failure.
  • Content-Type is application/json.

All endpoints return errors in the same format:

Conditionstdoutexit_code
Pro subscription requiredERROR: ZestSSH Pro subscription required for automation.1
Automation disabledERROR: Automation is disabled in ZestSSH settings.1
Invalid API keyERROR: Invalid or missing automation API key.1
Connection not foundERROR: Connection not found: [name]1
Snippet not foundERROR: Snippet not found: [name]1
Workflow not foundERROR: Workflow not found: [name]1
Missing parametersERROR: No command specified.1
TimeoutTimeout: [details]1
SSH errorError description1