Sandbox

Execute function

Changed on

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

  • Base URL
    https://api.riza.io
  • Auth
    HTTP bearer

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.

inputunknown
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

outputunknown required
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.

Changes