Skip to content
Console
Menu

Queues

Workflows

Getting Started

Authentication

KV Store

Exec a lease

Runs one command in the lease to completion and returns its output, capped at 1 MiB per stream.

Runs one command in the lease to completion and returns its output, capped at 1 MiB per stream. Long-running or interactive processes use the guest protocol at status.endpoints.guest_uri.

  • Path POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/leases/lease:exec
  • Scope sandboxes:exec
  • Effect write — a successful call changes state.
  • Collection leases

#Request

FieldTypeWhat it is
namestringThe name of the lease. Required.
commandstring[]The program and its arguments. Use ["bash", "-lc", "…"] for a shell. Required.
working_directorystringThe working directory; default the user's home.
envmap<string, string>Extra environment variables.
stdinbytesBytes written to standard input.
timeoutdurationKill the process after this long; default 60 seconds, at most 10 minutes.
userstringThe guest user; default user. root is allowed: the whole machine belongs to the lessee.

#Response

FieldTypeWhat it is
exit_codeint32The exit code; -1 when killed.
stdoutbytesStandard output.
stderrbytesStandard error.
truncatedboolWhether either stream exceeded the cap.
timed_outboolWhether the process was killed at timeout.

#Errors

Every error arrives in the body Errors describes.

#Examples

curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/leases/lease:exec" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"command":["…"]}'