Roll back a publication

SDK platic.agents.rollback()

Return to an earlier version if the one you published does not work as expected. Send the versionId of a version that was already published. Your draft and work in progress are preserved.

Example

await platic.agents.rollback("agent_123", { versionId: "v3" });

Path parameters

ParameterTypeDescriptionRequired
agentIdstringAgent id✓

Request body

FieldTypeDescriptionRequired
versionIdstringA version that was already published, for example v3. You find it in the publication history✓
notestringPublication note, up to 500 characters-
{
  "versionId": "v3",
  "note": "Go back to the previous version"
}

Response

The fields are those from Get the publication, with last.action: "rollback":

{
  "status": "success",
  "data": {
    "agentId": "Xq8mTe2LwP4kZ1aB9cDf",
    "publication": { "versionId": "v3", "number": 3 },
    "last": {
      "publicationId": "p4",
      "action": "rollback",
      "versionId": "v3",
      "previousVersionId": "v5",
      "createdAt": "2026-10-28T12:40:00.000Z",
      "createdBy": { "kind": "api_key", "keyId": "k3yId" },
      "source": "api",
      "via": null,
      "note": "Go back to the previous version"
    }
  }
}

Errors

Statusdetails.codeWhen
403FORBIDDENThe credential can't edit this agent
404AGENT_NOT_FOUNDThe agent doesn't exist in the workspace or was deleted
404VERSION_NOT_FOUNDversionId doesn't exist on that agent
409NOT_PREVIOUSLY_PUBLISHEDThat version was never published. Use Publish a version
409CONFLICTSomeone else changed this at the same time. Try again
422INVALID_SUBAGENT_LINKThat version links a subagent that was already deleted. It isn't published
{
  "code": 409,
  "error": "Conflict - The resource state conflicts with this request",
  "details": {
    "code": "NOT_PREVIOUSLY_PUBLISHED",
    "message": "Version v4 was never published; use publish instead"
  }
}

Notes

  • The rollback stays in the publication history as one more entry, with action: "rollback".
  • To bring an old version into the draft and keep editing it, without touching production, use Restore a version.