---
title: "Create a Notebook Block"
url: https://docs.sentry.io/api/notebooks/create-a-notebook-block/
---

# Create a Notebook Block | Sentry Docs

ExperimentalThis API is under active development and may change.

POST /api/0/organizations/{organization\_id\_or\_slug}/notebooks/{notebook\_id}/blocks/

Append a text or query block to an active investigation, using notebookVersion for concurrency. A producer sends key and revision instead to write its text block: the same key updates the block, overwriting user edits and bringing back a deleted block, and a block with a newer revision returns 409. A bound workflow sends workflowRunId, its registered writerRunId, a key, and consecutive revisions starting at 1. It can write text or a block widget with its original query or evidence reference. Replaying an identical workflow write returns the saved block. Changing a removed workflow block requires a new key. Returns 201 with the new block, or 200 when a producer's write updates one; fetch investigation details for the updated notebook version. Requires a user or service account; key and revision require a service account or Seer agent token. Requires the organizations:investigations feature and open organization membership.

### Path Parameters

* `organization_id_or_slug` *(string)*

  REQUIRED

  The ID or slug of the organization the resource belongs to.

* `notebook_id` *(string)*

  REQUIRED

  The ID of an investigation in this organization.

### Body Parameters

* `kind` *(string)*

  REQUIRED

  Use text for Markdown, query for an executable query, or embed for a widget from a bound workflow.

  * `text` - Text
  * `query` - Query
  * `embed` - Code Mode embed

* `notebookVersion` *(integer)*

  Current notebook version from the latest detail response. Stale versions return 409. Send this, or key and revision.

* `workflowRunId` *(string)*

  Workflow bound to this notebook.

* `writerRunId` *(integer)*

  Registered Seer writer attempt, required for workflow writes.

* `blockVersion` *(integer)*

  Saved block version before changing workflow content.

* `embed` *(object)*

  A block widget's name and body.

* `embedSource` *(string)*

  Original query or source reference for the widget.

* `key` *(string)*

  The producer's stable key for the block. Writing the same key again updates the block, even if a user edited or deleted it. Send with revision instead of notebookVersion. Only service accounts and Seer agents can send it.

* `revision` *(integer)*

  The producer's revision for the block. A block with a newer revision returns 409, and a write can raise it by at most 100.

* `position` *(integer)*

  Index among the notebook's blocks where a producer's block goes. Later blocks shift down, and a larger index puts it last. A new block goes last when omitted, and an existing block stays put.

* `title` *(string)*

  Block title. May be empty.

* `content` *(string)*

  Markdown content. May be empty, except in a producer's block.

* `generationPrompt` *(string)*

  Instructions used when executing the block. May be empty.

* `config` *(object)*

  Block configuration object. Nested keys are preserved.

* `display` *(object)*

  Display settings. Text uses type markdown; query uses table, line, bar, or area. Versioned settings use version 1. Charts require xAxis and non-empty yAxes. Defaults to Markdown for text and table for query.

### Scopes

You need to [authenticate via bearer auth token.](https://docs.sentry.io/api/auth.md)

`<auth_token>` requires one of the following scopes:

* `org:admin`
* `org:read`
* `org:write`

```
curl https://sentry.io/api/0/organizations/{organization_id_or_slug}/notebooks/{notebook_id}/blocks/ \
 -H 'Authorization: Bearer <auth_token>' \
 -H 'Content-Type: application/json' \
 -d '{}'
```

RESPONSESCHEMA

```
Copied
{
  "id": "12",
  "position": 0,
  "kind": "text",
  "title": "Summary",
  "content": "Checkout latency rose after the 2.4.0 release.",
  "generationPrompt": "",
  "generatedContent": "Checkout latency rose after the 2.4.0 release.",
  "output": {
    "schemaVersion": 1,
    "markdown": "Checkout latency rose after the 2.4.0 release."
  },
  "outputStatus": "available",
  "currentExecution": {
    "id": "40",
    "status": "completed",
    "executor": "code_mode",
    "schemaVersion": 1,
    "startedAt": "2026-11-10T18:00:00.000000Z",
    "completedAt": "2026-11-10T18:00:00.000000Z",
    "error": null
  },
  "config": {},
  "display": {
    "type": "markdown"
  },
  "dependencies": [],
  "parameterKeys": [],
  "version": 1,
  "staleAt": null,
  "createdBy": null,
  "lastEditedBy": null,
  "producerKey": "summary",
  "workflowRunId": null,
  "producerRevision": 1,
  "embed": null,
  "embedSource": null,
  "embedSummary": null
}
```

---

Find other pages: [Sitemap](https://docs.sentry.io/sitemap.md) lists every page with a one-line summary, and [llms.txt](https://docs.sentry.io/llms.txt) gives an overview with guidance for agents.
