Raw API access

miosa api sends a request to the MIOSA API with your stored credentials and prints the response body. The path is relative to the API base URL (/api/v1). Use it for anything the CLI has no command for yet.

miosa api [METHOD] <path> [flags]

The method defaults to GET, or POST when --data is given.

miosa api /credits/balance
miosa api GET /sandboxes/my-box/ports
miosa api POST /webhooks -d '{"url":"https://example.com/hook","events":["sandbox.ready"]}'
miosa api PATCH /sandboxes/my-box/tags -d @tags.json
echo '{"name":"x"}' | miosa api POST /workspaces -d -
FlagMeaning
-X, --method stringHTTP method (default GET, or POST with --data)
-d, --data stringRequest body: JSON, @file, or - for stdin
-H, --header stringArrayExtra header, 'Name: value' (repeatable)
-i, --includePrint the status line and response headers first

A failing status exits non-zero (see exit codes) and still prints the body.

When to reach for the raw API

NeedUse
Code/build/test/runtime workspacemiosa create, miosa exec, miosa files, miosa services, miosa url
Full GUI/browser computermiosa api /computers ... or an SDK (client.computers)
App Engine applianceSDK or API App Engine endpoints; publish from a sandbox to App Engine
Product/template readinessmiosa catalog
Anything elsemiosa api <METHOD> <path>
Was this page helpful?