#How Do I disable Access Policy?
4 messages · Page 1 of 1 (latest)
yes, I met the same problem, I just enable it in page settings, and I found there is only "Manage" link, but after I click it I met the same page you met, so I also want to know how to disable the "Access Policy"!
I just find the way, the steps are as below:
- add the api token permission "Account: Access: Apps and Policies", and set it to "Edit"
- use cursor or claude code to help you to wride the code to delete the "Access Policy". or you can use my script (delete_access_policy.js" ) as below to delete it, just notice that you need to modify the "accountId" to your id, my id looks like "026b92ea77.....35e554e", and then execute the script as "node delete_access_policy.js <Your CLOUDFLARE_API_TOKEN>
<TOO LONG, SO TO BE CONTINUE>
delete_access_policy.js IS:
const https = require('https');
const accountId = '026b92e...fa335e554e'; //!!!USE YOUR ID!!!
// Get token from command line argument
const token = process.argv[2];
if (!token) {
console.error("Usage: node scripts/delete_access_policy.js <YOUR_API_TOKEN>");
process.exit(1);
}
const commonHeaders = {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
};
function makeRequest(path, method) {
return new Promise((resolve, reject) => {
const options = {
hostname: 'api.cloudflare.com',
path: path,
method: method,
headers: commonHeaders
};
const req = https.request(options, (res) => {
let data = '';
res.on('data', (chunk) => data += chunk);
res.on('end', () => {
try {
const json = JSON.parse(data);
resolve({ statusCode: res.statusCode, data: json });
} catch (e) {
reject(e);
}
});
});
req.on('error', reject);
req.end();
});
}
<TOO LONG TO BE CONTINUE>