Skip to main content
PATCH
Update function draft

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

functionId
string
required

Zavu Function ID.

Body

application/json

Fields to update on an existing function. Provide at least one. files / sourceCode and dependencies edit the draft and take effect on the next deploy; httpEnabled applies immediately to the deployed function.

files
object

The 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/ and package.json are rejected. npm packages are not uploaded here — declare them under dependencies and Zavu installs them. Limits: 200 files and 900,000 bytes for the whole tree.

Example:
entrypoint
string
default:index.ts

Which file in files is the entry point. Defaults to index.ts.

Example:

"index.ts"

sourceCode
string

Shortcut for a single-file function: exactly equivalent to sending files with one entry named after entrypoint (index.ts by default). Fully supported — use whichever fits. If both are sent, files wins.

Maximum string length: 900000
dependencies
object

New dependency map (replaces existing dependencies).

httpEnabled
boolean

Expose 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.

Response

Draft updated.

function
object
required

A Zavu Function — user-supplied TypeScript that runs in Zavu Cloud and reacts to messaging events or HTTP requests.