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

---

[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)
