Functions

Deploy code to a function

Creates a deployment for the function. Supply any subset of zip, environment, and runtime; omitted fields inherit the function's latest version. At least one field must be supplied. The first deployment of a function must include zip. The newest deployment becomes active.

Note: This endpoint is currently in Private Beta.

post/projects/{project_id}/branches/{branch_id}/functions/{slug}/deployments

Request

  • Base URL: https://console.neon.tech/api/v2
  • URL: https://console.neon.tech/api/v2/projects/{project_id}/branches/{branch_id}/functions/{slug}/deployments
  • Auth: one of:
    • HTTP bearer
    • API key in cookie zenith
    • API key in cookie keycloak_token

Request body multipart/form-data

zipstring binary

Optional ZIP archive of the function source code. Omit to reuse the latest version's bundle (a config-only change). Required for the first deployment of a function.

runtime'nodejs24'
environmentstring

Optional JSON object (a string-to-string map) of environment variables for the deployment, e.g. {"KEY":"VALUE"}. Carried as a JSON-encoded string because multipart form data does not support typed object parts.

Values are write-only: they are encrypted at rest, and responses carry only the variable names (the environment array), never the values.

Response

The created deployment

Changes

No recorded changes to this operation across all 1 revision of this API.