How to get all the checked out files in a library with rest

Copper Contributor

How to get the checked out files of all user with rest.




10 Replies

I just ran a test and this pulled back checked out items in a library in SharePoint Online:


/_api/web/lists/getbytitle('Documents')/items?$filter=CheckoutUserId ne null

That only retrieves the files that I checked out. I need to see all the files checked out by everyone

Are you sure that the files have been checked in before. It may be that you cannot see files that are checked out because the files have never been checked in. Once the initial check in has happened, it becomes visible to all users, even if it's subsequently checked out.

I just ran this against a document library with files checked out from 2 different people and it returned both items:


/_api/web/lists/getbytitle('Documents')/items?$select=CheckoutUserId/Title&$filter=CheckoutUserId ne null


Screenshot of results:

2016-11-23 09_14_17-Advanced REST client.png


Yes, because he will see the last checked in version. But I need to see the first checked out file. The ManageCheckedOutFiles.aspx page allows me to see all check out files (including first checked out files)

In this page are two first checked out items that other people has.

Capture.PNGI use that /sites/devflam/_api/web/lists/getbytitle('Documentos')/items?$select=CheckoutUserId/Title&$filter=CheckoutUserId%20ne%20null but it does not work


Is there a reason you need to do this with the rest api? I was curious as I know this sort of task can be handled with a SharePoint view in the library by showing the "checked out to" column. The only other catch to this is the new files that were uploaded and not checked in for the first time that can be caught in the Library Settings > Managed files with no checked in version page.

You are right files with no checked in version that were not uploaded by you are not visible via REST (as far as I can find via testing). What is your use case to find these files?  You could probably write a script to get this using CSOM.

@Sebastián Acevedo Flórez have you gotten an answer to this? I am looking for solution to this as well. Need to see all checked out files (to include initial upload checked out by another user/no checked in version). Thank you.

Late to the party, but hope it can help someone. If you want to look up files with no previous check in versions (which are displayed in the ManageCheckedOutFiles.aspx page), you can use REST API and GetCheckedOutFiles().'ListTitle')/GetCheckedOutFi...()
It works at least in SharePoint Online. It will return only files with no check in versions, but not regular checked out files.