> ## Documentation Index
> Fetch the complete documentation index at: https://developers.reintersect.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Replace block state

> Replace the whole state of one of your blocks and re-render it.

> Reintersect apps are in developer preview. Names and limits can still change before general
> release.

Replaces the block's state with `state`, which must be a complete, valid state. Otherwise it works
like [Update a block](/api-reference/blocks/update).

Authenticate with an install token that has `blocks:write`, or with the interaction token for this
block.

## Body

| Field | Type | Required | Description |
| - | - | - | - |
| `state` | `object` | Yes | The whole new state. |
| `expectedVersion` | `number` | No | Only replace if the block is at this version. |

## Response

The updated block.

## Errors

| `_tag` | Status | Cause |
| - | - | - |
| `ReintersectAppScopeMissingError` | 403 | An install token without `blocks:write`. |
| `ReintersectAppBlockNotFoundError` | 404 | No block with this id belongs to your install. |
| `ReintersectAppBlockStateInvalidError` | 422 | The resulting state doesn't match the state schema; `issues` lists why. |
| `ReintersectAppBlockVersionConflictError` | 409 | `expectedVersion` isn't the current version; `currentVersion` says what is. |
| `ReintersectAppBlockFinalError` | 409 | The block is final. |
| `ReintersectAppResponseInvalidError` | 502 | Re-rendering with the new state failed in your app. |

With the SDK, call `reintersect.blocks.replace(TaskBlock, blockId, { state, expectedVersion })`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.