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
curl -X POST "https://api.platic.ai/v1/tools/functions/$FUNCTION_ID/rollback" \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"version": 1
}' await platic.tools.functions.rollback("fn_123", 1); Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
functionId | string | Function ID | ✓ |
Request body
{
"version": 1
} | Field | Type | Description | Required |
|---|---|---|---|
version | integer | Number 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
| Status | details.code | When |
|---|---|---|
400 | INVALID_REQUEST | version is missing or is not a positive integer. details.issues has the list of problems |
403 | FORBIDDEN or INSUFFICIENT_SCOPE | The credential does not have write access to Integrations |
404 | NOT_FOUND | The 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.