Skip to main content
POST
Restore a Scheduled Function version
Copy a published version of a Scheduled Function into its draft. Production keeps running the published code until you test and publish the draft, so restoring never changes production by itself.

Replacing an open draft

When the function already has a draft, the call returns 409 draft_already_open and changes nothing. Send replace_draft: true only when the unpublished changes can be lost.

Good to know

  • Restoring the published version clears the draft, and draft_hash comes back null.
  • Keep the returned draft_hash to publish the restored code.
  • A version number that does not exist returns 404 version_not_found.

Authorizations

X-API-Key
string
header
required

API key for authentication. Keys are prefixed with nxr_live_.

Path Parameters

id
string<uuid>
required

Scheduled Function id.

versionNumber
integer
required

Version number from the versions list. A number that does not exist returns 404 version_not_found.

Required range: x >= 1

Body

application/json
replace_draft
boolean
default:false

Replace an open draft. Its unpublished changes are lost.

Response

The version is in the draft.

success
enum<boolean>
required
Available options:
true
function
object
required
draft_hash
string | null
required

Hash of the new draft. null when the restored version is the published one.

Last modified on October 6, 2026