---
title: "POST /api/kernel/set_model_value"
method: POST
path: "/api/kernel/set_model_value"
---

# POST /api/kernel/set_model_value

`POST /api/kernel/set_model_value`

## Headers

- `Marimo-Session-Id` string, required

## Request body

- ModelRequest
  - `buffers` Base64String[], required
  - `message` union, required
    - ModelUpdateMessage — Widget model state update message. Attributes: state: Model state updates. buffer_paths: Paths within state dict pointing to binary buffers.
      - `bufferPaths` array[], required
        - union[]
          - union
            - string
            - integer
      - `method` 'update', required
      - `state` object, required
    - ModelCustomMessage — Custom widget message. Attributes: content: Arbitrary content for the custom message.
      - `content` unknown, required
      - `method` 'custom', required
  - `modelId` string, widget-model-id, required
  - `token` string

## Response `200`

Set model value

- SuccessResponse
  - `success` boolean

## Changes

> 60 revisions in range; 3 could not be searched.

- **2026-03-31** `41bba414df27` — 2 breaking
  - the `buffers/items/` request property type/format changed from `string`/`` to `string`/`base64`
  - the `modelId` request property type/format changed from `string`/`` to `string`/`widget-model-id`
- **2026-03-18** `f29fa637d35b` — 2 info
  - the `buffers/items/` request property type/format was generalized from `string`/`base64` to `string`/``
  - the `modelId` request property type/format was generalized from `string`/`widget-model-id` to `string`/``

[Change history](https://skmtc.dev/marimo-team/apis/marimo-api/changes/api/kernel/set_model_value/post.md)

---

[API](https://skmtc.dev/marimo-team/apis/marimo-api.md) · [All operations](https://skmtc.dev/marimo-team/apis/marimo-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/marimo-team/marimo-api/revisions/a39082aac3ce/schema)
