Skip to content

feat: add drive special folder GET endpoints - #74

Open
dschmidt wants to merge 3 commits into
mainfrom
feat/drive-special-recyclebin
Open

feat: add drive special folder GET endpoints#74
dschmidt wants to merge 3 commits into
mainfrom
feat/drive-special-recyclebin

Conversation

@dschmidt

@dschmidt dschmidt commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Address a drive's trash over the Graph API as a special folder, and operate on trashed and live items.

special-name is an enum, currently [recyclebin], resolving to the drive's trash. The special folder need not be reachable in the normal item tree. Trash entries are driveItems carrying the existing trash facet (trashedBy, trashedDateTime) with a parentReference for their original location.

Listing

Method Path What
GET /v1.0/drives/{drive-id}/special/{special-name} get the special folder ($expand=children embeds the listing)
GET /v1.0/drives/{drive-id}/special/{special-name}/children list trashed items

Restore

MS Graph driveItem: restore. Optional body { parentReference, name } to restore elsewhere; returns the restored driveItem.

Method Path
POST /v1.0/drives/{drive-id}/items/{item-id}/restore
POST /v1beta1/drives/{drive-id}/items/{item-id}/restore
POST /v1.0/me/drive/items/{item-id}/restore

permanentDelete

MS Graph driveItem: permanentDelete: hard-delete a live item bypassing the trash (it does not address trashed items). Offered on every single-item endpoint for consistency.

Method Path
POST /v1.0/drives/{drive-id}/items/{item-id}/permanentDelete
POST /v1beta1/drives/{drive-id}/items/{item-id}/permanentDelete
POST /v1.0/me/drive/items/{item-id}/permanentDelete

Purge and empty

Purge one trashed item (member DELETE, mirrors MS Graph delete recycleBinItem) or empty the whole trash (DELETE on the virtual special folder, which stays addressable; no MS equivalent, mirrors the WebDAV trash-bin DELETE).

Method Path What
DELETE /v1.0/drives/{drive-id}/special/{special-name}/items/{item-id} purge one trashed item
DELETE /v1.0/drives/{drive-id}/special/{special-name} empty the trash

Notes

  • The special-folder GETs also accept the MS Graph colon path forms (special/{special-name}:/{path} and :/{path}:/children), noted in the descriptions since OpenAPI cannot express the colon segment.
  • permanentDelete (live, skip trash) and purge (remove an item already in the trash) are distinct: verified against MS Graph, permanentDelete returns 404 on a trashed item.
  • Restore/purge/empty reuse the existing trash facet; nothing populates it yet, the server side follows.

Add GET /v1.0/drives/{drive-id}/special/{special-id} and its /children,
addressing a drive's special folders by well-known name. Defines the
recyclebin special folder as the drive trash: children carry the trash
facet (trashedBy/trashedDateTime) and parentReference for the original
location, and the folder need not be reachable in the normal item tree.
Listing only for now; restore/purge follow separately.
restore and permanentDelete on the single-item driveItem endpoints (v1.0
and v1beta1 drives, me/drive), a member DELETE to purge one trashed item
from a special folder, and a DELETE on the special folder itself to empty
it. Restore and permanentDelete follow MS Graph; the member DELETE mirrors
delete recycleBinItem; empty has no MS equivalent and mirrors the WebDAV
trash-bin DELETE. permanentDelete hard-deletes a live item bypassing the
trash and does not address trashed items.
@dschmidt
dschmidt marked this pull request as ready for review September 7, 2026 10:56
@dschmidt dschmidt changed the title feat(spec): add drive special folder GET endpoints feat: add drive special folder GET endpoints Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant