OpenAPI 3.0.3raw.githubusercontent.com2026-08-11183192599.9 KB

5a69a1777f6f

Functions

Deploy function

Publish the function. If sourceCode or dependencies are provided in the body, they replace the current draft before deployment. Returns immediately with a deployment ID — poll GET /v1/functions/deployments/{deploymentId} until status is active or failed.

post/v1/functions/{functionId}/deploy

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

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

Deployment queued.

Example response

{
  "deployment": {
    "id": "fnd_abc123"
  }
}