Save a Cloud Function draft
Save a Cloud Function draft
Save new code as the draft of a Cloud Function without changing what production runs. Returns the draft_hash that publishing requires.
PATCH
Save a Cloud Function draft
Save new code for a Cloud Function without changing what production runs. The published code keeps running on every matching event until you publish the draft.
How the draft works
- Each function has one draft, shared by the dashboard, the API, and the MCP. Each save replaces it.
- Only the code is drafted. The name, description, trigger, and
is_activechange immediately with Update. - Saving code identical to the published code leaves no draft, and
draft_hashcomes backnull. - Keep the
draft_hashfrom the response: Publish requires it.
Sending
code to Update still publishes it immediately. Use this endpoint when the change should be tested first.Next steps
- Test the draft.
- Review the requests it would have sent and the previewed lead changes.
- Publish it with that
draft_hashasexpected_draft_hash.
Authorizations
API key for authentication. Keys are prefixed with nxr_live_.
Path Parameters
Cloud Function id.
Body
application/json
The complete code of the draft. It replaces the previous draft.
Last modified on October 6, 2026