v19

latestOpenAPI 3.0.3raw.githubusercontent.com2025-06-29204858.4 KB
Sandbox

Execute function

Run a function in a secure, isolated environment. Define a function named execute. The function will be passed input as an object.

post/v1/execute-function

Request body

codestring required

The function to execute. Your code must define a function named "execute" that takes in a single argument and returns a JSON-serializable value.

envobject

Set of key-value pairs to add to the function's execution environment.

{"stackTrail":"components:schemas:ExecuteFunctionRequest:properties:input","oasType":"schema","type":"unknown","description":"The input to the function. This must be a valid JSON-serializable object. If you do not pass an input, your function will be called with None (Python) or null (JavaScript/TypeScript) as the argument."}
language'python' | 'javascript' | 'typescript' required

The interpreter to use when executing code.

runtime_revision_idstring

The ID of the runtime revision to use when executing code.

Response

OK

{"stackTrail":"components:schemas:ExecuteFunctionResponse:properties:output","oasType":"schema","type":"unknown","description":"The output of the function."}
output_status'error' | 'json_serialization_error' | 'valid' required

The status of the output. "valid" means your function executed successfully and returned a valid JSON-serializable object, or void. "json_serialization_error" means your function executed successfully, but returned a nonserializable object. "error" means your function failed to execute.