---
title: Get a notebook section
description: Get one section by its stable ID.
breadcrumbs: Docs > API > Get a notebook section
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Get a notebook section

## v2 (latest)

{% alert level="warning" %}
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help.md).
{% /alert %}

| Datadog site      | API endpoint                                                                           |
| ----------------- | -------------------------------------------------------------------------------------- |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/notebooks/{notebook_id}/sections/{section_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/notebooks/{notebook_id}/sections/{section_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/notebooks/{notebook_id}/sections/{section_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/notebooks/{notebook_id}/sections/{section_id}      |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/notebooks/{notebook_id}/sections/{section_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/notebooks/{notebook_id}/sections/{section_id} |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/notebooks/{notebook_id}/sections/{section_id} |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/notebooks/{notebook_id}/sections/{section_id}      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/notebooks/{notebook_id}/sections/{section_id}  |

### Overview

Get one section by its stable ID. A section includes its heading and descendants up to the next
heading at the same or a higher level.

Responses negotiate JSON or Markdown independently of the request Content-Type. Resource requests
accept application/json or application/vnd.api+json; JSON responses and all errors use
application/vnd.api+json.

This endpoint requires the `notebooks_read` permission.

### Arguments

#### Path Parameters

| Field                    | Type    | Description                                          |
| ------------------------ | ------- | ---------------------------------------------------- |
| notebook_id [*required*] | integer | Unique notebook ID.                                  |
| section_id [*required*]  | string  | Stable section ID returned by the sections endpoint. |

#### Query Strings

| Field                     | Type   | Description                                                                                                                                                                                                                                   |
| ------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| fields[notebook_sections] | string | Comma-separated section fields: heading, level, path, position, markdown, document_revision, notebook. Applies to JSON responses. Collections and included sections omit markdown by default; individual section reads include it by default. |

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
Response containing a section.

| Parent field      | Field                   | Type     | Description                                                                                                                                                                                                                                                               |
| ----------------- | ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                   | data [*required*]       | object   | A notebook section resource.                                                                                                                                                                                                                                              |
| data              | attributes [*required*] | object   | Section attributes. Collections and included sections omit markdown unless explicitly requested. Sparse field selections can omit any attribute.                                                                                                                          |
| attributes        | document_revision       | uuid     | Opaque document revision UUID. Send the most recently observed value when updating the notebook.                                                                                                                                                                          |
| attributes        | heading                 | string   | Heading text.                                                                                                                                                                                                                                                             |
| attributes        | level                   | int64    | Heading level.                                                                                                                                                                                                                                                            |
| attributes        | markdown                | string   | Markdown for the section, including its heading and nested sections.                                                                                                                                                                                                      |
| attributes        | path                    | [string] | Notebook title (when nonempty), followed by ancestor headings and this section's heading.                                                                                                                                                                                 |
| attributes        | position                | int64    | Ordering value within the document. Compare positions only within the same document revision; values can have gaps and change after edits.                                                                                                                                |
| data              | id [*required*]         | string   | Stable section ID.                                                                                                                                                                                                                                                        |
| data              | links [*required*]      | object   | Links for a notebook resource.                                                                                                                                                                                                                                            |
| links             | self [*required*]       | string   | API URL for the notebook.                                                                                                                                                                                                                                                 |
| data              | relationships           | object   | Relationships for a section. Omitted when excluded by a sparse field selection.                                                                                                                                                                                           |
| relationships     | notebook                | object   | Relationship to the containing notebook.                                                                                                                                                                                                                                  |
| notebook          | data [*required*]       | object   | Stable notebook resource identity.                                                                                                                                                                                                                                        |
| data              | id [*required*]         | string   | Notebook ID.                                                                                                                                                                                                                                                              |
| data              | type [*required*]       | enum     | Notebooks resource type. Allowed enum values: `notebooks`. Default: `notebooks`.                                                                                                                                                                                          |
| notebook          | links [*required*]      | object   | Links to a related resource.                                                                                                                                                                                                                                              |
| links             | related [*required*]    | string   | Related API URL.                                                                                                                                                                                                                                                          |
| data              | type [*required*]       | enum     | Notebook section resource type. Allowed enum values: `notebook_sections`.                                                                                                                                                                                                 |
|                   | meta                    | object   | Response metadata. Warnings can appear on reads as well as writes and are omitted when no invalid widgets are present.                                                                                                                                                    |
| meta              | warnings                | [object] | Diagnostics describing persisted widget placeholders.                                                                                                                                                                                                                     |
| warnings          | code [*required*]       | string   | Warning code.                                                                                                                                                                                                                                                             |
| warnings          | location                | object   | Location of a diagnostic in its documented representation.                                                                                                                                                                                                                |
| location          | pointer [*required*]    | string   | JSON Pointer to the affected field.                                                                                                                                                                                                                                       |
| warnings          | message [*required*]    | string   | Warning description.                                                                                                                                                                                                                                                      |
| warnings          | meta                    | object   | Context for a widget diagnostic inside Markdown.                                                                                                                                                                                                                          |
| meta              | definition              | object   | Notebook widget definition. The type selects the widget-specific schema; title is stored here. Supports notebook widgets, including analysis widgets and invalid_widget placeholders. Markdown and rich-text definitions cannot be submitted through the widget endpoint. |
| definition        | original_definition     | object   | Original definition preserved by an invalid_widget placeholder.                                                                                                                                                                                                           |
| definition        | title                   | string   | Optional widget title. Omit it from a replacement definition to clear the title.                                                                                                                                                                                          |
| definition        | type [*required*]       | string   | Notebook widget type.                                                                                                                                                                                                                                                     |
| definition        | validation_errors       | [object] | Nonempty diagnostics required for an invalid_widget placeholder.                                                                                                                                                                                                          |
| validation_errors | code [*required*]       | string   | Machine-readable diagnostic code.                                                                                                                                                                                                                                         |
| validation_errors | location [*required*]   | object   | Location of a diagnostic in its documented representation.                                                                                                                                                                                                                |
| location          | pointer [*required*]    | string   | JSON Pointer to the affected field.                                                                                                                                                                                                                                       |
| validation_errors | message [*required*]    | string   | Description of the validation failure.                                                                                                                                                                                                                                    |
| meta              | validation_errors       | [object] | Diagnostics relative to the unwrapped widget attributes.                                                                                                                                                                                                                  |
| validation_errors | code [*required*]       | string   | Machine-readable diagnostic code.                                                                                                                                                                                                                                         |
| validation_errors | location [*required*]   | object   | Location of a diagnostic in its documented representation.                                                                                                                                                                                                                |
| location          | pointer [*required*]    | string   | JSON Pointer to the affected field.                                                                                                                                                                                                                                       |
| validation_errors | message [*required*]    | string   | Description of the validation failure.                                                                                                                                                                                                                                    |
| meta              | widget_id               | string   | ID of the affected widget.                                                                                                                                                                                                                                                |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "document_revision": "123e4567-e89b-12d3-a456-426614174456",
      "heading": "Setup",
      "level": 2,
      "markdown": "## Setup\n\nInstall dependencies.",
      "path": [
        "Service Debugging Notes",
        "Setup"
      ],
      "position": 0
    },
    "id": "k7m2q9x4",
    "links": {
      "self": "/api/v2/notebooks/123"
    },
    "relationships": {
      "notebook": {
        "data": {
          "id": "123",
          "type": "notebooks"
        },
        "links": {
          "related": "/api/v2/notebooks/123/sections"
        }
      }
    },
    "type": "notebook_sections"
  },
  "meta": {
    "warnings": [
      {
        "code": "invalid_widget",
        "location": {
          "pointer": "/data/attributes/definition/requests"
        },
        "message": "The widget definition is invalid.",
        "meta": {
          "definition": {
            "original_definition": {},
            "title": "CPU usage",
            "type": "timeseries",
            "validation_errors": [
              {
                "code": "invalid_widget",
                "location": {
                  "pointer": "/data/attributes/definition/requests"
                },
                "message": "The requests field must be an array."
              }
            ]
          },
          "validation_errors": [
            {
              "code": "invalid_widget",
              "location": {
                "pointer": "/data/attributes/definition/requests"
              },
              "message": "The requests field must be an array."
            }
          ],
          "widget_id": "w9c4h7b5"
        }
      }
    ]
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Forbidden

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="404" %}
Not Found

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="406" %}
Not Acceptable

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="409" %}
Conflict: an exact match count did not match, a requested scope disappeared, concurrent changes
prevented a guarded write, or the notebook uses unsupported legacy storage.

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="422" %}
Invalid notebook attributes, unsupported or mismatched scope, invalid Markdown, or invalid widget
definition.

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Path parameters
export notebook_id="123"
export section_id="k7m2q9x4"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/notebooks/${notebook_id}/sections/${section_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
```
{% /tab %}
{% /tabs %}
