노트북 만들기 및 관리 (API) | NotebookLM Enterprise | Google Cloud Documentation
Key Points
- 1This document details the NotebookLM Enterprise API, providing programmatic methods for managing notebooks, including creation, retrieval, listing, deletion, and sharing.
- 2It outlines specific REST API calls for each operation, requiring parameters such as `PROJECT_NUMBER`, `LOCATION`, and `NOTEBOOK_ID`, with authentication handled via `gcloud auth print-access-token`.
- 3The guide also explains how to find notebook IDs in the browser and notes requirements like assigning Cloud NotebookLM User IAM roles for sharing functionalities.
This paper details the Application Programming Interface (API) for programmatic management of NotebookLM Enterprise notebooks, a tool designed to generate information and summaries from documents. The API enables users to perform operations such as creating, retrieving, listing recently viewed, batch deleting, and sharing notebooks.
Before utilizing the API, users must configure NotebookLM Enterprise and acquire the necessary license. Authentication for all API requests is handled via Google Cloud's gcloud auth print-access-token command, which generates an access token to be included in the Authorization:Bearer HTTP header. All API calls target a base URL with specific placeholders: ENDPOINT_LOCATION (multiregional endpoint, e.g., us-, eu-, global-), PROJECT_NUMBER (Google Cloud project identifier), and LOCATION (geographical location of the datastore, e.g., global).
The core methodology of the API revolves around distinct RESTful endpoints for each operation:
- Creating a Notebook (
notebooks.create):- Method:
POST - Endpoint:
https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_NUMBER/locations/LOCATION/notebooks - Request Body: A JSON object
{ "title": "NOTEBOOK_TITLE" }, whereNOTEBOOK_TITLEis a UTF-8 encoded string. - Response: A JSON object containing the
title, a uniquenotebookId,emoji,metadata(includinguserRole,isShared,isShareable), and the full resourcenameof the notebook. Thenamefollows the patternprojects/PROJECT_NUMBER/locations/LOCATION/notebooks/NOTEBOOK_ID. ThenotebookIdis crucial for subsequent API calls.
- Method:
- Retrieving a Notebook (
notebooks.get):- Method:
GET - Endpoint:
https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_NUMBER/locations/LOCATION/notebooks/NOTEBOOK_ID - Parameters: Requires the specific
NOTEBOOK_IDof the notebook to be retrieved. - Response: A JSON object similar to the creation response, but additionally including
lastViewedandcreateTimein themetadatafield. If sources have been added or Customer-Managed Encryption Keys (CMEK) configured, their details will also be included.
- Method:
- Listing Recently Viewed Notebooks (
notebooks.listRecentlyViewed):- Method:
GET - Endpoint:
https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_NUMBER/locations/LOCATION/notebooks:listRecentlyViewed - Parameters: Supports an optional
pageSizequery parameter for pagination. - Response: A JSON object containing a
notebooksarray, listing up to 500 recently accessed notebooks. Each element in the array provides details similar to thenotebooks.getresponse for an individual notebook.
- Method:
- Batch Deleting Notebooks (
notebooks.batchDelete):- Method:
POST - Endpoint:
https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_NUMBER/locations/LOCATION/notebooks:batchDelete - Request Body: A JSON object
{ "names": [ "NOTEBOOK_NAME_1", "NOTEBOOK_NAME_2" ] }, whereNOTEBOOK_NAMEis the full resource name (e.g.,projects/PROJECT_NUMBER/locations/LOCATION/notebooks/NOTEBOOK_ID) of each notebook to be deleted. - Response: An empty JSON object
{}upon successful deletion.
- Method:
- Sharing a Notebook (
notebooks.share):- Prerequisites: The user to whom the notebook is being shared must have the "Cloud NotebookLM User" Identity and Access Management (IAM) role assigned in the Google Cloud project.
- Method:
POST - Endpoint:
https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_NUMBER/locations/LOCATION/notebooks/NOTEBOOK_ID:share - Parameters: Requires the
NOTEBOOK_IDof the notebook to be shared. - Request Body: A JSON array of
accountAndRolesobjects, each specifying"email"(user's email address) and"role"(the assigned role). Supported roles includePROJECT_ROLE_OWNER,PROJECT_ROLE_WRITER,PROJECT_ROLE_READER, andPROJECT_ROLE_NOT_SHARED. - Response: An empty JSON object
{}upon success. Verification of sharing can be done via the NotebookLM Enterprise web interface by opening the notebook and checking the "Shared with" section.
The paper also outlines how to access and verify created notebooks through the NotebookLM Enterprise web interface, providing specific URLs for Google ID and third-party ID users. The browser URLs reveal the LOCATION, notebookId, and PROJECT_NUMBER, which are useful for correlating with API responses.