# Folder Templates

## GET /folder-templates

> List folder templates for a workspace

```json
{"openapi":"3.1.0","info":{"title":"shade","version":"dev"},"paths":{"/folder-templates":{"get":{"tags":["folder-templates"],"summary":"List folder templates for a workspace","operationId":"list_folder_templates_folder_templates_get","parameters":[{"name":"workspace_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"The workspace id","description":"The id of the workspace to get folder templates from"},"description":"The id of the workspace to get folder templates from"},{"name":"drive_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"The drive id","description":"Optional drive id to filter templates specific to that drive"},"description":"Optional drive id to filter templates specific to that drive"},{"name":"password","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"The password","description":"The password header to use to fetch the preview"},"description":"The password header to use to fetch the preview"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_list_folder_templates_folder_templates_get"}}}},"responses":{"200":{"description":"A list of folder templates","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FolderTemplateDTO"},"title":"Response List Folder Templates Folder Templates Get"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_list_folder_templates_folder_templates_get":{"properties":{"body":{"additionalProperties":true,"type":"object","title":"Body","default":{}}},"type":"object","title":"Body_list_folder_templates_folder_templates_get"},"FolderTemplateDTO":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"drive_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Drive Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"icon":{"type":"string","title":"Icon"},"created":{"type":"string","format":"date-time","title":"Created"},"created_by":{"anyOf":[{"$ref":"#/components/schemas/UserDTOBase"},{"type":"null"}]},"paths":{"items":{"type":"string"},"type":"array","title":"Paths"}},"type":"object","required":["id","workspace_id","name","description","icon","created","created_by","paths"],"title":"FolderTemplateDTO"},"UserDTOBase":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"avatar_url":{"type":"string","title":"Avatar Url"},"user_type":{"$ref":"#/components/schemas/UserType"}},"type":"object","required":["id","name","email","avatar_url","user_type"],"title":"UserDTOBase"},"UserType":{"type":"string","enum":["regular","group"],"title":"UserType"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## POST /folder-templates

> Create a folder template from an existing folder

```json
{"openapi":"3.1.0","info":{"title":"shade","version":"dev"},"paths":{"/folder-templates":{"post":{"tags":["folder-templates"],"summary":"Create a folder template from an existing folder","operationId":"create_folder_template_folder_templates_post","parameters":[{"name":"password","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"The password","description":"The password header to use to fetch the preview"},"description":"The password header to use to fetch the preview"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_create_folder_template_folder_templates_post"}}}},"responses":{"200":{"description":"The created folder template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderTemplateDTO"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_create_folder_template_folder_templates_post":{"properties":{"name":{"type":"string","title":"Template name","description":"The name of the folder template"},"description":{"type":"string","title":"Template description","description":"A brief description of how to use this template","default":""},"icon":{"type":"string","title":"Template icon key","description":"Icon key used by the client when displaying this template","default":""},"workspace_id":{"type":"string","format":"uuid","title":"Workspace id","description":"The id of the workspace this template belongs to (always required)"},"drive_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Drive id","description":"Optional drive id if this template is specific to a drive within the workspace"},"root_path":{"type":"string","format":"path","title":"Source folder path","description":"The absolute path of the folder to capture as a template"},"body":{"additionalProperties":true,"type":"object","title":"Body","default":{}}},"type":"object","required":["name","workspace_id","root_path"],"title":"Body_create_folder_template_folder_templates_post"},"FolderTemplateDTO":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"drive_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Drive Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"icon":{"type":"string","title":"Icon"},"created":{"type":"string","format":"date-time","title":"Created"},"created_by":{"anyOf":[{"$ref":"#/components/schemas/UserDTOBase"},{"type":"null"}]},"paths":{"items":{"type":"string"},"type":"array","title":"Paths"}},"type":"object","required":["id","workspace_id","name","description","icon","created","created_by","paths"],"title":"FolderTemplateDTO"},"UserDTOBase":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"avatar_url":{"type":"string","title":"Avatar Url"},"user_type":{"$ref":"#/components/schemas/UserType"}},"type":"object","required":["id","name","email","avatar_url","user_type"],"title":"UserDTOBase"},"UserType":{"type":"string","enum":["regular","group"],"title":"UserType"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## DELETE /folder-templates/{template\_id}

> Delete a folder template

```json
{"openapi":"3.1.0","info":{"title":"shade","version":"dev"},"paths":{"/folder-templates/{template_id}":{"delete":{"tags":["folder-templates"],"summary":"Delete a folder template","operationId":"delete_folder_template_folder_templates__template_id__delete","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template ID","description":"The ID of the folder template to delete"},"description":"The ID of the folder template to delete"},{"name":"password","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"The password","description":"The password header to use to fetch the preview"},"description":"The password header to use to fetch the preview"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_delete_folder_template_folder_templates__template_id__delete"}}}},"responses":{"200":{"description":"True if the template was deleted successfully","content":{"application/json":{"schema":{"type":"boolean","title":"Response Delete Folder Template Folder Templates  Template Id  Delete"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_delete_folder_template_folder_templates__template_id__delete":{"properties":{"body":{"additionalProperties":true,"type":"object","title":"Body","default":{}}},"type":"object","title":"Body_delete_folder_template_folder_templates__template_id__delete"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## PATCH /folder-templates/{template\_id}

> Update a folder template

```json
{"openapi":"3.1.0","info":{"title":"shade","version":"dev"},"paths":{"/folder-templates/{template_id}":{"patch":{"tags":["folder-templates"],"summary":"Update a folder template","operationId":"update_folder_template_folder_templates__template_id__patch","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template ID","description":"The ID of the folder template to update"},"description":"The ID of the folder template to update"},{"name":"password","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"The password","description":"The password header to use to fetch the preview"},"description":"The password header to use to fetch the preview"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_update_folder_template_folder_templates__template_id__patch"}}}},"responses":{"200":{"description":"The updated folder template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderTemplateDTO"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_update_folder_template_folder_templates__template_id__patch":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template name","description":"The new name for the folder template"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template description","description":"The new description for the folder template"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template icon key","description":"The new icon key for the folder template"},"body":{"additionalProperties":true,"type":"object","title":"Body","default":{}}},"type":"object","title":"Body_update_folder_template_folder_templates__template_id__patch"},"FolderTemplateDTO":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"drive_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Drive Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"icon":{"type":"string","title":"Icon"},"created":{"type":"string","format":"date-time","title":"Created"},"created_by":{"anyOf":[{"$ref":"#/components/schemas/UserDTOBase"},{"type":"null"}]},"paths":{"items":{"type":"string"},"type":"array","title":"Paths"}},"type":"object","required":["id","workspace_id","name","description","icon","created","created_by","paths"],"title":"FolderTemplateDTO"},"UserDTOBase":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"avatar_url":{"type":"string","title":"Avatar Url"},"user_type":{"$ref":"#/components/schemas/UserType"}},"type":"object","required":["id","name","email","avatar_url","user_type"],"title":"UserDTOBase"},"UserType":{"type":"string","enum":["regular","group"],"title":"UserType"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://academy.shade.inc/developers/folder-templates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
