S Technologies's Logo

Color

Green
Teal
Indigo
Blue
Purple
Red
Rose

Mode

Light

api

Send a GET, POST, PUT, PATCH or DELETE to any customer endpoint, with this machine's credential.

stechbd api reaches any customer endpoint the panel has, with this machine's credential, the way gh api reaches GitHub. Use it for what no command covers yet. The path is relative to /api/v1. Every command also takes --json, --quiet and --help.

CommandWhat it does
stechbd api getSend a GET to a customer endpoint
stechbd api postSend a POST, with a JSON body
stechbd api putSend a PUT, with a JSON body
stechbd api patchSend a PATCH, with a JSON body
stechbd api deleteSend a DELETE

Only customer endpoints in the API contract this CLI ships with are sent. An operator endpoint is refused before the request is made, and the refusal says the installation is managed from the dashboard. Each response is printed as JSON. A 204 prints nothing.

stechbd api get

Sends a GET and prints the JSON the panel returns. A GET is retried, because repeating a read is safe. --query adds key=value pairs to the query string, and may be given more than once. A --data body on a GET is refused, not dropped.

bash
stechbd api get <path> [--query <key=value>]
OptionDescription
<path>The endpoint path, such as /servers. A full URL is refused. Required.
--query <key=value>A query parameter. Repeatable.
bash
stechbd api get /servers
stechbd api get /apps/01J.../deployments --query limit=5

stechbd api post

Sends a POST. The body is given with --data, as JSON text, as @file to read a file, or as - to read stdin. The body is parsed before anything is sent, so a JSON typo is reported and nothing reaches the panel. Only GET requests are retried.

bash
stechbd api post <path> [--data <json|@file|->] [--query <key=value>]
OptionDescription
<path>The endpoint path. Required.
--data <json|@file|->The JSON body: inline text, @file to read a file, or - to read stdin.
--query <key=value>A query parameter. Repeatable.
bash
stechbd api post /tokens --data @token.json
echo '{"name":"blog"}' | stechbd api post /tokens --data -

stechbd api put

Sends a PUT with a JSON body, read the same way as post. The body is parsed before anything is sent. Only GET requests are retried.

bash
stechbd api put <path> [--data <json|@file|->] [--query <key=value>]
OptionDescription
<path>The endpoint path. Required.
--data <json|@file|->The JSON body: inline text, @file to read a file, or - to read stdin.
--query <key=value>A query parameter. Repeatable.
bash
# replace an application’s redirect and header rules with the contents of rules.json
stechbd api put /apps/01J.../rules --data @rules.json

stechbd api patch

Sends a PATCH with a JSON body, read the same way as post. The body is parsed before anything is sent. Only GET requests are retried.

bash
stechbd api patch <path> [--data <json|@file|->] [--query <key=value>]
OptionDescription
<path>The endpoint path. Required.
--data <json|@file|->The JSON body: inline text, @file to read a file, or - to read stdin.
--query <key=value>A query parameter. Repeatable.
bash
echo '{"name":"blog"}' | stechbd api patch /projects/01J... --data -

stechbd api delete

Sends a DELETE. A DELETE takes no body, so --data is refused. Only GET requests are retried.

bash
stechbd api delete <path> [--query <key=value>]
OptionDescription
<path>The endpoint path. Required.
--query <key=value>A query parameter. Repeatable.
bash
stechbd api delete /tokens/01J...