---
title: "appends a code line to the notebook"
method: POST
path: "/api/notebook/appendCodeLine"
---

# appends a code line to the notebook

`POST /api/notebook/appendCodeLine`

appends a code line to the notebook

## Query parameters

- `notebookId` string, required

## Request body

- object
  - `variableName` string, required — the name of the variable to create. Should be unique and have no spaces or weird characters.
  - `codeExpression` string, required — decipad language code expression for this variable

## Response `200`

Ok

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

## Changes

> 8 revisions in range; 1 could not be searched.

- **2023-11-27** `c2d57e621a13` — 4 breaking, 2 info
  - the request property `codeExpression` became required
  - the request property `variableName` became required
  - the `codeExpression` request property type/format changed from ``/`` to `string`/``
  - the `variableName` request property type/format changed from ``/`` to `string`/``
  - …2 more
- **2023-11-20** `ee7eb73634d2` — 2 breaking, 1 warning, 2 info
  - the `codeExpression` request property type/format changed from `string`/`` to ``/``
  - the `variableName` request property type/format changed from `string`/`` to ``/``
  - removed the optional property `result` from the response with the `200` status
  - the request property `codeExpression` became optional
  - …1 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/appendCodeLine/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)
