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
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"
}
}
}