Sessions

Execute arbitrary code in a session kernel (debug)

Runs arbitrary code inside the notebook's kernel within an interactive session and returns the raw outputs (without creating a snapshot). User-code exceptions are returned as error outputs inside the response body and still produce HTTP 200. Only the session creator may execute code, and doing so requires edit access to the project, the same as editing blocks.

post/sessions/{sessionId}/execute

Request

  • Base URL
    https://api.deepnote.com/v2
  • URL
    https://api.deepnote.com/v2/sessions/{sessionId}/execute
  • Auth
    HTTP bearer

Path parameters

sessionIdstring uuid required

Session identifier.

Request body

notebookIdstring required

Source notebook to execute against in the session. Use the session's source notebook ID (session.notebookId), not sessionNotebookId.

codestring required

Source code to execute in the session sandbox.

timeoutMsinteger

Maximum execution time in milliseconds. Must be a positive integer no greater than 120000. Values outside this range are rejected with 400; the server does not clamp. Defaults to 10000 when omitted.

Response

Outputs produced by the synchronous execution.

Changes

No recorded changes to this operation across all 29 revisions of this API.