Restaurar una version
Versions
POST /v1/blocks/{id}/versions/{versionId}/restore
Restore an old version by appending it as a new current version. Nothing is overwritten.
POST
Restaurar una version
Brings back an earlier version of a block’s content.
It does this by copying that version into a new one at the top of the history and pointing the block at it. Nothing is rewound and nothing is lost: after restoring version 2 onto a block at version 5, the block is at version 6 and versions 1 through 5 are still there.
Endpoint
Required scope
assistants:write
Headers
Path parameters
No body.
Example request
Response
201 Created
The newly created version, in the same shape asGET /v1/blocks/{id}/content. Note the version_number is the new one, and the content is the restored one.
401 Unauthorized
Missing, invalid, revoked, or expired token.403 Forbidden
The token does not have theassistants:write scope.
404 Not Found
The block does not exist in the token’s company and project, orerror.code is BLOCK_VERSION_NOT_FOUND because the version does not exist or belongs to a different block.
409 Conflict
error.code is BLOCK_TYPE_NOT_WRITABLE. The block is one of the five catalogue types, which the portal owns.
502 Bad Gateway
The assistant service is unreachable.Operational notes
- Restoring is a write, so it needs
assistants:writeand is subject to the same type restriction as saving content: the five catalogue types refuse it. - Restoring is not idempotent. Calling it twice appends two identical versions. Harmless, but the history grows.
- Assistants pinned to another version are unaffected. Restoring moves the block’s current version; a pinned assistant keeps rendering what it was pinned to.
- Restoring is reversible by restoring again. The version you just moved away from is still in the history with its own id.
- Check before you restore. Read the version first — the history list deliberately carries no content, so
version_numberalone tells you nothing about what you are bringing back.