MonitorsDns monitors
Create DNS Monitor
Creates a new DNS monitor for a customer.
POST /api/dns-monitors
Request Body
{
"customerId": "6bfec6f6-245a-47ce-843b-157d97d56f88",
"name": "Example DNS",
"hostname": "example.com",
"status": "active",
"checkInterval": 30,
"timeoutSeconds": 30,
"dnsConfig": {
"rrtypes": ["A", "AAAA"],
"matchMode": "exact",
"expectedValues": {
"A": ["93.184.216.34"],
"AAAA": ["2606:2800:220:1:248:1893:25c8:1946"]
},
"triggerOn": {
"resolveError": true,
"mismatch": true
}
}
}Notes:
customerId,name,hostname,dnsConfig.rrtypes,dnsConfig.matchMode, anddnsConfig.expectedValuesare required.customerIdaccepts either the internal numeric ID or the customerpublicIdUUID.- Global supporters and readonly users cannot create DNS monitors.
hostnamemust be a hostname (no protocol, no path).dnsConfig.expectedValuesmust contain at least one expected value for every RR type listed indnsConfig.rrtypes.
Example (cURL)
BASE_URL="https://uptimeify.io"
TOKEN="<your-api-token>"
curl -X POST \
"$BASE_URL/api/dns-monitors" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"customerId":"6bfec6f6-245a-47ce-843b-157d97d56f88","name":"Example DNS","hostname":"example.com","dnsConfig":{"rrtypes":["A"],"matchMode":"exact","expectedValues":{"A":["93.184.216.34"]},"triggerOn":{"resolveError":true,"mismatch":true}}}'Common errors
400 Invalid Customer identifier400 hostname must be a valid hostname (no protocol, no path)400 Expected values are required for RR type <TYPE>401 Unauthorized403 Forbidden(readonly/global supporter or no access)404 Customer not found
Response
Returns the created DNS monitor object. See Error Codes for error responses.