Deepnote Runs API

Notebook executions.

OpenAPI Specification

deepnote-runs-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Deepnote Public Execute (v1) Execute (v1) Runs API
  description: Deepnote Public API v2 (preview) for running notebooks programmatically and managing projects, notebooks, and execution runs. Notebooks can be executed via POST /runs and their status polled via GET /runs/{runId}. Endpoints and schemas may change while the API is in preview. A legacy v1 execute endpoint is also documented for triggering a notebook's machine.
  termsOfService: https://deepnote.com/terms
  contact:
    name: Deepnote Support
    url: https://deepnote.com/docs
  version: '2.0'
servers:
- url: https://api.deepnote.com/v2
  description: Deepnote Public API v2 (preview)
- url: https://api.deepnote.com/v1
  description: Deepnote API v1 (legacy notebook execution trigger)
security:
- bearerAuth: []
tags:
- name: Runs
  description: Notebook executions.
paths:
  /runs:
    post:
      operationId: createRun
      tags:
      - Runs
      summary: Run a notebook
      description: Starts an execution run for a notebook. Optionally run the notebook as a detached run, execute only specific blocks, include dependent downstream blocks, and pass input values for input blocks.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRunRequest'
      responses:
        '202':
          description: Run started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunStarted'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
  /runs/{runId}:
    get:
      operationId: getRun
      tags:
      - Runs
      summary: Get a run
      description: Returns execution details for a run, including its status and results.
      parameters:
      - name: runId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: snapshotDelivery
        in: query
        required: false
        schema:
          type: string
          enum:
          - inline
          - downloadUrl
        description: How notebook execution snapshots are delivered.
      responses:
        '200':
          description: Run details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunEnvelope'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    Run:
      type: object
      properties:
        runId:
          type: string
          format: uuid
        notebookId:
          type: string
        status:
          $ref: '#/components/schemas/RunStatus'
        createdAt:
          type: string
          format: date-time
        finishedAt:
          type: string
          format: date-time
    RunStatus:
      type: string
      enum:
      - pending
      - running
      - success
      - error
      - internal_error
      - stopped
    CreateRunRequest:
      type: object
      required:
      - notebookId
      properties:
        notebookId:
          type: string
          description: ID of the notebook to run.
        detached:
          type: boolean
          description: Execute as a detached run.
        detachedRunStorageMode:
          type: string
          enum:
          - read_write
          - readonly
        blockIds:
          type: array
          items:
            type: string
          description: Specific blocks to execute.
        runDependentBlocks:
          type: boolean
          description: Include dependent downstream blocks.
        inputs:
          type: object
          additionalProperties: true
          description: Input values for input blocks.
    Error:
      type: object
      properties:
        message:
          type: string
    RunStarted:
      type: object
      properties:
        runId:
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/RunStatus'
        createdAt:
          type: string
          format: date-time
    RunEnvelope:
      type: object
      properties:
        run:
          $ref: '#/components/schemas/Run'
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Too many requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Workspace API key created under Settings & members > Security > API keys, sent as Authorization: Bearer <token>.'