v0.7.0

API Reference

Last updated


Request fields and status codes for HakoRun's three HTTP endpoints; for response formats see Responses and SSE.

POST /upload


Stores a function as a new version.
FieldTypeRequiredDescription
pathstringYesFunction path; must not contain ..
codestringYesSource code
languagestringYespython, javascript, or typescript

StatusBodyCase
200{"path", "language", "version"}Stored
400Invalid request payloadMissing field or malformed JSON
400Invalid pathpath contains .., or language is unsupported (same message)
500Failed to save functionStorage backend write failed

POST /run/*path


Runs a stored function. The body must be JSON; send {} when there is no input.
ParameterInTypeDescription
versionqueryint64Target version; omitted or non-integer means latest
inputbodystringJSON string, exposed as event / input
streambodybooltrue responds over SSE

StatusCase
200Success (JSON or SSE)
400Body is not valid JSON or exceeds CODE_MAX_SIZE
404script not found or assign version not found
500Non-stream execution failed or timed out (failed to run: ...)

POST /run-now


Runs the code in the request without storing it.
FieldTypeRequiredDescription
codestringYesSource code; must not be blank
languagestringYespython, javascript, or typescript
inputstringNoJSON string input
streamboolNotrue responds over SSE

StatusCase
200Success (JSON or SSE)
400Bad body, unsupported language, or code is required
500Non-stream execution failed or timed out


中文