_api/web/Lists/GetByTitle('File Lock Testing')/GetItemById(1)/recycle
GetFileByServerRelativeUrl()
In your HTTP request URL, use:
_api/web/GetFileByServerRelativeUrl('[SERVER-RELATIVE-PATH]')/recycle()
Where [SERVER-RELATIVE-PATH]
should be something like:
/sites/YourSite/YourLibrary/YourFile.xlsx
If your "Create file" action returns a full SharePoint URL, you need to extract the server-relative portion:
substring(outputs('Create_file')?['body/Path'], indexOf(outputs('Create_file')?['body/Path'], '/sites/'))
_api/web/GetFileByServerRelativeUrl('@{outputs('Compose')}')/recycle()
DELETE
https://[yourtenant].sharepoint.com/sites/[yoursite]/_api/web/GetFileByServerRelativeUrl('/sites/[yoursite]/[yourlibrary]/[yourfile]')
Accept
: application/json;odata=verbose
Content-Type
: application/json;odata=verbose
X-RequestDigest
: Use the form digest valueIF-MATCH
: *
If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
Regards,
Riyaz
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1