---
title: "Deploy multiple functions in one request"
method: POST
path: "/projects/{id}/functions/batch"
tags: ["Functions"]
---

# Deploy multiple functions in one request

`POST /projects/{id}/functions/batch`

## Request

- Base URL: `https://api.volcano.dev`
- URL: `https://api.volcano.dev/projects/{id}/functions/batch`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Upload multiple function source archives in one multipart request. Each archive should contain source files
plus dependency manifests/lockfiles, not installed dependency directories. ZIP and tar.gz uploads are
accepted and normalized to tar.gz before storage. The API enforces `SOURCE_ARCHIVE_SIZE_LIMIT_MB`
for each uploaded and normalized source archive. The server records a shared
deployment batch ID for the resulting function deployments. Each function deployment runs its own
compile/publish workflow concurrently, and each publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB`
for the final container image.
One batch request can include up to 100 functions. Submit multiple batch requests for larger projects.
If one function fails before its workflow starts, already-started function deployments are left
running and the failed function is reported in the `failed` array. Failed new functions are deleted;
failed updates are rolled back to their previous metadata/status where possible.

## Path parameters

- `id` string, uuid, required

## Request body `multipart/form-data`

- object
  - `functions` string, required: JSON array of functions with `name`, `runtime`, optional `handler`, and `file_field`. Each `file_field` must name a multipart file field containing that function's ZIP or tar.gz source bundle. Each entry may also declare `variable_scope` (`all` or `scoped`) and `variables` (an array of project variable names). Omitting them leaves the function's stored declaration unchanged. Volcano detects direct environment references in the uploaded source code and keeps them separate from the declared names: detected names are not written back to the declaration and do not appear in a config export. A scoped function receives its declared names plus the detected ones the project defines; a detected name the project does not define is ignored, since such a reference is often optional. Detection reads code only, so a name appearing solely in a comment or in an unrelated string is not a reference. Declare a name when the function reads it through a computed key, or when it must not deploy without the variable. The request is rejected with 400 before anything is deployed if a scoped function declares a variable the project does not define, or if the resulting environment exceeds 4096 bytes.
  - `code_0` string, binary: Function ZIP or tar.gz archive referenced by the first manifest entry's `file_field`; additional code_N file fields may be included. Each archive is subject to SOURCE_ARCHIVE_SIZE_LIMIT_MB.

## Response `202`

Batch deployment accepted

- BatchFunctionDeployResponse
  - `batch_id` string, uuid, required
  - `data` Function[], required: Functions whose deployment workflows were started successfully
    - `id` string, uuid, required
    - `project_id` string, uuid, required
    - `name` string, required
    - `status` 'provisioning' | 'active' | 'failed' | 'deleting', required
    - `provisioning_started_at` string, date-time: Timestamp when the current provisioning phase started
    - `visibility` 'private' | 'authenticated' | 'public', required: Who can invoke the function. Each level admits everything the one before it does. - `private`: service keys and the project's schedulers only. The default for a new function. To any other credential the function does not exist: it answers 404, like a missing one. - `authenticated`: also any signed-in user of the project, including anonymous sign-ins. The function receives their auth context. - `public`: also anon keys holding `functions.invoke`, and Frontend Function routes, which forward requests without a credential.
    - `is_public` boolean, required: Deprecated. `true` exactly when `visibility` is `public`.
    - `invocation_mode` 'rpc' | 'http', required: Invocation contract. `rpc` preserves the existing POST `{payload: ...}` contract; `http` forwards HTTP request semantics to the function runtime.
    - `http_auth_mode` 'volcano' | 'none', required: Authentication applied by the HTTP ingress. `none` is valid only for HTTP-mode functions with `visibility: public` and is intended for externally signed webhooks.
    - `openapi_spec` object, nullable, required: Optional OpenAPI 3.0 or 3.1 document describing an HTTP-mode function.
    - `has_openapi_spec` boolean, required: Whether OpenAPI metadata is configured; list responses omit the document itself.
    - `invoke_url` string: Canonical geo-routed HTTPS endpoint for invoking this function. Use it as-is: it does not share a domain with the API, so a host derived from the API URL will not reach the function. Omitted when the deployment serves no public invocation domain, as in local development, so a client testing for an empty string never matches.
    - `deployed_regions` string[], required: Regions where this function is currently deployed
    - `runtime` string
    - `handler` string
    - `current_deployment_id` string, uuid: Identifier of the latest function deployment operation
    - `pending_deployment_id` string, uuid: Newest queued deployment that will run after the current operation
    - `last_invoked_at` string, date-time: Most recent successful invocation timestamp
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
  - `failed` BatchFunctionDeployFailure[]: Functions that failed before their workflow started. Successful functions are left running; failed new functions are deleted and failed updates are rolled back where possible.
    - `name` string, required
    - `function_id` string, uuid
    - `operation` 'deploy' | 'update'
    - `error` string, required

## Other responses

- `207`: Batch deployment partially accepted; successful functions started deployment and failed functions were compensated where possible
- `400`: Bad request
- `403`: Function limit exceeded for the project
- `409`: A name in the batch is held by a function of the other kind — a function cannot change kind — or the project's source is managed by Git, where deploys come from a push to the production branch.
- `429`: The owner's billing-cycle build-minutes allowance is spent. The error names the allowance and carries a link to the usage page.
- `503`: Build usage could not be read, so the allowance could not be checked. The same request succeeds once it can be.

## Changes

- **2026-10-07** `23e7875e7c4c`: 2 warning, 7 info
  - removed the optional property `data/items/aws_function_arn` from the response with the `202` status
  - removed the optional property `data/items/aws_function_arn` from the response with the `207` status
  - the endpoint scheme security `ProjectAccessToken` was added to the API
  - added the non-success response with the status `429`
  - …5 more
- **2026-09-19** `3a6f365f3f35`: 4 breaking, 10 info
  - added the new path request parameter `id`
  - the response's body type changed from no type to `object` for status `202`
  - the response's body type changed from no type to `object` for status `207`
  - the response's body type changed from no type to `object` for status `400`
  - …10 more
- **2026-08-27** `bb44e98aba2e`: 8 breaking, 4 warning
  - the response's body type changed from `object` to no type for status `202`
  - the response's body type changed from `object` to no type for status `207`
  - the response's body type changed from `object` to no type for status `400`
  - removed the required property `batch_id` from the response with the `202` status
  - …8 more
- **2026-07-27** `bb52784e098a`: 3 info
  - added the optional property `code` to the response with the `400` status
  - added the optional property `data/items/pending_deployment_id` to the response with the `202` status
  - added the optional property `data/items/pending_deployment_id` to the response with the `207` status

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/projects/:id/functions/batch/post.md)

---

[API](https://skmtc.dev/kong/apis/volcano-api.md) - [All operations](https://skmtc.dev/kong/apis/volcano-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/volcano-api/revisions/84c4488f91e9?raw)
