Skip to main content

Monitors API

Monitors are the core resource in Sentro. Each monitor periodically checks a target and records whether it is reachable and responsive. Sentro supports four monitor types: HTTP, TCP, PING, and DNS.

Monitor Object​

{
"id": "cly1abc2d0001abcdef012345",
"orgId": "org_abc123",
"name": "Production API",
"monitorType": "HTTP",
"url": "https://api.example.com/health",
"method": "GET",
"intervalSeconds": 60,
"timeoutSeconds": 30,
"status": "ACTIVE",
"expectedStatusCode": 200,
"followRedirects": true,
"confirmationChecks": 2,
"headers": { "Accept": "application/json" },
"port": null,
"dnsRecordType": null,
"dnsExpectedValue": null,
"createdAt": "2025-01-15T08:30:00.000Z",
"updatedAt": "2025-01-15T08:30:00.000Z"
}
FieldTypeDescription
idstringUnique monitor identifier
orgIdstringOrganization that owns the monitor
namestringHuman-readable monitor name
monitorTypestringMonitor type: HTTP, TCP, PING, or DNS
urlstringURL (HTTP) or hostname/IP (TCP/PING/DNS)
methodstringHTTP method (GET, POST, HEAD) — HTTP only
intervalSecondsnumberSeconds between checks (minimum 10)
timeoutSecondsnumberRequest timeout in seconds
statusstringACTIVE or PAUSED
expectedStatusCodenumberExpected HTTP status code (default 200) — HTTP only
followRedirectsbooleanWhether to follow HTTP redirects — HTTP only
confirmationChecksnumberChecks in a row that must agree before an outage or recovery is recorded (default 2)
headersobject|nullCustom HTTP headers sent with each check
portnumber|nullTCP port to connect to — TCP only
dnsRecordTypestring|nullDNS record type (A, AAAA, CNAME, MX, TXT, NS) — DNS only
dnsExpectedValuestring|nullExpected DNS value to match — DNS only
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last update timestamp

List Monitors​

GET /v1/monitors

Returns all monitors belonging to your organization.

Query Parameters​

ParameterTypeDefaultDescription
limitnumber50Number of monitors to return (max 200)
offsetnumber0Number of monitors to skip for pagination

Response​

{
"data": [
{
"id": "cly1abc2d0001abcdef012345",
"orgId": "org_abc123",
"name": "Production API",
"url": "https://api.example.com/health",
"method": "GET",
"intervalSeconds": 60,
"timeoutSeconds": 30,
"status": "ACTIVE",
"expectedStatusCode": 200,
"followRedirects": true,
"confirmationChecks": 2,
"headers": null,
"createdAt": "2025-01-15T08:30:00.000Z",
"updatedAt": "2025-01-15T08:30:00.000Z"
}
],
"meta": {
"total": 1
}
}
Try it

Fetch all monitors in your organization.

GET/v1/monitors?limit=50&offset=0
Query Parameters
Click ⚙ to configure your API key, then hit Send.

Get Monitor​

GET /v1/monitors/:id

Returns a single monitor with its 10 most recent checks.

Path Parameters​

ParameterTypeDescription
idstringThe monitor ID

Response​

{
"data": {
"id": "cly1abc2d0001abcdef012345",
"orgId": "org_abc123",
"name": "Production API",
"url": "https://api.example.com/health",
"method": "GET",
"intervalSeconds": 60,
"timeoutSeconds": 30,
"status": "ACTIVE",
"expectedStatusCode": 200,
"followRedirects": true,
"confirmationChecks": 2,
"headers": null,
"createdAt": "2025-01-15T08:30:00.000Z",
"updatedAt": "2025-01-15T08:30:00.000Z",
"latestChecks": [
{
"id": "chk_abc123",
"monitorId": "cly1abc2d0001abcdef012345",
"statusCode": 200,
"latencyMs": 142,
"isUp": true,
"error": null,
"checkedAt": "2025-01-15T09:30:00.000Z"
}
]
}
}

Error​

{
"error": {
"code": "NOT_FOUND",
"message": "Monitor with id 'mon_invalid' not found"
}
}
Try it

Get a single monitor with its latest checks.

GET/v1/monitors/:id
Path Parameters
Click ⚙ to configure your API key, then hit Send.

Create Monitor​

POST /v1/monitors

Creates a new monitor. The monitor begins checking immediately with status ACTIVE.

Request Body​

FieldTypeRequiredDescription
namestringYesMonitor name (1-100 characters)
monitorTypestringNoHTTP, TCP, PING, or DNS (default: HTTP)
urlstringYesURL (HTTP) or hostname/IP (TCP/PING/DNS)
methodstringNoHTTP method (default: GET) — HTTP only
intervalSecondsnumberNoCheck interval in seconds (default: 60)
timeoutSecondsnumberNoRequest timeout in seconds (default: 30)
expectedStatusCodenumberNoExpected status code (default: 200) — HTTP only
followRedirectsbooleanNoFollow redirects (default: true) — HTTP only
confirmationChecksnumberNoChecks in a row that must agree before an outage or recovery is recorded (default: 2, range: 1-10)
headersobject|nullNoCustom headers as key-value pairs — HTTP only
portnumberTCP onlyTCP port (1-65535) — required for TCP
dnsRecordTypestringDNS onlyA, AAAA, CNAME, MX, TXT, or NS — required for DNS
dnsExpectedValuestringNoExpected DNS value — DNS only
bodyContainsstringNoResponse body must contain this string — HTTP only
bodyNotContainsstringNoResponse body must NOT contain this string — HTTP only
degradedThresholdMsnumberNoLatency above this (ms) marks monitor as degraded
groupIdstring|nullNoMonitor group ID for categorization

