I managed to access the fields "EnableVersioning", "EnableMajorVersions" etc. to check whether my sharepoint lists have versioning enabled.

However, I didn't find any XML element that controls the number of major versions to keep.

Thank you!


The SPList.MajorVersionLimit and SPList.MajorWithMinorVersionsLimit is not exposed in CSOM\JSOM\REST SharePoint 2013 interfaces.

| improve this answer | |
  • even though client APIs do not expose the same set of properties as SSOM, there is an alternative approach to retrieve those properties as demonstrated in my answer – Vadim Gremyachev Feb 12 '15 at 22:19

How to retrieve List version related properties using SharePoint REST Interface

Client APIs such as REST/API do not expose the same set of properties as SSOM SPList, for example SPList.MajorVersionLimit is not available in client APIs.

But you could consider the following approach: (*)

  • First step is to retrieve List Schema: /_api/web/lists/getbytitle('list title')?$select=schemaXml
  • Then you could extract List properties from SchemaXml property

(*) Follow An alternative way of getting Client Object properties using SharePoint REST and CSOM APIs for a more details


The following example demonstrates how to retrieve List version related properties:

var webUrl = _spPageContextInfo.webAbsoluteUrl;

function getListProperties(webUrl,listTitle)
    var endpointUrl = webUrl + "/_api/web/lists/getbytitle('" + listTitle + "')?$select=schemaXml";
    return getJson(endpointUrl).then(function(data){
             var listProperties = schemaXml2Json(data.d.SchemaXml);
             return listProperties;


function getJson(url) 
    return $.ajax({       
       url: url,   
       type: "GET",  
       contentType: "application/json;odata=verbose",
       headers: { 
          "Accept": "application/json;odata=verbose"

function schemaXml2Json(schemaXml)
    var jsonObject = {};
    var schemaXmlDoc = $.parseXML(schemaXml);
    $(schemaXmlDoc).find('List').each(function() {
      $.each(this.attributes, function(i, attr){
           jsonObject[attr.name] = attr.value;
    return jsonObject;
| improve this answer | |

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.