Simplify management and monitoring with NetworkCalc Pro

About the Domains API

API Version: 1.9

The Domains API allows you to build, manage, and monitor your domains.

This is the API for Domains.

Endpoints

POST
https://networkcalc.com/api/domains/

Add a domain

. Add a domain to your account.
This endpoint requires authorization. Read about API authorization or see NetworkCalc Pro pricing.

Request Headers

Content-Type
(Required) application/json

Request Body

{
  "domain": "[string] The domain name, for example: networkcalc.com."
}

Response Codes

200
OK - Success.
401
MISSING_CREDENTIALS - The request body is missing client_id, client_secret, or both.
401
CREDENTIALS_NOT_FOUND - The credentials supplied are not valid.
401
NOT_AUTHORIZED - You do not have permission to perform this action.
400
NOT_SAVED - There was an error saving the resource. Either the resource did not pass validation or there was a server error preventing it from being saved. Check the request and try again.
400
NOT_UPDATED - There was an error saving the resource. Either the resource did not pass validation or there was a server error preventing it from being saved. Check the request and try again.
400
NOT_DELETED - There was an error deleting the resource. Check the request and try again.
POST
https://networkcalc.com/api/domains/{domain_id}/subdomains/{subdomain_prefix}

Add a subdomain

. Add a subdomain to an existing domain.
This endpoint requires authorization. Read about API authorization or see NetworkCalc Pro pricing.

Parameters

{domain_id}

(Optional) The unique ID of the domain.

Example: https://networkcalc.com/api/domains/123/subdomains

{subdomain_prefix}

The prefix for the domain. For example, if the domain is networkcalc.com, the subdomain prefix for my.demo.networkcalc.com would be my.demo.

Example: https://networkcalc.com/api/domains/123/subdomains/my.demo

Response Codes

200
OK - Success.
401
MISSING_CREDENTIALS - The request body is missing client_id, client_secret, or both.
401
CREDENTIALS_NOT_FOUND - The credentials supplied are not valid.
401
NOT_AUTHORIZED - You do not have permission to perform this action.
400
NOT_SAVED - There was an error saving the resource. Either the resource did not pass validation or there was a server error preventing it from being saved. Check the request and try again.
400
NOT_UPDATED - There was an error saving the resource. Either the resource did not pass validation or there was a server error preventing it from being saved. Check the request and try again.
400
NOT_DELETED - There was an error deleting the resource. Check the request and try again.
GET
https://networkcalc.com/api/domains/{domain_id}

List domains

. List one more more of the domains saved to your account.
This endpoint requires authorization. Read about API authorization or see NetworkCalc Pro pricing.

Parameters

{domain_id}

(Optional) The unique ID of the domain.

Example: https://networkcalc.com/api/domains/123/subdomains

Response Codes

200
OK - Success.
401
MISSING_CREDENTIALS - The request body is missing client_id, client_secret, or both.
401
CREDENTIALS_NOT_FOUND - The credentials supplied are not valid.
401
NOT_AUTHORIZED - You do not have permission to perform this action.
400
NOT_SAVED - There was an error saving the resource. Either the resource did not pass validation or there was a server error preventing it from being saved. Check the request and try again.
400
NOT_UPDATED - There was an error saving the resource. Either the resource did not pass validation or there was a server error preventing it from being saved. Check the request and try again.
400
NOT_DELETED - There was an error deleting the resource. Check the request and try again.
GET
https://networkcalc.com/api/domains/{domain_id}/subdomains/{subdomain_id}

List subdomains

. List one more more of the subdomains for a domain.
This endpoint requires authorization. Read about API authorization or see NetworkCalc Pro pricing.

Parameters

{domain_id}

(Optional) The unique ID of the domain.

Example: https://networkcalc.com/api/domains/123/subdomains

{subdomain_id}

(Optional) The unique ID of the subddomain.

Example: https://networkcalc.com/api/domains/subdomains/456

Response Codes

200
OK - Success.
401
MISSING_CREDENTIALS - The request body is missing client_id, client_secret, or both.
401
CREDENTIALS_NOT_FOUND - The credentials supplied are not valid.
401
NOT_AUTHORIZED - You do not have permission to perform this action.
400
NOT_SAVED - There was an error saving the resource. Either the resource did not pass validation or there was a server error preventing it from being saved. Check the request and try again.
400
NOT_UPDATED - There was an error saving the resource. Either the resource did not pass validation or there was a server error preventing it from being saved. Check the request and try again.
400
NOT_DELETED - There was an error deleting the resource. Check the request and try again.
PATCH
https://networkcalc.com/api/domains/{domain_id}/subdomains/{subdomain_id}

Update a subdomain

. Update a subdomain in your account.
This endpoint requires authorization. Read about API authorization or see NetworkCalc Pro pricing.

Parameters

{domain_id}

(Optional) The unique ID of the domain.

Example: https://networkcalc.com/api/domains/123/subdomains

{subdomain_id}

(Optional) The unique ID of the subddomain.

Example: https://networkcalc.com/api/domains/subdomains/456

