Skip to main content
POST
Keep stdin open
See error examples and recovery steps. The complete OpenAPI contract includes every response schema.

Authorizations

Authorization
string
header
required

The server's token (MIRAGE_AUTH_TOKEN) or a JWT. A daemon in the default local mode with no token accepts requests without one.

Path Parameters

workspace_id
string
required

Workspace ID.

Query Parameters

session_id
string

Session ID to use. If omitted, the default session is used.

explain
boolean
default:false

Return what the call would do without running it.

stream
boolean
default:false

Stream stdout, stderr and the final status as NDJSON. Cannot be combined with explain.

Body

command
string
required

Shell command or script to execute.

cwd
string

Working directory for this command only.

runtime
string

Runtime name to use instead of automatic runtime selection.

machine
string

Machine name to use for this command instead of automatic machine selection.

record
boolean
default:true

Include this command in session history.

open_stdin
boolean
default:false

Keep stdin open for additional input. Requires stream=true; the first response record contains line_id.

Response

Command result, policy evaluation when explain=true, or streamed output ending with a status record when stream=true. With open_stdin, the first record contains line_id.

exit_code
integer
required
stdout
string
required
stderr
string
required
line_id
string
required

Command execution ID. Use it with GET /v1/workspaces/{workspace_id}/lines/{line_id}.

refusal
object | null