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
curl https://api.platic.ai/v1/agents/$AGENT_ID/draft/restore \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "versionId": "v3" }' await platic.agents.draft.restore("agent_123", { versionId: "v3" }); Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
agentId | string | Agent id | ✓ |
Request body
| Field | Type | Description | Required |
|---|---|---|---|
versionId | string | Version to restore, for example v3 | ✓ |
note | string | Note 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
| Status | details.code | When |
|---|---|---|
403 | FORBIDDEN | The credential can't edit this agent |
404 | AGENT_NOT_FOUND | The agent doesn't exist in the workspace or was deleted |
404 | VERSION_NOT_FOUND | versionId doesn't exist on that agent |
409 | CONFLICT | Someone else changed this at the same time. Try again |
422 | INVALID_SUBAGENT_LINK | The version links a subagent that was already deleted and that the current draft doesn't have |
422 | INVALID_CONFIG | The version includes a model that Platica no longer knows and that the current draft doesn't have |
422 | UNSUPPORTED_REASONING_EFFORT | The 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 |
422 | MODEL_FALLBACKS_REQUIRE_OWN_KEY | The 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: falsewithout 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.