Hi Vinay Ayinapurapu,

To disable the Request Access settings in SharePoint Online using REST, you can utilize the following approach. The Request Access feature allows users to request access to sites they do not have permission to view. If you want to disable this feature, you can do so by updating the site’s permissions settings.

JavaScript
// Define the site URL and the REST endpoint
var siteUrl = "https://yourtenant.sharepoint.com/sites/yoursite";
var requestAccessUrl = siteUrl + "/_api/web";

$.ajax({
    url: requestAccessUrl,
    type: "POST",
    headers: {
        "Accept": "application/json; odata=verbose",
        "Content-Type": "application/json; odata=verbose",
        "X-RequestDigest": $("#__REQUESTDIGEST").val(),
        "IF-MATCH": "*",
        "X-HTTP-Method": "MERGE"
    },
    data: JSON.stringify({
        "RequestAccessEnabled": false // Disable Request Access
    }),
    success: function(data) {
        console.log("Request Access settings disabled successfully.");
    },
    error: function(error) {
        console.error("Error disabling Request Access settings: ", error);
    }
});

In this code, replace yourtenant and yoursite with your actual tenant and site names. This will effectively disable the Request Access feature for the specified SharePoint site. Always ensure you have the necessary permissions to make these changes.