Notebooks
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
POST | |
GET | |
POST | |
DELETE | |
POST | |
GET | |
PATCH | |
DELETE | |
GET | |
POST | |
POST | |
POST | |
GET | |
POST | |
POST | |
GET | |
POST | |
POST |
List all notebooks
Also available via the PostHog MCP server:
notebooks-list— List notebooks
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
notebook:readQuery parameters
- containsstring
- created_bystring
- date_fromstring
- date_tostring
- limitinteger
- offsetinteger
- userstring
Response
Example request
GET /api/projects/:project_id/notebooks Example response
Status 200
Create notebooks
Also available via the PostHog MCP server:
notebooks-create— Create notebook
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
notebook:writeRequest parameters
- titlestringnull
- content
- text_contentstringnull
- versioninteger
- deletedboolean
- _create_in_folderstring
Response
Example request
POST /api/projects/:project_id/notebooks Example response
Status 201
List all notebooks sharing
Required API key scopes
sharing_configuration:readPath parameters
- notebook_idstring
Example request
GET /api/projects/:project_id/notebooks/:notebook_id/sharing Example response
Status 200
Create notebooks sharing passwords
Create a new password for the sharing configuration.
Required API key scopes
sharing_configuration:writePath parameters
- notebook_idstring
Request parameters
- enabledboolean
- settings
- password_requiredboolean
Response
Example request
POST /api/projects/:project_id/notebooks/:notebook_id/sharing/passwords Example response
Status 200
Delete notebooks sharing passwords
Delete a password from the sharing configuration.
Required API key scopes
sharing_configuration:writePath parameters
- notebook_idstring
- password_idstring
Example request
DELETE /api/projects/:project_id/notebooks/:notebook_id/sharing/passwords/:password_id Example response
Status 204 No response body
Create notebooks sharing refresh
Required API key scopes
sharing_configuration:writePath parameters
- notebook_idstring
Request parameters
- enabledboolean
- settings
- password_requiredboolean
Response
Example request
POST /api/projects/:project_id/notebooks/:notebook_id/sharing/refresh Example response
Status 200
Retrieve notebooks
Also available via the PostHog MCP server:
notebooks-retrieve— Get notebook
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
notebook:readPath parameters
- short_idstring
Response
Example request
GET /api/projects/:project_id/notebooks/:short_id Example response
Status 200
Update notebooks
Also available via the PostHog MCP server:
notebooks-partial-update— Update notebook
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
notebook:writePath parameters
- short_idstring
Request parameters
- titlestringnull
- content
- text_contentstringnull
- versioninteger
- deletedboolean
- _create_in_folderstring
Response
Example request
PATCH /api/projects/:project_id/notebooks/:short_id Example response
Status 200
Delete notebooks
Also available via the PostHog MCP server:
notebooks-destroy— Delete notebook
Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
Required API key scopes
notebook:writePath parameters
- short_idstring
Example request
DELETE /api/projects/:project_id/notebooks/:short_id Example response
Status 405 No response body
Retrieve notebooks activity
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
activity_log:readPath parameters
- short_idstring
Example request
GET /api/projects/:project_id/notebooks/:short_id/activity Example response
Status 200 No response body
Create notebooks collab markdown save
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
notebook:writePath parameters
- short_idstring
Request parameters
- client_idstring
- versioninteger
- content
- text_contentstringDefault:
- titlestring
- cursor
Example request
POST /api/projects/:project_id/notebooks/:short_id/collab/markdown_save Example response
Status 200 No response body
Create notebooks collab presence
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
notebook:writePath parameters
- short_idstring
Request parameters
- client_idstring
- versioninteger
- cursor
Example request
POST /api/projects/:project_id/notebooks/:short_id/collab/presence Example response
Status 204 No response body
Create notebooks collab save
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
notebook:writePath parameters
- short_idstring
Request parameters
- client_idstring
- versioninteger
- stepsarray
- content
- text_contentstringDefault:
- titlestring
- cursor_headintegernull
Example request
POST /api/projects/:project_id/notebooks/:short_id/collab/save Example response
Status 200 No response body
Retrieve notebooks collab stream
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Required API key scopes
notebook:readPath parameters
- short_idstring
Example request
GET /api/projects/:project_id/notebooks/:short_id/collab/stream Example response
Status 200 No response body
Create notebooks hogql execute
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Path parameters
- short_idstring
Request parameters
- titlestringnull
- content
- text_contentstringnull
- versioninteger
- deletedboolean
- _create_in_folderstring
Example request
POST /api/projects/:project_id/notebooks/:short_id/hogql/execute Example response
Status 200 No response body
Create notebooks kernel config
Set the notebook's kernel compute configuration. Applies at sandbox provision time: a currently running kernel keeps its resources until restarted.
Required API key scopes
notebook:writePath parameters
- short_idstring
Request parameters
- cpu_coresnumber
- memory_gbnumber
- idle_timeout_secondsinteger
Response
Example request
POST /api/projects/:project_id/notebooks/:short_id/kernel/config Example response
Status 200
Retrieve notebooks kernel dataframe
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Path parameters
- short_idstring
Example request
GET /api/projects/:project_id/notebooks/:short_id/kernel/dataframe Example response
Status 200 No response body
Create notebooks kernel execute
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Path parameters
- short_idstring
Request parameters
- titlestringnull
- content
- text_contentstringnull
- versioninteger
- deletedboolean
- _create_in_folderstring
Example request
POST /api/projects/:project_id/notebooks/:short_id/kernel/execute Example response
Status 200 No response body
Create notebooks kernel execute stream
The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
Path parameters
- short_idstring
Request parameters
- titlestringnull
- content
- text_contentstringnull
- versioninteger
- deletedboolean
- _create_in_folderstring
Example request
POST /api/projects/:project_id/notebooks/:short_id/kernel/execute/stream