---
title: List notebook tasks
description: List the notebook tasks in document order.
breadcrumbs: Docs > API > List notebook tasks
---

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

# List notebook tasks

## 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}/tasks     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/notebooks/{notebook_id}/tasks |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/notebooks/{notebook_id}/tasks |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/notebooks/{notebook_id}/tasks      |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/notebooks/{notebook_id}/tasks |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/notebooks/{notebook_id}/tasks |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/notebooks/{notebook_id}/tasks |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/notebooks/{notebook_id}/tasks      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/notebooks/{notebook_id}/tasks  |

### Overview

List the notebook tasks in document order.

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

### Response

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

{% tabs %}
{% tab label="Model" %}
Response containing notebook tasks in document order.

| Parent field      | Field                          | Type     | Description                                                                                                                                                                                                                                                               |
| ----------------- | ------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                   | data [*required*]              | [object] | Notebook tasks.                                                                                                                                                                                                                                                           |
| data              | attributes [*required*]        | object   | Task attributes.                                                                                                                                                                                                                                                          |
| attributes        | checked [*required*]           | boolean  | Whether the task is completed.                                                                                                                                                                                                                                            |
| attributes        | document_revision [*required*] | uuid     | Opaque document revision UUID. Send the most recently observed value when updating the notebook.                                                                                                                                                                          |
| attributes        | position [*required*]          | int64    | Ordering value within the document. Compare positions only within the same document revision; values can have gaps and change after edits.                                                                                                                                |
| attributes        | text [*required*]              | string   | Plain text of the task, without inline formatting.                                                                                                                                                                                                                        |
| data              | id [*required*]                | string   | Stable task ID.                                                                                                                                                                                                                                                           |
| data              | links [*required*]             | object   | Links for a notebook resource.                                                                                                                                                                                                                                            |
| links             | self [*required*]              | string   | API URL for the notebook.                                                                                                                                                                                                                                                 |
| data              | relationships [*required*]     | object   | Notebook and optional section relationships.                                                                                                                                                                                                                              |
| relationships     | notebook [*required*]          | 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.                                                                                                                                                                                                                                                          |
| relationships     | section                        | object   | Relationship to the containing section, when one exists.                                                                                                                                                                                                                  |
| section           | data [*required*]              | object   | Stable section identity.                                                                                                                                                                                                                                                  |
| data              | id [*required*]                | string   | Stable section ID.                                                                                                                                                                                                                                                        |
| data              | type [*required*]              | enum     | Notebook section resource type. Allowed enum values: `notebook_sections`.                                                                                                                                                                                                 |
| section           | links [*required*]             | object   | Links to a related resource.                                                                                                                                                                                                                                              |
| links             | related [*required*]           | string   | Related API URL.                                                                                                                                                                                                                                                          |
| data              | type [*required*]              | enum     | Notebook task resource type. Allowed enum values: `notebook_tasks`.                                                                                                                                                                                                       |
|                   | 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": {
        "checked": false,
        "document_revision": "123e4567-e89b-12d3-a456-426614174456",
        "position": 7,
        "text": "Install dependencies"
      },
      "id": "p3v8n6r2",
      "links": {
        "self": "/api/v2/notebooks/123"
      },
      "relationships": {
        "notebook": {
          "data": {
            "id": "123",
            "type": "notebooks"
          },
          "links": {
            "related": "/api/v2/notebooks/123/sections"
          }
        },
        "section": {
          "data": {
            "id": "k7m2q9x4",
            "type": "notebook_sections"
          },
          "links": {
            "related": "/api/v2/notebooks/123/sections"
          }
        }
      },
      "type": "notebook_tasks"
    }
  ],
  "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"

# 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}/tasks" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
```
{% /tab %}
{% /tabs %}
