About the Alerts API

API Version: 1.9

The Alerts API allows manage alerts saved to your NetworkCalc account.

Alert TypeSubtypesFilters
DNSRecord
  • A
  • CNAME
  • MX
  • TXT
  • equals
  • does notequal
  • contains
  • does not contain
SPFRecordNo subtypes
  • equals
  • does notequal
  • contains
  • does not contain
  • validity
Certificate(TLS)No subtypes
  • subject
  • expires in (days)

Endpoints

GET
https://networkcalc.com/api/alerts/{alert_id}

List alerts

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

Parameters

{alert_id}

(Optional) The unique ID of the alert.

Example: https://networkcalc.com/api/alerts/12345

Response Codes

200
OK - Success.
400
MISSING_HEADER - A required header is missing.
401
NOT_AUTHORIZED - You do not have the necessary permissions.
400
MISSING_VALUES - One of the required parameters is missing from the body.
400
INVALID_BODY - One of the required parameters is invalid. Verify that the type, subtype, and filter are correct.
400
NOT_CREATED - The alert could not be saved. Verify the request and try again.
400
NOT_UPDATED - The alert could not be updated. Verify the request and try again.
400
NOT_DELETED - The alert could not be deleted. Verify the request and try again.
400
NOT_FOUND - A alert with the given ID could not be found.
POST
https://networkcalc.com/api/alerts/

Create an alert

. Save an alert to your account.
This endpoint requires authorization. Read about API authorization or see NetworkCalc Pro pricing.

Parameters

{alert_id}

(Optional) The unique ID of the alert.

Example: https://networkcalc.com/api/alerts/12345

Request Headers

Content-Type
(Required) application/json

Request Body

{
  "type": "[string] The type of alert. Must be one of: ['DNS Record', 'SPF Record', 'Certificate (TLS)'].",
  "subtype": "[string] The subtype of the alert. See alert types for details.",
  "filter": "[string] The filter for the alert. See alert types for details.",
  "filter_value": "[string] The value that will trigger the alert if matched.",
  "target_type": "[string] The type of resource the alert applies to. Must be one of: ['domain', 'subdomain'].",
  "target_id": "[number] The unique identified for the target domain or subdomain (depending on target_type).",
  "name": "[string] A display name for the alert."
}

Response Codes

200
OK - Success.
400
MISSING_HEADER - A required header is missing.
401
NOT_AUTHORIZED - You do not have the necessary permissions.
400
MISSING_VALUES - One of the required parameters is missing from the body.
400
INVALID_BODY - One of the required parameters is invalid. Verify that the type, subtype, and filter are correct.
400
NOT_CREATED - The alert could not be saved. Verify the request and try again.
400
NOT_UPDATED - The alert could not be updated. Verify the request and try again.
400
NOT_DELETED - The alert could not be deleted. Verify the request and try again.
400
NOT_FOUND - A alert with the given ID could not be found.
PATCH
https://networkcalc.com/api/alerts/{alert_id}

Edit an alert

. Edit an alert in your account.
This endpoint requires authorization. Read about API authorization or see NetworkCalc Pro pricing.

Parameters

{alert_id}

(Optional) The unique ID of the alert.

Example: https://networkcalc.com/api/alerts/12345

Request Headers

Content-Type
(Required) application/json

Request Body

{
  "type": "[string] The type of alert. Must be one of: ['DNS Record', 'SPF Record', 'Certificate (TLS)'].",
  "subtype": "[string] The subtype of the alert. See alert types for details.",
  "filter": "[string] The filter for the alert. See alert types for details.",
  "filter_value": "[string] The value that will trigger the alert if matched.",
  "target_type": "[string] The type of resource the alert applies to. Must be one of: ['domain', 'subdomain'].",
  "target_id": "[number] The unique identified for the target domain or subdomain (depending on target_type).",
  "name": "[string] A display name for the alert."
}

Response Codes

200
OK - Success.
400
MISSING_HEADER - A required header is missing.
401
NOT_AUTHORIZED - You do not have the necessary permissions.
400
MISSING_VALUES - One of the required parameters is missing from the body.
400
INVALID_BODY - One of the required parameters is invalid. Verify that the type, subtype, and filter are correct.
400
NOT_CREATED - The alert could not be saved. Verify the request and try again.
400
NOT_UPDATED - The alert could not be updated. Verify the request and try again.
400
NOT_DELETED - The alert could not be deleted. Verify the request and try again.
400
NOT_FOUND - A alert with the given ID could not be found.
DELETE
https://networkcalc.com/api/alerts/

Delete an alert

. Delete an alert in your account.
This endpoint requires authorization. Read about API authorization or see NetworkCalc Pro pricing.

Parameters

{alert_id}

(Optional) The unique ID of the alert.

Example: https://networkcalc.com/api/alerts/12345

Response Codes

200
OK - Success.
400
MISSING_HEADER - A required header is missing.
401
NOT_AUTHORIZED - You do not have the necessary permissions.
400
MISSING_VALUES - One of the required parameters is missing from the body.
400
INVALID_BODY - One of the required parameters is invalid. Verify that the type, subtype, and filter are correct.
400
NOT_CREATED - The alert could not be saved. Verify the request and try again.
400
NOT_UPDATED - The alert could not be updated. Verify the request and try again.
400
NOT_DELETED - The alert could not be deleted. Verify the request and try again.
400
NOT_FOUND - A alert with the given ID could not be found.

Response Formats

AlertResponse

{
  "status": "[string] The status of the request.",
  "alerts": "[array] An array of all alerts matching the request. See AlertResponse."
}

AlertResponse

{
  "id": "[number] The alert's unique identifier.",
  "user_id": "[number] The unique identifier for the user who created the alert.",
  "name": "[string] A display name for the alert.",
  "is_active": "[boolean] true if the alert is active and being checked, false otherwise.",
  "current_status": "[string] The current status of the alert, e.g., healthy, triggered.",
  "type": "[string] The type of alert.",
  "subtype": "[string] The subtype of the alert.",
  "filter": "[string] The filter applied when checking the alert's target resource.",
  "filter_value": "[string] The value compared when checking the alert's target resource.",
  "action": "[string] The response action if the alert is triggered. Currently, only email is supported.",
  "last_triggered_at": "[timestamp] The date and time the alert was last triggered, or null if it has never been triggered/",
  "target_domain": "[DomainResponse] If the alert's resource is a domain, the target domain. See Domain API",
  "target_subdomain": "[DomainResponse] If the alert's resource is a subdomain, the target subdomain. See Domain API"
}

AlertUpdateResponse

{
  "status": "[string] The status of the request.",
  "error": "[string] An error message (if an error occurred)."
}

AlertDeleteResponse

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