API Protect

Lock your API without touching your code

APIs are the favorite target of scrapers and attackers, and many were never built with access control in mind. API Protect puts a token check and a rate limit in front of any URL on your site, enforced by NOC at the edge, before a request reaches your server.

Free 14-Day Trial
No credit card required. Included for every site.
An access token per user, sent in one header
A request limit per user, per hour
Optional expiry date for each token
Optional free access, limited per IP address

Access control in front of the API

Adding authentication to an existing API means code changes, testing and a release, and some APIs, like the WordPress REST API on /wp-json/, aren't yours to change. With API Protect, the check happens on NOC's network instead: requests without a valid token, or over their limit, get a 403 there, and your application only sees the calls you allowed.

How it works

1
Choose the URLs

List the API paths to protect, like ^/api/ or /wp-json/.

2
Add users

Create a user for each partner or app. NOC generates a token, or you set your own.

3
Set limits

Give each user a limit in requests per hour, and an expiry date if you want.

4
Callers send the token

Each request carries its token in the X-API-Access header. Everything else is refused at the edge.

Tokens, limits and responses

Protected URLs
Any paths on your site, space-separated. Use / to protect everything.
Users and tokens
One token per user, with a name you choose. Remove a user to revoke their access right away.
Rate limits
Requests per hour for each user, from 10 to 99,999, or unlimited.
Free access
Optionally allow requests without a token, limited per IP address (50 per hour by default), for a public tier.
Responses
A missing or invalid token, or a caller over the limit, gets a 403 with a JSON error, easy to handle in any client.

Automate it with the API

Manage API Protect users from your own systems.

Turn on API Protect for /api/v2/
curl "https://my.noc.org/api?apikey=YOUR_API_KEY&action=cdn/customrules/add&website=example.com&rule_type=api_protect&url=/api/v2/"
Add a partner with 500 requests per hour, until the end of 2027
curl "https://my.noc.org/api?apikey=YOUR_API_KEY&action=cdn/customrules/api_protect/add_user&website=example.com&username=partner-a&max_requests=500&expire=2027-12-31"
Calling the protected API
curl -H "X-API-Access: THE_USER_TOKEN" "https://example.com/api/orders"

Full API reference →

Frequently asked questions

No. Your API keeps working as it does. NOC checks the token before forwarding the request.

Yes. Protect a REST route and only apps with a token can use it. Keep in mind that some plugins and the block editor use the REST API too, so protect only the routes your partners and apps call, like /wp-json/my-plugin/, not all of /wp-json/.

Requests with that token are refused with a 403 from the expiry date on, until you extend it or create a new one.

Learn the basics: What is rate limiting? · What is authentication?

Related features

Security that works, at a price that makes sense

$5per domain per month.

Get access to our full suite of services, including DNS, WAF/CDN and Monitoring, or use only what you need. Our WAF/CDN operates on a distributed anycast network with over 20 data centers, delivering exceptional global performance.

Free 14-Day Trial