Go back to a version

SDK platic.tools.functions.rollback()

Make an earlier published version live. Agents immediately use its code, domains, time limit, and secret slots. The draft stays unchanged.

Example

await platic.tools.functions.rollback("fn_123", 1);

Path parameters

ParameterTypeDescriptionRequired
functionIdstringFunction ID✓

Request body

{
  "version": 1
}
FieldTypeDescriptionRequired
versionintegerNumber of the published version that goes live again, from versions✓

Response

data has the complete function, with the fields of Get a function. liveVersion is the version you went back to.

{
  "status": "success",
  "message": "Version 1 is live again",
  "data": {
    "id": "Hk2s9QmXc1",
    "name": "tax_id_lookup",
    "status": "enabled",
    "liveVersion": 1,
    "toolName": "fn_tax_id_lookup",
    "toolId": "Hk2s9QmXc1",
    "nextStep": "Live (version 1). Changes to source stay in the draft until you publish again."
  }
}

Some fields are left out of the example.

Errors

Statusdetails.codeWhen
400INVALID_REQUESTversion is missing or is not a positive integer. details.issues has the list of problems
403FORBIDDEN or INSUFFICIENT_SCOPEThe credential does not have write access to Integrations
404NOT_FOUNDThe function or the version does not exist

Notes

  • Going back to a version does not create a new version or deploy anything: it changes which one is live.
  • The next publication creates a new version from the draft.