The NOC API exposes the entire Cloudflare infrastructure via a standardized programmatic interface. Using the NOC API you can update and manipulate most of the dashboard settings.
The NOC API is a RESTful API based on HTTPS requests and JSON responses. If you are registered with NOC, you can obtain your API key from the DNS API Access page.
Endpoints
The API is accessed by making HTTPS requests to a specific version endpoint URL, in which the GET methods dictates how to interact with the information available. Every endpoint is accessed only via the SSL-enabled HTTPS (port 443) protocol.
The stable base URL for the endpoint is:https://my.noc.org/api
All API requests must included in the API call. The API key is provided via the DNS API Access page.
Example of how it will work:https://my.noc.org/api?apikey=[api_key]
Operation | Description |
---|---|
Domain/add | Adds a new domain. |
Domain/remove | Deletes a domain name. |
Domains/list | List all domains in your account. |
Record/add | Adds a new DNS record to a domain. |
Record/delete | Deletes a DNS record from a domain. |
Records/list | List all DNS records for a domain. |
Sub_domain/set/routing | Configure routing type |
Domain/Add
Adds a new domain to your NOC DNS Account.
Name | Description |
---|---|
Action | domain/add |
Required value | domain_name=(valid_domain_name) |
Results: | {“status” = “success”}; |
In case of error: | {“status”:”failed”, “reason”:”reason why”} |
Example URL
https://my.noc.org/api?apikey=[API-KEY]&action=domain/add&domain_name=<DOMAINNAME>
Domain/Remove
Deletes a domain from your account. You need to remove all DNS records before this action is authorized.
Name | Description |
---|---|
Action | domain/remove |
Required value | domain_name=(valid_domain_name) |
Results: | {“status” = “success”}; |
In case of error: | {“status”:”failed”, “reason”:”reason why”} |
Example URL
https://my.noc.org/api?apikey=[API-KEY]&action=domain/remove&domain_name=<DOMAINNAME>
Domain/list
List all domains in your account.
Name | Description |
---|---|
Action | domain/list |
Results: | {“status”:”success”,”domains”:[“mytestdomain.com”,”globo.com”]} |
In case of error: | {“status”:”failed”, “reason”:”reason why”} |
Example URL
https://my.noc.org/api?apikey=[API-KEY]&action=domains/list
Record/Add
Adds a new DNS record.
Name | Description |
---|---|
Action | record/add |
Required value | domain_name=(valid_domain), sub_domain=(valid_subdomain), record_type=(DNS Type: A,AAAA. MX, etc), address=(valid IP address) |
Optional Value | ttl=(DNS TTL), default to 3600 seconds when not provided. |
Results: | {“status” = “success”}; |
In case of error: | {“status”:”failed”, “reason”:”reason why”} |
Example URL:
https://my.noc.org/api?apikey=[API-KEY]&action=record/add&domain_name=domain.com&sub_domain=www&ttl=120&record_type=A&address=192.168.1.1>
Record/Delete
Deletes a DNS record.
Name | Description |
---|---|
Action | record/delete |
Required value | recordid=(Domain record), domain_name=(valid_domain), sub_domain=(valid_subdomain) |
Results: | {“status” = “success”}; |
In case of error: | {“status”:”failed”, “reason”:”reason why”} |
Example URL:
https://my.noc.org/api?apikey=[API-KEY]&action=record/delete&domain_name=domain.com&recordid=X&sub_domain=SUBDOMAIN
Record/list
List all DNS records for a specific domain name.
Name | Description |
---|---|
Action | record/list |
Required value | domain_name=(valid_domain_name) or “all” |
In case of error: | {“status”:”failed”, “reason”:”reason why”} |
Example URL:
https://my.noc.org/api?apikey=[API-KEY]&action=records/list&domain_name=domain.com
Sub_domain/set/routing
Sets the routing type for a sub domain with multiple records. Routing types available via the API: disabled (all records always on), distance_routing (we pick the best and closest IP address based on our tests) and simple_failover (we remove records that fail our monitoring).
Name | Description |
---|---|
Action | sub_domain/set/routing |
Required Value | domain_name=(valid_domain), sub_domain=(valid_subdomain), routing_type=(disabled|distance_routing|simple_failover) |
Optional Value | routing_monitoring=(ping|http|https) |
Results | {“status” = “success”}; |
In case of error | {“status”:”failed”, “reason”:”reason why”} |
Example URL:
https://my.noc.org/api?apikey=[API-KEY]&action=sub_domain/set/routing&domain_name=domain.com&sub_domain=www&routing_type=distance_routing&routing_monitoring=ping