Skip to main content
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 as GET /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 the assistants:write scope.

404 Not Found

The block does not exist in the token’s company and project, or error.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:write and 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_number alone tells you nothing about what you are bringing back.

Authorizations

Authorization
string
header
required

Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.

Path Parameters

id
string
required
versionId
string
required

Response

201 - application/json
content
object
required