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.

The Delete Monitor endpoint permanently removes a monitor from OpsMind by its numeric ID. Before deletion, the endpoint verifies that the monitor exists and that the provided ID is a valid integer — rejecting the request early if either check fails. Because deletion is irreversible, take care to confirm the correct ID before calling this endpoint in production environments.

Endpoint

DELETE /api/v1/monitors/:id
Deleting a monitor is permanent and irreversible. Due to the onDelete: Cascade constraint defined in the Prisma schema, all Log records and AIInsight records associated with this monitor are automatically deleted along with the monitor itself. Historical trend data and AI-generated analyses cannot be recovered after deletion.
All requests must include a valid JWT in the Authorization header. The id path parameter must be a valid integer — non-numeric values are rejected with a 400 before any database query is executed.

Request

Headers

HeaderValueRequired
AuthorizationBearer <token>✅ Yes
Content-Typeapplication/jsonOptional

Path Parameters

id
integer
required
The numeric ID of the monitor to delete. Must parse as a valid integer. Non-numeric values (e.g. "abc") are rejected immediately with 400 Invalid ID format before any database query is made.

Curl Example

curl --request DELETE \
  --url https://your-opsmind-host/api/v1/monitors/3 \
  --header "Authorization: Bearer <your_jwt_token>"

Response

200 — Success

Returns a JSON envelope with the deleted Monitor object inside data. This snapshot reflects the monitor’s final state at the moment of deletion.
{
  "success": true,
  "message": "Monitor deleted successfully",
  "data": {
    "id": 3,
    "url": "https://api.payments.internal/v2/health",
    "name": "payments-service-v2",
    "isActive": true,
    "checkInterval": 300,
    "lastStatus": "UP",
    "createdAt": "2024-11-20T10:05:00.000Z",
    "updatedAt": "2024-11-21T09:00:00.000Z"
  }
}
The returned object is a snapshot of the monitor as it existed just before deletion. All cascaded child records (Log, AIInsight) are also deleted at the database level but are not included in this response.

Error Responses

400 — Invalid ID Format

Returned when the :id path parameter cannot be parsed as an integer. No database query is executed.
{
  "success": false,
  "error": "Invalid ID format"
}

404 — Monitor Not Found

Returned when no monitor with the provided ID exists in the database. OpsMind explicitly checks for existence before attempting deletion.
{
  "success": false,
  "error": "Monitor not found"
}

401 — Unauthorized

Returned when the Authorization header is missing, malformed, or the token has expired.
{
  "success": false,
  "error": "Unauthorized"
}

500 — Internal Server Error

Returned for unexpected database or application errors during the deletion process.
{
  "success": false,
  "error": "Failed to delete monitor"
}

Build docs developers (and LLMs) love