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.
Authorization
AuthorizationheaderrequiredBearer YOUR_API_KEY. Create a key in the dashboard.
Path parameters
functionIdstringrequiredZavu Function ID.
Body
application/json · optional
filesobjectThe 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/andpackage.jsonare rejected. npm packages are not uploaded here — declare them underdependenciesand Zavu installs them. Limits: 200 files and 900,000 bytes for the whole tree.1 properties
{key}string
entrypointstringWhich file in
filesis the entry point. Defaults toindex.ts.Defaultindex.tssourceCodestringShortcut for a single-file function: exactly equivalent to sending
fileswith one entry named afterentrypoint(index.tsby default). Fully supported — use whichever fits. If both are sent,fileswins.Limitsmax length 900000dependenciesobjectNew dependency map (replaces existing dependencies).
1 properties
{key}string
Responses
202Deployment queued.
deploymentobjectrequired10 properties
idstringrequiredfunctionIdstringrequiredversionintegerrequiredMonotonically increasing deployment version, starting at 1.
statusstringrequiredStage of a function deployment.
One ofpendingbundlinguploadingpublishingactivefailedsupersededsourceCodeBytesintegerTotal size of the deployed source tree in bytes.
bundleBytesintegerSize of the built bundle in bytes. Null until the build finishes.
errorMessagestringFailure reason when status is 'failed'.
buildLogsstringWhat the build printed: dependency installation, the bundler's output, and the compiler's message when it failed. Returned when fetching a single deployment, omitted from the list. Read this first when a deploy fails —
errorMessageis often the outer wrapper's summary, and the line that names the broken import or the syntax error is here.deployedAtstring<date-time>createdAtstring<date-time>required
400Invalid request or function in a non-deployable state.
codestringrequiredmessagestringrequireddetailsobject
401Unauthorized.
codestringrequiredmessagestringrequireddetailsobject
404Function not found.
codestringrequiredmessagestringrequireddetailsobject