Skip to content

Roll back to a previous deployment

View .md
POST

Re-deploy a previous version by copying its source, dependencies, and runtime pin onto the function's draft, then deploying. Returns immediately with a deployment ID — poll GET /v1/functions/deployments/{deploymentId} until status is active or failed. Secrets are not rolled back.

Authorization

  • Authorizationheaderrequired

    Bearer YOUR_API_KEY. Create a key in the dashboard.

Path parameters

  • functionIdstringrequired

    Zavu Function ID.

Body

application/json

  • deploymentIdstringrequired

    ID of the deployment to roll back to.

Responses

202Rollback deployment queued.
  • deploymentobjectrequired
    10 properties
    • idstringrequired
    • functionIdstringrequired
    • versionintegerrequired

      Monotonically increasing deployment version, starting at 1.

    • statusstringrequired

      Stage of a function deployment.

      One ofpendingbundlinguploadingpublishingactivefailedsuperseded
    • sourceCodeBytesintegernullable

      Total size of the deployed source tree in bytes.

    • bundleBytesintegernullable

      Size of the built bundle in bytes. Null until the build finishes.

    • errorMessagestringnullable

      Failure reason when status is 'failed'.

    • buildLogsstringnullable

      What the build printed: dependency installation, the bundler's output, and the compiler's message when it failed. Returned when fetching a single deployment, omitted from the list. Read this first when a deploy fails — errorMessage is often the outer wrapper's summary, and the line that names the broken import or the syntax error is here.

    • deployedAtstring<date-time>nullable
    • createdAtstring<date-time>required
  • rolledBackToVersioninteger
  • previousDraftobjectnullable

    The draft that was replaced, so a UI can offer to restore it.

400Invalid request or function in a non-deployable state.
  • codestringrequired
  • messagestringrequired
  • detailsobject
401Unauthorized.
  • codestringrequired
  • messagestringrequired
  • detailsobject
404Function or deployment not found.
  • codestringrequired
  • messagestringrequired
  • detailsobject