Is there a way to get all the checked-out documents in a library? I know this cannot be done by search-driven webparts, but is there a way let's say through REST or something like that?

3 Answers 3


I can suggest 3 ways to achieve this:

First 2 are REST and Javascript:

You could use SP.File.checkOutType property to determine whether document is checked out of a document library


$.ajax({url: "/_api/web/getFileByServerRelativeUrl('" + docUrl  + "')/checkOutType",
        headers: { "Accept": "application/json; odata=verbose" }, 
        success: function(data) {
                  if(data.d.CheckOutType == 0) {
                        console.log('The file is checked out');

CSOM (JavaScript)

var context = SP.ClientContext.get_current();
var web = context.get_web();
var file = web.getFileByServerRelativeUrl(docUrl);

         if(file.get_checkOutType() == SP.CheckOutType.online) {
                        console.log('The file is checked out');
      function(sender, args){    

Third one is the easiest based on Spservices:


Use SpServices GetListItems and write a query where you search for all the items where "CheckOutType"("checkedOutTo" please check the internal name) is not null. You can then iterate through all the items.

Do let me know if you need help writing the query. Cheers!

  • Do I Need a list of documents in the first 2 approaches?
    – yngrdyn
    Jul 13, 2015 at 13:09
  • Yes these are just reusable functions. You'll need to iterate over the library and check if that document is checked out or not. The advantage of it is that you'll have list off all checked out documents in the end.
    – Taran Goel
    Jul 13, 2015 at 13:16
  • yes, but what about the performance?
    – yngrdyn
    Jul 13, 2015 at 13:23
  • Can you add an example for the third approach, SpServices with a query? Thanks.
    – zed
    Apr 13, 2018 at 3:45

You can try something like this:

var thaUrl = "<app web url>/_api/web/lists/GetByTitle('<library>')//CheckOutType';
    type: "POST",
    headers: {
        "Accept": "application/json;odata=verbose",
        "X-RequestDigest": $("#__REQUESTDIGEST").val()
    contentType: 'application/json',
    url: thaUrl,
    success: function (data) {
        //whatever you want to do if success
    error: function (err) {
        alert('Error, I explode :(');
    complete: function (item) { }

This will return all the files state in a library. Where:

CheckOutType values: Online = 0; Offline = 1; None = 2.

This worked great for me!


You'll get a return inline that contains CheckOutType for all Documents

<content type="application/xml">
<d:CheckInComment />
**<d:CheckOutType m:type="Edm.Int32">0</d:CheckOutType>**
<d:CustomizedPageStatus m:type="Edm.Int32">0</d:CustomizedPageStatus>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.