How to disable Request Access Settings in SharePoint online using REST
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jayraj ChhayaRank #304 · 8.2K reputationPosted Nov 21, 2024, 12:50 AM EST
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.
// 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
yourtenantandyoursitewith 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.