> ## 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.

# Update blocks by state

> Merge state into every block of one type whose state matches.

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

Shallow-merges `state` into every block of `type` created by your install whose state matches
`stateMatch`, and re-renders each. Final blocks are skipped.

Authenticate with an install token that has the `blocks:write` scope.

## Body

| Field | Type | Required | Description |
| - | - | - | - |
| `type` | `string` | Yes | The block type. |
| `stateMatch` | `object` | Yes | Up to 8 top-level state keys with scalar values. |
| `state` | `object` | Yes | Top-level keys to set on every match. |

## Response

| Field | Type | Description |
| - | - | - |
| `updatedCount` | `number` | How many blocks changed. |

## Errors

| `_tag` | Status | Cause |
| - | - | - |
| `ReintersectAppScopeMissingError` | 403 | The install lacks `blocks:write`. |
| `ReintersectAppBlockTypeUnknownError` | 422 | The installed version has no block of this type. |
| `ReintersectAppBlockStateInvalidError` | 422 | The merged state would be invalid. |

With the SDK, call `reintersect.blocks.updateWhere(TaskBlock, { stateMatch: { status: "doing" }, state: { status: "done" } })`.


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