Request Headers

Content-Type
(Required) application/json

Request Body

{
  "prefix": "[string] The prefix for the domain. For example, `my.demo` for `my.demo.networkcalc.com`.",
  "domain_id": "[number] The unique ID of the domain.",
  "domain_report": "[boolean] `true` if this subdomain should be included in any scheduled reports for the domain. Default is `false`."
}

Response Codes

200
OK - Success.
401
MISSING_CREDENTIALS - The request body is missing client_id, client_secret, or both.
401
CREDENTIALS_NOT_FOUND - The credentials supplied are not valid.
401
NOT_AUTHORIZED - You do not have permission to perform this action.
400
NOT_SAVED - There was an error saving the resource. Either the resource did not pass validation or there was a server error preventing it from being saved. Check the request and try again.
400
NOT_UPDATED - There was an error saving the resource. Either the resource did not pass validation or there was a server error preventing it from being saved. Check the request and try again.
400
NOT_DELETED - There was an error deleting the resource. Check the request and try again.
DELETE
https://networkcalc.com/api/domains/{domain_id}

Delete a domain

. Deletes a domain from your account.
This endpoint requires authorization. Read about API authorization or see NetworkCalc Pro pricing.

Parameters

{domain_id}

(Optional) The unique ID of the domain.

Example: https://networkcalc.com/api/domains/123/subdomains

Response Codes

200
OK - Success.
401
MISSING_CREDENTIALS - The request body is missing client_id, client_secret, or both.
401
CREDENTIALS_NOT_FOUND - The credentials supplied are not valid.
401
NOT_AUTHORIZED - You do not have permission to perform this action.
400
NOT_SAVED - There was an error saving the resource. Either the resource did not pass validation or there was a server error preventing it from being saved. Check the request and try again.
400
NOT_UPDATED - There was an error saving the resource. Either the resource did not pass validation or there was a server error preventing it from being saved. Check the request and try again.
400
NOT_DELETED - There was an error deleting the resource. Check the request and try again.
DELETE
https://networkcalc.com/api/domains/{domain_id}/subdomains/{subdomain_id}

Delete a subdomain

. Deletes a subdomain from your account.
This endpoint requires authorization. Read about API authorization or see NetworkCalc Pro pricing.

Parameters

{domain_id}

(Optional) The unique ID of the domain.

Example: https://networkcalc.com/api/domains/123/subdomains

{subdomain_id}

(Optional) The unique ID of the subddomain.

Example: https://networkcalc.com/api/domains/subdomains/456

Response Codes

200
OK - Success.
401
MISSING_CREDENTIALS - The request body is missing client_id, client_secret, or both.
401
CREDENTIALS_NOT_FOUND - The credentials supplied are not valid.
401
NOT_AUTHORIZED - You do not have permission to perform this action.
400
NOT_SAVED - There was an error saving the resource. Either the resource did not pass validation or there was a server error preventing it from being saved. Check the request and try again.
400
NOT_UPDATED - There was an error saving the resource. Either the resource did not pass validation or there was a server error preventing it from being saved. Check the request and try again.
400
NOT_DELETED - There was an error deleting the resource. Check the request and try again.

Response Formats

DomainCreateResponse

{
  "status": "[string] The status of the request.",
  "domain": "[Domain] See DomainResponse."
}

DomainListResponse

{
  "status": "[string] The status of the request.",
  "domains": "[array] An array of all domains saved to your account. See DomainResponse."
}

DomainUpdateResponse

{
  "status": "[string] The status of the request.",
  "message": "[string] A message describing the update, if it was successful."
}

DomainDeleteResponse

{
  "status": "[string] The status of the request."
}

DomainResponse

{
  "status": "[string] The status of the request.",
  "domain": {
    "id": "[number] The unique identifier for the domain.",
    "domain": "[string] The domain name.",
    "report_schedule": "[string] The schedule for domain reports or null. Must be one of: [null, 'daily', 'weekly', 'monthly'].",
    "users": "[array] An array of all users with access to the domain."
  }
}

SubdomainCreateResponse

{
  "status": "[string] The status of the request.",
  "subdomain": "[Subdomain] See SubdomainResponse."
}

SubdomainListResponse

{
  "status": "[string] The status of the request.",
  "subdomains": "[array] An array of all subdomains saved to your account. See SubdomainResponse."
}

SubdomainUpdateResponse

{
  "status": "[string] The status of the request.",
  "message": "[string] A message describing the update, if it was successful."
}

SubdomainDeleteResponse

{
  "status": "[string] The status of the request."
}

SubdomainResponse

{
  "status": "[string] The status of the request.",
  "domain": {
    "id": "[number] The unique identifier for the subdomain.",
    "prefix": "[string] The subdomain's prefix. For example, my.demo for my.demo.networkcalc.com.",
    "domain_id": "[string] The unique ID of the domain this subdomain is associated with.",
    "domain_report": "[boolean] true if this subdomain is included in scheduled reports for the domain, false otherwise.",
    "alerts": "[array] An array of all alerts associated with the subdomain."
  }
}