Skip to main content
PATCH
/
v1
/
functions
/
{functionId}
Update function draft
curl --request PATCH \
  --url https://api.zavu.dev/v1/functions/{functionId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "sourceCode": "<string>",
  "dependencies": {}
}
'
{
  "function": {
    "id": "fn_abc123",
    "slug": "order-bot",
    "name": "Order Bot",
    "runtime": "nodejs20",
    "status": "draft",
    "timeoutSec": 10,
    "memoryMb": 256,
    "httpEnabled": true,
    "dependencies": {
      "openai": "^4.20.0"
    },
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "description": "<string>",
    "publicUrl": "<string>",
    "activeDeploymentId": "<string>"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.zavu.dev/llms.txt

Use this file to discover all available pages before exploring further.

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

Optional source/dependencies update applied before deploying. Omit both fields to redeploy the current draft as-is.

sourceCode
string

New source code to publish (replaces the draft).

Maximum string length: 900000
dependencies
object

New dependency map (replaces existing dependencies).

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.