---
title: "changes an existing code line in the notebook"
method: POST
path: "/api/notebook/updateCodeLine"
---

# changes an existing code line in the notebook

`POST /api/notebook/updateCodeLine`

changes an existing code line in the notebook

## Query parameters

- `notebookId` string, required

## Request body

- object
  - `codeLineId` string, required — the id of the code line you need to change
  - `newVariableName` string, required — the new variable name if it needs changing, or the current one.
  - `newCodeExpression` string, required — the new decipad language code expression for this variable

## Response `200`

Ok

- object
  - `result` unknown
  - `notebookErrors` unknown[]
    - unknown

## Changes

- **2023-11-27** `c2d57e621a13` — 6 breaking, 2 info
  - the request property `codeLineId` became required
  - the request property `newCodeExpression` became required
  - the request property `newVariableName` became required
  - the `codeLineId` request property type/format changed from ``/`` to `string`/``
  - …4 more
- **2023-11-20** `ee7eb73634d2` — 3 breaking, 1 warning, 3 info
  - the `codeLineId` request property type/format changed from `string`/`` to ``/``
  - the `newCodeExpression` request property type/format changed from `string`/`` to ``/``
  - the `newVariableName` request property type/format changed from `string`/`` to ``/``
  - removed the optional property `result` from the response with the `200` status
  - …3 more
- **2023-11-19** `35c27bb79744` — 3 warning, 2 info
  - removed the optional property `createdElementId` from the response with the `200` status
  - removed the optional property `createdElementName` from the response with the `200` status
  - removed the optional property `createdElementType` from the response with the `200` status
  - added the optional property `notebookErrors` to the response with the `200` status
  - …1 more
- **2023-11-08** `d0f9de8761ec` — 1 info
  - endpoint added
- **2023-10-27** `f8c8d4256dda` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/decipad/apis/create-and-modify-a-decipad-notebook/changes/api/notebook/updateCodeLine/post.md)

---

[API](https://skmtc.dev/decipad/apis/create-and-modify-a-decipad-notebook.md) · [All operations](https://skmtc.dev/decipad/apis/create-and-modify-a-decipad-notebook/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/decipad/create-and-modify-a-decipad-notebook/revisions/5f77d79b504f/schema)
