Skip to content

Tools

pastepile_restore

Put an earlier version of a memory back as the current one, without losing what was current before the restore.

1 min read · Updated

Restores a numbered version. What is current at the time of the restore is snapshotted as a new version first, so going back never destroys the present and the restore can itself be undone.

There is no state this tool can leave a memory in that cannot be reversed by another restore. That is the property that makes it safe to use when you are not certain, which is the only time anyone uses it.

Parameters

ParameterTypeDescription
slugstringrequiredThe memory slug or its full Pastepile URL.
versionintegerrequiredThe version number to restore, as listed by pastepile_timeline.

Example

Result
{
  "restored": true,
  "slug": "aB3xY9z",
  "restored_version": 7,
  "saved_as_version": 13,
  "note": "Version 7 is current again. What was current before the restore is preserved as version 13."
}

Behavior notes

  • saved_as_version is returned so the pre-restore state can be found again without going back to the list.
  • An end-to-end encrypted paste cannot be restored server side, because its plaintext never reaches Pastepile. The tool says so rather than failing obscurely.

Errors

ErrorCause
invalid_version (400)The version is missing or not a positive integer.
no_such_version (404)This memory has no version with that number.
not_found (404)No memory with that slug is writable with this key. Same answer whether it never existed or belongs to someone else.

Related documentation