Run a procedure
Compiles a procedure and starts a run of it, with no saved Machine. Creates a job. A procedure with errors gives 400 procedure_invalid and no job. Needs the scope machines. With no preference, the API holds the request up to 30 seconds.
Authentication
An API key (crk_), an exchanged token (crt_) or a JWT of a trusted issuer. The credential needs the scope of the capability. Read the description of each route.
Headers
wait=N (1 to 90) holds the request up to N seconds. respond-async answers 202 at once. Behind a proxy with a 60 second idle timeout, use wait=55 or less.
A key that makes a retry safe, valid for 24 hours. The same key with another body gives 409 idempotency_key_reused.
Query parameters
The alias of Prefer: wait=N. The Prefer header wins when both are there.
Request
Only with include=procedure.
The tools of the procedure: a list, or an object with tools.
The inputs of the procedure, by name. A file input is {url, name?} or {id} of a stored file.
Where the API sends the webhook of the job. Each delivery has an x-cr-signature header: a JWT that you verify with the JWKS of the tenant.
Only asap. Other values give 400 deadline_not_supported.
Response headers
The id of the request: req_ and a ULID. Every answer has it.
true when the answer replays an earlier request with the same key.
Response
The job ended. A failed job also answers 200. Accept: text/event-stream streams the events of the job as server-sent events: job.progress, job.needs_input, job.succeeded, job.failed, job.cancelled, job.expired. A terminal event carries the job and ends the stream.
job_ and a ULID.
Only asap at this time.
Machine jobs only. What the job waits for while its status is needs_input, else null. The other jobs do not have this field.