Execute scripts as HTTP endpoints via POST requests. The Script Execution API lets you run server-side scripts by making a POST request to the script’s path, supporting Next.js-style routing for dynamic and catch-all routes.
Execute a script with POST data. The script receives the POST body and returns the result in the response.
Name In Type Required Description pathpath string Yes Script path (supports Next.js-style routing)
This endpoint does not define a request body schema. Any JSON payload sent will be forwarded to the script.
"output" : " Script executed successfully " ,
"message" : " Invalid JSON in request body "
Error Code Title Description Resolution VALIDATION_ERRORInvalid request data The request body failed validation Check request body format and try again
"message" : " Script not found at path "
Error Code Title Description Resolution SCRIPT_NOT_FOUNDScript file not found No script exists at the specified path Verify the script path and ensure the file exists
"error" : " Internal Server Error " ,
"message" : " Runtime error in script "
Error Code Title Description Resolution SCRIPT_EXECUTION_ERRORScript execution failed An error occurred while executing the script Check script logs for detailed error information
const result = await client . exec . execution . execute ( {
path: " scripts/handle-webhook " ,