Forum Discussion
vi1996ash
Microsoft Employee
1 year agoRest Api to create notebook in folder
Do we have an api to create or update notebook or data pipeline in a folder in fabric workspace?
- 1 year ago
Hi vi1996ash
You can use the Microsoft Fabric REST APIs to create and update notebooks and data pipelines within a workspace, but direct folder (subfolder) targeting is not currently available through the API. All items are created at the workspace level, and folder management require manual steps
Srisakthi
Super User
1 year agoHi vi1996ash ,
You can create notebooks using api and manually move to the folder.
Here is the sample snippet using python
def create_update_notebook_definition(notebook_name):
notebook_details = {
"displayName": f'{notebook_name}'
}
response = requests.post(
url = f"https://api.fabric.microsoft.com/v1/workspaces/{target_workspace_id}/notebooks",
headers=headers,
json=notebook_details,
verify=False)
Regards,
Srisakthi