Example: HTTP Monitor​

{
"name": "Production API",
"url": "https://api.example.com/health",
"method": "GET",
"intervalSeconds": 60,
"timeoutSeconds": 30,
"expectedStatusCode": 200,
"followRedirects": true,
"confirmationChecks": 2,
"headers": {
"Accept": "application/json",
"X-Custom-Header": "monitoring"
}
}

Response 201 Created​

{
"data": {
"id": "cly1abc2d0001abcdef012345",
"orgId": "org_abc123",
"name": "Production API",
"url": "https://api.example.com/health",
"method": "GET",
"intervalSeconds": 60,
"timeoutSeconds": 30,
"status": "ACTIVE",
"expectedStatusCode": 200,
"followRedirects": true,
"confirmationChecks": 2,
"headers": {
"Accept": "application/json",
"X-Custom-Header": "monitoring"
},
"createdAt": "2025-01-15T08:30:00.000Z",
"updatedAt": "2025-01-15T08:30:00.000Z"
}
}

Validation Error​

{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid monitor data",
"details": {
"url": ["Invalid URL format"],
"intervalSeconds": ["Must be at least 30"]
}
}
}
Try it

Create a new monitor that starts checking immediately.

POST/v1/monitors
Request Body
Click ⚙ to configure your API key, then hit Send.

Example: TCP Monitor​

{
"name": "Database Port Check",
"monitorType": "TCP",
"url": "db.example.com",
"port": 5432,
"intervalSeconds": 30,
"timeoutSeconds": 10
}

Example: PING Monitor​

{
"name": "Server Ping",
"monitorType": "PING",
"url": "server.example.com",
"intervalSeconds": 60,
"timeoutSeconds": 10
}

Example: DNS Monitor​

{
"name": "DNS A Record",
"monitorType": "DNS",
"url": "example.com",
"dnsRecordType": "A",
"dnsExpectedValue": "93.184.216.34",
"intervalSeconds": 300
}

Example: HTTP with Keyword Monitoring & Degraded Threshold​

{
"name": "API with Content Check",
"url": "https://api.example.com/health",
"bodyContains": "\"status\":\"ok\"",
"bodyNotContains": "maintenance",
"degradedThresholdMs": 2000,
"intervalSeconds": 30
}

Update Monitor​

PATCH /v1/monitors/:id

Updates an existing monitor. Only the fields you include in the request body will be updated.

Path Parameters​

ParameterTypeDescription
idstringThe monitor ID

Request Body​

All fields are optional. Include only the fields you want to change.

FieldTypeDescription
namestringUpdated monitor name
urlstringUpdated URL to monitor
methodstringUpdated HTTP method
intervalSecondsnumberUpdated check interval
timeoutSecondsnumberUpdated request timeout
expectedStatusCodenumberUpdated expected status code
followRedirectsbooleanUpdated redirect behavior
confirmationChecksnumberUpdated confirmation threshold (range: 1-10)
headersobject|nullUpdated custom headers (null to clear)
bodyContainsstringUpdated keyword check
bodyNotContainsstringUpdated negative keyword check
degradedThresholdMsnumber|nullUpdated degraded threshold (null to disable)
groupIdstring|nullUpdated monitor group

Example Request​

{
"name": "Production API (v2)",
"intervalSeconds": 30
}

Response 200 OK​

{
"data": {
"id": "cly1abc2d0001abcdef012345",
"orgId": "org_abc123",
"name": "Production API (v2)",
"url": "https://api.example.com/health",
"method": "GET",
"intervalSeconds": 30,
"timeoutSeconds": 30,
"status": "ACTIVE",
"expectedStatusCode": 200,
"followRedirects": true,
"confirmationChecks": 2,
"headers": null,
"createdAt": "2025-01-15T08:30:00.000Z",
"updatedAt": "2025-01-15T09:00:00.000Z"
}
}
Try it

Update specific fields on an existing monitor.

PATCH/v1/monitors/:id
Path Parameters
Request Body
Click ⚙ to configure your API key, then hit Send.

Delete Monitor​

DELETE /v1/monitors/:id

Permanently deletes a monitor and all its associated check history.

Path Parameters​

ParameterTypeDescription
idstringThe monitor ID

Response 200 OK​

{
"data": {
"id": "cly1abc2d0001abcdef012345",
"deleted": true
}
}

Error​

{
"error": {
"code": "NOT_FOUND",
"message": "Monitor with id 'mon_invalid' not found"
}
}
Try it

Permanently delete a monitor and all its check history.

DELETE/v1/monitors/:id
Path Parameters
Click ⚙ to configure your API key, then hit Send.