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
curl https://api.platic.ai/v1/agents/$AGENT_ID/publication/rollback \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "versionId": "v3" }' await platic.agents.rollback("agent_123", { versionId: "v3" }); Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
agentId | string | Agent id | ✓ |
Request body
| Field | Type | Description | Required |
|---|---|---|---|
versionId | string | A version that was already published, for example v3. You find it in the publication history | ✓ |
note | string | Publication 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
| 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 | NOT_PREVIOUSLY_PUBLISHED | That version was never published. Use Publish a version |
409 | CONFLICT | Someone else changed this at the same time. Try again |
422 | INVALID_SUBAGENT_LINK | That 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.