Announcements
In your HTTP request URL, use:
_api/web/GetFileByServerRelativeUrl('[SERVER-RELATIVE-PATH]')/recycle()
Where [SERVER-RELATIVE-PATH] should be something like:
[SERVER-RELATIVE-PATH]
/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
X-RequestDigest
IF-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
_api/web/Lists/GetByTitle('File Lock Testing')/GetItemById(1)/recycle
GetFileByServerRelativeUrl()
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Haque 592
Valantis 340
11manish 284