latestOpenAPI 3.0.3raw.githubusercontent.com2026-08-19184193611.6 KB

4dacdff2adf8

Functions

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.

patch/v1/functions/{functionId}

Path parameters

functionIdstring required

Zavu Function ID.

Request body

filesobject

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.

entrypointstring

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

sourceCodestring

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.

dependenciesobject

New dependency map (replaces existing dependencies).

httpEnabledboolean

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.

Example request

{
  "files": {
    "index.ts": "import { formatOrder } from './lib/orders';\n\nexport default async function handler(event) {\n  return { statusCode: 200, body: formatOrder(event) };\n}\n",
    "lib/orders.ts": "export function formatOrder(event) {\n  return JSON.stringify(event);\n}\n"
  },
  "entrypoint": "index.ts"
}

Response

Draft updated.

Example response

{
  "function": {
    "id": "fn_abc123",
    "slug": "order-bot",
    "name": "Order Bot",
    "timeoutSec": 10,
    "memoryMb": 256,
    "dependencies": {
      "openai": "^4.20.0"
    }
  }
}