/v1/resources/{resourceId}/revisions/{revisionId}/restoreWhen to use
Recover a previous definition without running or publishing it.
For agents
Read history, inspect the target, then pass the returned version token. On 409, read again and reassess. Operation dependencies must match the current graph; restore connections through graph commands first. Dashboard source takes effect immediately and restores its saved contract, not old data.
Example
import { PermuteClient } from '@permute/sdk';
const orgClient = new PermuteClient({
apiKey: process.env.PERMUTE_API_KEY!,
});
const client = orgClient.withWorkspace(process.env.PERMUTE_WORKSPACE_ID!);
const history = await client.revisions.list('oper_revenue123');
const result = await client.revisions.restore('oper_revenue123', 'rvsn_code123', { expectedVersion: history.version });Request body
{
"expectedVersion": "opaque-version-token"
}Response
{
"data": {
"resourceId": "oper_revenue123",
"version": "opaque-version-token",
"draft": {
"revisionId": "rvsn_code123",
"sequence": 1
},
"published": null,
"capabilities": {
"history": true,
"restore": true,
"publish": true
}
}
}