Skip to content

Delete Folder

DELETE
/api/writing/folders/{folder_id}

πŸ—‘οΈ Delete a folder.

Deletes a folder. If folder has children, must specify delete_contents=true.

Args: folder_id: Unique folder identifier service: Injected DocumentCategoriesService instance delete_contents: Whether to delete child folders (default: false)

Returns: WritingFolderDeleteResponse: Deletion confirmation with timestamp

Raises: HTTPException 404: If folder not found HTTPException 400: If folder has children and delete_contents is false HTTPException 500: If folder deletion fails

folder_id
required
Folder Id

Folder ID

string

Folder ID

delete_contents
Delete Contents

Delete child folders and move documents to root

boolean

Delete child folders and move documents to root

Successful Response

WritingFolderDeleteResponse

Response model for folder delete operations in Writing Studio.

Confirms successful folder deletion with operation metadata.

Fields:

  • success: Whether the delete operation succeeded
  • folder_id: ID of the deleted folder
  • deleted_at: ISO 8601 timestamp of deletion

Usage: DELETE /api/creative/categories/folders/{folder_id} returns this model.

JSON Example:

{
  "success": true,
  "folderId": "folder_abc123",
  "deletedAt": "2025-12-04T11:00:00Z"
}
object
success
required
Success

Delete operation success status

boolean
folderId
required
Folderid

Deleted folder ID

string
deletedAt
required
Deletedat

Deletion timestamp (ISO 8601)

string

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object