Restore a version

SDK platic.agents.draft.restore()

Restore a previous configuration so you can continue editing it in the draft. Send its versionId. This creates a new version, preserves the history and does not change the publication.

Example

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

Path parameters

ParameterTypeDescriptionRequired
agentIdstringAgent id✓

Request body

FieldTypeDescriptionRequired
versionIdstringVersion to restore, for example v3✓
notestringNote for the new version, up to 500 characters-
{
  "versionId": "v3",
  "note": "Go back to last week's instructions"
}

Response

The fields are those from Update the draft. restoredFromVersionId identifies the source version:

{
  "status": "success",
  "data": {
    "changed": true,
    "draft": { "versionId": "v6", "number": 6 },
    "version": {
      "versionId": "v6",
      "number": 6,
      "basedOnVersionId": "v5",
      "restoredFromVersionId": "v3",
      "copiedFrom": null,
      "createdAt": "2026-10-28T12:15:00.000Z",
      "createdBy": { "kind": "api_key", "keyId": "k3yId" },
      "source": "api",
      "via": null,
      "note": "Go back to last week's instructions"
    }
  }
}

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
409CONFLICTSomeone else changed this at the same time. Try again
422INVALID_SUBAGENT_LINKThe version links a subagent that was already deleted and that the current draft doesn't have
422INVALID_CONFIGThe version includes a model that Platica no longer knows and that the current draft doesn't have
422UNSUPPORTED_REASONING_EFFORTThe version includes a model with a reasoning level it doesn't accept and that the current draft doesn't have. details.supportedEfforts lists the supported values
422MODEL_FALLBACKS_REQUIRE_OWN_KEYThe version includes a fallback the current draft no longer has and the workspace has no own key connected. See fallback models

Notes

  • If the version is the same as the draft, it answers changed: false without creating a version.
  • Restoring doesn't publish. To put the restored version into production, publish it.
  • To put a version that was already published back into production, without going through the draft, use Roll back.