API redirects info management

For Workes & Pages, what is the name of the domain?

example.com

What is the issue or error you’re encountering

API returns no info about redirects rules set meanwhile it’s seen from the account settings

What steps have you taken to resolve the issue?

I’m using this request:

curl -X GET “https://api.cloudflare.com/client/v4/zones/ZONEID/pagerules
-H “Authorization: Bearer API token”
-H “Content-Type: application/json”

And it returns empty result, but I’m 100% there is a redirect rule set on this domain.
Also, I have other domain with a redirect rule set on the same cloudflare account, but it works fine and apu returrns the correct result.

{“result”:,“success”:true,“errors”:,“messages”:}%

Page Rules can do redirects, but there are also “Redirect Rules” so check you haven’t confused the two and are looking in the wrong place. Check in the dashboard to be sure, then try the API.

Yes thank you, I see that some websites have redirect rules and some of them page rules.

But now I have a problem that api does not work for redirect rules, and it’s always returning authentication error otherwise redirect rules work fine.

I tried to google the correct permissions and the only thing I found that you have to allow Rulesets: edit for zones, but as I see there is no such permisions in cloudflare api

So how can I control Redirect rules via api?

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.