Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/LENINMORENO13/OpsMind/llms.txt

Use this file to discover all available pages before exploring further.

Monitors are the core resource in OpsMind. Each monitor tracks a single HTTP endpoint and accumulates a history of status checks, response times, and AI-generated insights. All monitor endpoints are protected by JWT authentication — make sure you include a valid Authorization: Bearer <token> header on every request (see the Authentication guide for details).
The isActive field defaults to true and checkInterval defaults to 300 seconds (5 minutes). These are the schema defaults used by the background cron worker. You can supply isActive and checkInterval in the body of a PATCH request to override them for a specific monitor.
Use descriptive, unique names for your monitors. The GET /api/v1/monitors/status/:site endpoint looks up a monitor by its name field using a case-insensitive match, so a name like "Payment API" can be queried as payment api, PAYMENT API, or any other casing.

Create a monitor

Register a new HTTP endpoint for monitoring by sending a POST request to /api/v1/monitors. Both name and url are required. OpsMind enforces URL uniqueness across all monitors — attempting to register an already-monitored URL returns a 400 error.
cURL
curl -X POST https://opsmind-e07b.onrender.com/api/v1/monitors \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Payment API",
    "url": "https://api.myapp.com/payments/health"
  }'
Success — 201 Created
Response
{
  "success": true,
  "message": "Monitor created successfully",
  "data": {
    "id": 4,
    "url": "https://api.myapp.com/payments/health",
    "name": "Payment API",
    "isActive": true,
    "checkInterval": 300,
    "lastStatus": "PENDING",
    "createdAt": "2025-01-15T10:30:00.000Z",
    "updatedAt": "2025-01-15T10:30:00.000Z"
  }
}
Error cases
StatusCondition
400name or url is missing from the request body
400A monitor with the same url already exists
401Missing or invalid JWT token
500Unexpected server error

List all monitors

Retrieve every registered monitor with a GET request to /api/v1/monitors. The response contains a flat array of monitor objects — no pagination is applied, so the full list is returned in a single call.
cURL
curl https://opsmind-e07b.onrender.com/api/v1/monitors \
  -H "Authorization: Bearer <token>"
Success — 200 OK
Response
{
  "success": true,
  "data": [
    {
      "id": 1,
      "url": "https://api.myapp.com/health",
      "name": "Main API",
      "isActive": true,
      "checkInterval": 300,
      "lastStatus": "UP",
      "createdAt": "2025-01-10T08:00:00.000Z",
      "updatedAt": "2025-01-15T10:00:00.000Z"
    },
    {
      "id": 2,
      "url": "https://dashboard.myapp.com",
      "name": "Dashboard",
      "isActive": true,
      "checkInterval": 300,
      "lastStatus": "DEGRADED",
      "createdAt": "2025-01-11T09:00:00.000Z",
      "updatedAt": "2025-01-15T09:55:00.000Z"
    }
  ]
}
Monitor object fields
FieldTypeDescription
idintegerAuto-incremented primary key
namestringHuman-readable label for the monitor
urlstringThe HTTP endpoint being monitored (unique)
isActivebooleanWhether the cron worker includes this monitor in its checks
checkIntervalintegerPolling interval in seconds (default 300)
lastStatusServiceStatusMost recent status: UP, DOWN, DEGRADED, or PENDING
createdAtdatetimeISO 8601 timestamp of creation
updatedAtdatetimeISO 8601 timestamp of last modification

Update a monitor

Partially update a monitor’s name, url, isActive, or checkInterval using a PATCH request to /api/v1/monitors/:id. Only the fields you include in the request body are changed — omitted fields remain unchanged.
cURL
curl -X PATCH https://opsmind-e07b.onrender.com/api/v1/monitors/4 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Payments Health Check",
    "url": "https://api.myapp.com/v2/payments/health"
  }'
Success — 200 OK
Response
{
  "success": true,
  "message": "Monitor updated successfully",
  "data": {
    "id": 4,
    "url": "https://api.myapp.com/v2/payments/health",
    "name": "Payments Health Check",
    "isActive": true,
    "checkInterval": 300,
    "lastStatus": "PENDING",
    "createdAt": "2025-01-15T10:30:00.000Z",
    "updatedAt": "2025-01-15T11:00:00.000Z"
  }
}
Error cases
StatusCondition
400:id is not a valid integer
404No monitor found with the given id (Prisma record-not-found)
409The new url already belongs to a different monitor ("URL_DUPLICATED")
401Missing or invalid JWT token
500Unexpected server error

Delete a monitor

Permanently remove a monitor and all of its associated data by sending a DELETE request to /api/v1/monitors/:id. The Prisma schema uses onDelete: Cascade, so all Log records and AIInsight records linked to this monitor are automatically removed from the database in the same operation.
cURL
curl -X DELETE https://opsmind-e07b.onrender.com/api/v1/monitors/4 \
  -H "Authorization: Bearer <token>"
Success — 200 OK
Response
{
  "success": true,
  "message": "Monitor deleted successfully",
  "data": {
    "id": 4,
    "url": "https://api.myapp.com/v2/payments/health",
    "name": "Payments Health Check",
    "isActive": true,
    "checkInterval": 300,
    "lastStatus": "PENDING",
    "createdAt": "2025-01-15T10:30:00.000Z",
    "updatedAt": "2025-01-15T11:00:00.000Z"
  }
}
Error cases
StatusCondition
400:id is not a valid integer
404No monitor found with the given id
401Missing or invalid JWT token
500Unexpected server error

View monitor history

Query the last 10 check logs for any monitor by its ID.

Real-time status

Run a live health check across all registered monitors at once.

Build docs developers (and LLMs) love