← Back to JSRunner

API documentation

JSRunner, /executions

Use the /executions endpoint to submit JavaScript code for execution on api.jsrunner.cloud and receive the real backend response, including return value, console output, runtime, duration, and error details.

Overview

This endpoint is intended for Make.com and other integrations that need to send JavaScript code to JSRunner, execute it in the cloud, and retrieve the result in the exact structure returned by the Rust backend.

Endpoint

POST /executions

Base URL example

https://api.jsrunner.cloud/executions

Authentication

Use a user API key in the Authorization header.

Authorization: Bearer YOUR_API_KEY

Request headers

Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

Request body

Example

{
  "code": "4 + 2",
  "collect_console": true,
  "timeout": 5000
}
FieldTypeRequiredDescription
codestringyesJavaScript code to execute.
collect_consolebooleannoWhen true, JSRunner captures console.log output into the response.
timeoutnumbernoExecution timeout in milliseconds. The backend clamps it to the server-side maximum.

Response

Success example

{
  "status": "success",
  "return_value": 6,
  "console": "",
  "duration_ms": 123,
  "runtime": "native-node-vm",
  "error": null
}
FieldTypeDescription
statusstringExecution status, either success or error.
return_valueanyReturned value from the executed JavaScript. If the runtime emits JSON, it is returned as parsed JSON.
consolestringCollected console output. Usually empty unless collect_console is enabled.
duration_msnumberExecution duration in milliseconds.
runtimestringCurrent backend runtime identifier. Right now this is native-node-vm.
errorstring | nullError message if execution failed.

Error response example

{
  "status": "error",
  "return_value": null,
  "console": "",
  "duration_ms": 17,
  "runtime": "native-node-vm",
  "error": "Unexpected token ';'"
}

Typical Make.com usage

  • transform incoming data with custom JavaScript
  • normalize payloads between apps
  • calculate derived values
  • post-process webhook data
  • apply business rules before the next scenario step
  • capture debug output with collect_console during scenario development

Example Make request body

{
  "code": "4 + 2",
  "collect_console": true,
  "timeout": 5000
}

Notes

  • The request body accepted by the real backend is code, optional collect_console, and optional timeout.
  • The backend authenticates /executions using an API key, not the regular session token flow.
  • The code must not be empty and is also constrained by a server-side maximum code size.
  • The backend clamps timeout to the server-side maximum, so larger client values are not guaranteed to be honored.
  • Executions are logged per user and quota checks are applied before execution.

Example cURL

curl -X POST "https://api.jsrunner.cloud/executions" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "code": "4 + 2",
    "collect_console": true,
    "timeout": 5000
  }'