Update function draft
Update an existing function. sourceCode / dependencies edit the draft without triggering a build — they go live on the next POST /v1/functions/{functionId}/deploy. httpEnabled is applied to the deployed function immediately, so turning the public endpoint on or off does not require a redeploy.
Authorization
AuthorizationheaderrequiredBearer YOUR_API_KEY. Create a key in the dashboard.
Path parameters
functionIdstringrequiredZavu Function ID.
Body
application/json
filesobjectThe project's source files, keyed by path relative to the project root (e.g.
index.ts,lib/orders.ts). Imports between them are resolved when the function is built, so a function can be split across as many files as it needs.Paths must be relative and use forward slashes;
..,node_modules/andpackage.jsonare rejected. npm packages are not uploaded here — declare them underdependenciesand Zavu installs them. Limits: 200 files and 900,000 bytes for the whole tree.1 properties
{key}string
entrypointstringWhich file in
filesis the entry point. Defaults toindex.ts.Defaultindex.tssourceCodestringShortcut for a single-file function: exactly equivalent to sending
fileswith one entry named afterentrypoint(index.tsby default). Fully supported — use whichever fits. If both are sent,fileswins.Limitsmax length 900000dependenciesobjectNew dependency map (replaces existing dependencies).
1 properties
{key}string
httpEnabledbooleanExpose the function on its public HTTPS URL, or take it down. Applies to the already-deployed function without redeploying; the URL is returned as
publicUrl.
Responses
200Draft updated.
functionobjectrequiredA Zavu Function — user-supplied TypeScript that runs in Zavu Cloud and reacts to messaging events or HTTP requests.
14 properties
idstringrequiredslugstringrequiredURL-safe identifier, unique per project.
namestringrequireddescriptionstringruntimestringrequiredRuntime the function is deployed on.
One ofnodejs24statusstringrequiredLifecycle status of a Zavu Function.
One ofdraftbundlingdeployingactivefaileddisabledtimeoutSecintegerrequiredPer-invocation timeout in seconds.
memoryMbintegerrequiredMemory allocation in MB.
httpEnabledbooleanrequiredWhether the function can be invoked over HTTPS via its public URL.
publicUrlstring<uri>HTTPS endpoint, present only while httpEnabled is true. Null otherwise, including for a function that was previously exposed — the stored URL stops serving the moment HTTP is turned off, so it is never returned.
dependenciesobjectrequirednpm dependencies installed in the function bundle. Keys are package names, values are semver ranges.
1 properties
{key}string
activeDeploymentIdstringID of the deployment currently serving traffic.
createdAtstring<date-time>requiredupdatedAtstring<date-time>required
400No fields provided.
codestringrequiredmessagestringrequireddetailsobject
401Unauthorized.
codestringrequiredmessagestringrequireddetailsobject
404Function not found.
codestringrequiredmessagestringrequireddetailsobject