Skip to main content
POST
Create a job

Authorizations

Authorization
string
header
required

Personal byk_ API key; user-principal, resolved to a tenant by org context.

Headers

Idempotency-Key
string

Absent means server-generated, which provides no deduplication; only client-supplied keys dedupe.

Maximum string length: 255
X-Bonya-Organization-ID
string

Org context. Omitted means the caller's personal organization. A well-formed non-member org is 404; malformed is 400.

Body

application/json

Exactly one of existing_sandbox_id and new_sandbox is required. Exactly one of command and script is required.

name
string

Optional human-readable name for this job.

existing_sandbox_id
string
new_sandbox
object
command
string[]
script
object

A script the user wrote or uploaded. The body travels inline and is capped; a script larger than the cap is a program, and a program belongs in the template or fetched by the script itself.

pre_run_script
object

Optional script executed after the sandbox is ready and before the job command or script. A non-zero exit stops the job.

env
object
secret_sets
string[]

Secret set names (see /v1/secret-sets).

working_dir
string
stdin_b64
string
command_timeout_seconds
integer
Required range: x >= 1
run_deadline_seconds
integer
Required range: x >= 1
disposition
enum<string>
default:delete

What happens to a sandbox this run created when the run ends, however it ends. Not meaningful for an existing sandbox.

Available options:
delete,
keep
wake_if_paused
boolean
default:false

Applies to an existing sandbox only. False makes a paused target a failure rather than an implicit wake, which is a billable action the caller may not have intended.

wait
boolean
default:false

false starts durably and returns immediately (202); true blocks for the result, bounded by the caller's own request timeout (200).

Response

wait=true and the run finished before the request timed out

run
object
required