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": "deinkunde.com",
"status": "active",
"checkInterval": 30,
"timeoutSeconds": 30,
"allowedCheckCountryCodes": ["DE", "FR"],
"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 cannot create DNS monitors. A readonly or customer-scoped login may create one inside its own customer scope; the monitor is then forced to
self_serviceand refused withselfServiceNotAllowedorselfServiceQuotaReachedwhen the package does not allow it or the quota is used up. hostnamemust be a hostname (no protocol, no path).dnsConfig.expectedValuesmust contain at least one expected value for every RR type listed indnsConfig.rrtypes.allowedCheckCountryCodes(string[], optional)- Restricts checks to these ISO-3166-1 alpha-2 country codes.
- Each entry must be exactly two letters; entries are trimmed, upper-cased and deduplicated before they are stored.
- Omit the key, send
nullor send an empty array to drop the restriction on the monitor; a restriction set on the customer itself still applies. - The two-letter rule checks the form only: a country code without an active check location is accepted, and the monitor then never runs a check.
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":"deinkunde.com","allowedCheckCountryCodes":["DE","FR"],"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>400 Bad Requestwhen anallowedCheckCountryCodesentry is not a two-letter country code; the zod issues are indata401 Unauthorized403 Forbidden(global supporter, a customer outside the caller's scope,selfServiceNotAllowedorselfServiceQuotaReached)404 Customer not found
Response
Returns the created DNS monitor object. See Error Codes for error responses.