> ## Documentation Index
> Fetch the complete documentation index at: https://docs.credibledata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Malloy notebook cells

> Retrieves a Malloy notebook with its raw cell contents (markdown and code).
Cell execution should be done separately via the execute-notebook-cell endpoint.




## OpenAPI

````yaml /dataplane-public-api-doc.yaml get /environments/{environmentName}/packages/{packageName}/notebooks/{path}
openapi: 3.1.0
info:
  title: Malloy Publisher - Semantic Model Serving API
  description: >
    The Malloy Publisher - Semantic Model Serving API provides comprehensive
    access to Malloy packages and their associated resources.

    A Malloy package is a directory containing Malloy models (.malloy files),
    Malloy notebooks (.malloynb files), and embedded databases

    (.parquet files) with a malloy-publisher.json manifest at the package's root
    directory.


    ## Key Features


    - **Environment Management**: Create and manage environments with their
    associated packages and connections

    - **Package Lifecycle**: Full CRUD operations for Malloy packages and their
    versions

    - **Model & Notebook Access**: Retrieve and execute Malloy models and
    notebooks

    - **Connection Management**: Secure database connection configuration and
    testing

    - **Query Execution**: Execute queries against models and retrieve results

    - **Watch Mode**: Real-time file watching for development workflows


    ## Resource Hierarchy


    The API follows a hierarchical resource structure:

    ```

    Environments

    ├── Connections

    └── Packages
        ├── Models
        ├── Notebooks
        └── Databases
    ```


    For examples, see the Malloy samples packages
    (https://github.com/malloydata/malloy-samples) repository.
  version: v0
servers:
  - url: https://{organization}.data.credibledata.com/api/v0/
    description: Production API server
    variables:
      organization:
        default: demo
        description: Your organization subdomain
security:
  - bearerAuth: []
tags:
  - name: publisher
    description: Publisher status and health check operations
  - name: environments
    description: >-
      Environment lifecycle management including creation, configuration, and
      deletion of data modeling environments
  - name: connections
    description: >-
      Database connection management for secure data source configuration and
      access
  - name: packages
    description: >-
      Package management for Malloy data models, including versioning and
      distribution
  - name: models
    description: Malloy model access and compilation operations
  - name: notebooks
    description: Malloy notebook access and execution operations
  - name: pages
    description: Static HTML pages (in-package data apps)
  - name: databases
    description: Embedded database management and access
  - name: watch-mode
    description: Real-time file watching for development workflows
  - name: materializations
    description: Package-level materializations for persisting Malloy sources
paths:
  /environments/{environmentName}/packages/{packageName}/notebooks/{path}:
    get:
      tags:
        - notebooks
      summary: Get Malloy notebook cells
      description: >
        Retrieves a Malloy notebook with its raw cell contents (markdown and
        code).

        Cell execution should be done separately via the execute-notebook-cell
        endpoint.
      operationId: get-notebook
      parameters:
        - name: environmentName
          in: path
          description: Name of the environment
          required: true
          schema:
            $ref: '#/components/schemas/IdentifierPattern'
        - name: packageName
          in: path
          required: true
          description: Name of the package
          schema:
            type: string
        - name: path
          in: path
          description: Path to notebook within the package.
          required: true
          schema:
            type: string
        - name: versionId
          in: query
          description: Version identifier for the package
          required: false
          schema:
            $ref: '#/components/schemas/VersionIdPattern'
      responses:
        '200':
          description: A Malloy notebook with raw cell contents.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RawNotebook'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '501':
          $ref: '#/components/responses/NotImplemented'
components:
  schemas:
    IdentifierPattern:
      type: string
      pattern: ^[a-zA-Z0-9_-]+$
      description: Standard identifier pattern for resource names
    VersionIdPattern:
      type: string
      pattern: ^[a-zA-Z0-9_.-]+$
      description: Version identifier pattern supporting dots and dashes
    RawNotebook:
      type: object
      description: Raw Malloy notebook with unexecuted cell contents
      properties:
        resource:
          type: string
          description: Resource path to the notebook
        packageName:
          type: string
          description: Name of the package containing this notebook
        path:
          type: string
          description: Relative path to the notebook file within its package directory
        malloyVersion:
          type: string
          description: Version of the Malloy compiler used to generate the notebook data
        notebookCells:
          type: array
          description: Array of notebook cells containing raw markdown and code content
          items:
            $ref: '#/components/schemas/NotebookCell'
        annotations:
          type: array
          description: Array of file-level (##) annotations attached to the notebook
          items:
            type: string
        sources:
          type: array
          description: Sources defined in the notebook's model
          items:
            $ref: '#/components/schemas/Source'
    NotebookCell:
      type: object
      description: Individual cell within a Malloy notebook
      properties:
        type:
          type: string
          enum:
            - markdown
            - code
          description: Type of notebook cell
        text:
          type: string
          description: Text contents of the notebook cell (either markdown or Malloy code)
        newSources:
          type: array
          description: >-
            Array of JSON strings containing SourceInfo objects made available
            in this cell
          items:
            type: string
        queryInfo:
          type: string
          description: >-
            JSON string containing QueryInfo object for the query in this cell
            (if the cell contains a query)
    Source:
      type: object
      description: A Malloy source defined in a model
      properties:
        name:
          type: string
          description: Name of the source
        annotations:
          type: array
          description: Annotations attached to the source
          items:
            type: string
        views:
          type: array
          description: Views defined in this source
          items:
            $ref: '#/components/schemas/View'
        filters:
          type: array
          description: Filters declared on this source via
          items:
            $ref: '#/components/schemas/Filter'
        givens:
          type: array
          description: >-
            Model-level givens (runtime parameters) available to queries on this
            source. Identical to `CompiledModel.givens`; repeated here for SDK
            ergonomics so consumers iterating sources can render inputs without
            a second lookup.
          items:
            $ref: '#/components/schemas/Given'
        authorize:
          type: array
          description: >-
            Effective authorize expressions declared on this source via
            `#(authorize)` / `##(authorize)` annotations — file-level
            expressions first, then the source's own. Each is a Malloy boolean
            expression over declared givens, evaluated as a disjunction (OR) and
            enforced at query time. A request that reads this source is denied
            with HTTP 403 unless at least one expression evaluates true for the
            supplied givens; an empty or absent list means unrestricted. Givens
            are caller-asserted, so this is a boundary only behind a trusted
            tier — see docs/authorize.md.
          items:
            type: string
    Error:
      type: object
      description: Standard error response format
      properties:
        message:
          type: string
          description: Human-readable error message describing what went wrong
        details:
          type: string
          description: Additional error details or context
      required:
        - message
    View:
      type: object
      description: Named model view definition
      properties:
        name:
          type: string
          description: Name of the view
        annotations:
          type: array
          description: Annotations attached to the view
          items:
            type: string
    Filter:
      type: object
      deprecated: true
      description: >
        **DEPRECATED**: Use the `Given` schema (native Malloy runtime
        parameters)

        instead. See docs/givens.md for migration recipes.


        A filter declared via #(filter) annotation on a Malloy source.
      properties:
        name:
          type: string
          description: Display name of the filter
        dimension:
          type: string
          description: Dimension this filter targets
        type:
          type: string
          description: Comparator type
          enum:
            - equal
            - in
            - like
            - greater_than
            - less_than
        implicit:
          type: boolean
          description: Whether this filter is hidden from users
        required:
          type: boolean
          description: Whether a value must be provided
        dimensionType:
          type: string
          description: >-
            Malloy data type of the dimension (e.g. string, number, boolean,
            date, timestamp)
    Given:
      type: object
      description: >-
        A given (runtime parameter) declared on a Malloy model via the `given:`
        keyword. Surfaced on `CompiledModel.givens` and `Source.givens` so
        callers can introspect what runtime values a model accepts.
      properties:
        name:
          type: string
          description: Name as declared in the model
        type:
          type: string
          description: >-
            Rendered Malloy type for the given (e.g. string, number, boolean,
            date, timestamp, filter<string>)
        annotations:
          type: array
          description: Annotations attached to the given declaration
          items:
            type: string
        default:
          type: string
          description: >-
            The given's default value as a Malloy source literal (e.g. `'WN'`,
            `2003`, `@2024-01-01`, `f'WN'`), exactly as written in the model.
            Omitted when the given declares no default. Consumers render or
            prefill it per the given's `type` (e.g. unquote a string literal for
            a text input).
  responses:
    Unauthorized:
      description: Unauthorized - authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The specified resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: The server encountered an internal error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotImplemented:
      description: The requested operation is not implemented
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````