The NOC REST API lets you programmatically manage CDN sites, WAF rules, DNS records, and monitoring endpoints. This guide covers authentication, common endpoints, and practical curl examples to get you started.
Prerequisites
- An active NOC.org account.
- An API key generated from the NOC Dashboard.
curlor any HTTP client (Postman, httpie, etc.).
Step 1 — Generate an API Key
- Log in to the NOC Dashboard.
- Click your account name in the top-right corner and select API Keys.
- Click Create API Key.
- Give the key a descriptive name (e.g., "CI/CD Pipeline" or "Monitoring Script").
- Copy the key immediately — it will not be shown again.
Important: Treat your API key like a password. Do not commit it to version control or share it in public channels.
Step 2 — Authentication
All API requests require an Authorization header with your API key:
Authorization: Bearer YOUR_API_KEY
The base URL for all API endpoints is:
https://api.noc.org/v1
Step 3 — Common API Endpoints
List All Sites
curl -s -H "Authorization: Bearer YOUR_API_KEY" \
https://api.noc.org/v1/sites
Returns a JSON array of all sites on your account with their IDs, domains, and status.
Get Site Details
curl -s -H "Authorization: Bearer YOUR_API_KEY" \
https://api.noc.org/v1/sites/{site_id}
Create a New Site
curl -s -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "example.com",
"origin_ip": "203.0.113.50",
"origin_port": 443,
"ssl": true
}' \
https://api.noc.org/v1/sites
Purge CDN Cache
# Purge everything
curl -s -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"purge_all": true}' \
https://api.noc.org/v1/sites/{site_id}/cache/purge
# Purge specific URLs
curl -s -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"urls": ["https://example.com/style.css", "https://example.com/app.js"]}' \
https://api.noc.org/v1/sites/{site_id}/cache/purge
Update WAF Rules
curl -s -X PATCH \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"waf_enabled": true, "block_bad_bots": true}' \
https://api.noc.org/v1/sites/{site_id}/waf
List DNS Records
curl -s -H "Authorization: Bearer YOUR_API_KEY" \
https://api.noc.org/v1/dns/{domain}/records
Delete a Site
curl -s -X DELETE \
-H "Authorization: Bearer YOUR_API_KEY" \
https://api.noc.org/v1/sites/{site_id}
Response Format
All responses are returned as JSON. A successful response includes a status field:
{
"status": "success",
"data": { ... }
}
Error responses include a message and HTTP status code:
{
"status": "error",
"message": "Site not found",
"code": 404
}
Rate Limits
API requests are rate-limited to 60 requests per minute per API key. If you exceed this limit, you will receive a 429 Too Many Requests response. The Retry-After header indicates how many seconds to wait before retrying.
Next Steps
- CDN/WAF API Reference — full endpoint documentation with request and response schemas.
- SSH IP Authentication — restrict API and dashboard access to specific IPs.