**Version: 202601**

# Update AI card

**PATCH** `/openapi/2026-01/themes/edit-sessions/:oseid/gen-blocks`

Update an AI card with new source code and its full settings. If the card is unused or used in only one place, it is changed in place (`branched=false`); if it is used in several places, a new card is created to carry this change (`branched=true`), and you need to replace the card at the target position with the returned `settings`.

## Request

**Path Parameters**

- `oseid` string (required)

  Edit session ID

**application/json**

**Body | Example**

**Body (required)**

- `content` string (required)

  New liquid source; must contain a schema tag
- `settings` object (required)

  The card's full config, same shape as the create response's `settings`. Its `type` (blocks/gen\_ prefixed) names the card to change; the field values are the merchant's current config

```json
{
  "content": "string",
  "settings": {}
}
```

## Responses

**200**

OK

**application/json**

**Schema | Example**

**Schema**

- `code` string

  error code
- `message` string

  error message
- `data` object

  - `revert_id` string

    Token to revert this update (see gen-blocks/revert)
  - `branched` boolean

    false = overwritten in place (ref count 0/1), instances untouched, nothing else to do; true = a new card was created to carry the change (ref count >= 2) — rewrite the target instance with the returned `settings`
  - `settings` object

    The card's full config after the change; on a branch its `type` is the new card's `card_type`

```json
{
  "code": "string",
  "message": "string",
  "data": {
    "revert_id": "string",
    "branched": true,
    "settings": {}
  }
}
```
