latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-216381,9552.9 MB

f2cf3228f366

Function

Update Function

Update an existing function's metadata, code, or both. Also the publish path: set function.published_commit_id and include "published_commit_id" in update_mask to make a commit the default runnable version. To push a new code commit, set content (and optionally commit_message); this is independent of update_mask, since commits are versioned separately from function metadata. A single request cannot publish the commit it just created, since published_commit_id is validated against existing commits before content is committed: publishing new code takes two calls, push then publish with the returned commit.id.

post/api/v1/functions/update

Request body

commitMessagestring

The commit message describing this code update. Defaults to a generic message if content is set and this is empty. Ignored if content is empty.

contentobject

File map for a new code commit, applied as the function's new head commit. Keys are file paths in the function root; values are file contents as bytes. See CreateFunctionRequest.initial_content for the required entry-file signature. Independent of update_mask.

updateMaskstring nullable

Response

Successful response