Skip to main content
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 stringrequired

    Edit session ID

Bodyrequired

    contentstringrequired

    New liquid source; must contain a schema tag

    settingsobjectrequired

    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

Responses

OK

Schema
    codestring

    error code

    messagestring

    error message

    data object
    revert_idstring

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

    branchedboolean

    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

    settingsobject

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