v51

latestOpenAPI 3.0.3raw.githubusercontent.com2026-08-02172186551.1 KB
Functions

Create function

Create a new Zavu Function. The function starts in draft status. A dedicated API key is auto-provisioned and injected as the ZAVU_API_KEY secret so the function can call back into the Zavu API without manual setup.

Provide sourceCode to seed the draft. Call POST /v1/functions/{functionId}/deploy afterwards to publish.

post/v1/functions

Request body

slugstring required

URL-safe identifier (lowercase, digits, hyphens). Must be unique per project.

namestring required
descriptionstring
runtime'nodejs24'

Runtime the function is deployed on.

timeoutSecinteger
memoryMb128 | 256 | 512 | 1024
httpEnabledboolean

Whether to expose a public HTTPS URL for this function.

sourceCodestring

TypeScript source code for the function entry point (max ~900KB).

dependenciesobject

npm dependencies. Keys are package names, values are semver ranges.

Example request

{
  "slug": "order-bot",
  "name": "Order Bot",
  "dependencies": {
    "openai": "^4.20.0"
  }
}

Response

Function created.

Example response

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