### Fetch Monitors with API Key Source: https://docs.unstatus.app/docs/errors Use this snippet to fetch a list of monitors from the Unstatus App API. Ensure you replace 'YOUR_API_KEY' with your actual API key. This example demonstrates making a GET request with an Authorization header. ```javascript const res = await fetch("https://unstatus.app/api/v1/monitors", { headers: { Authorization: `Bearer ${apiKey}` } }); if (!res.ok) { const {error} = await res.json(); throw new Error(error); } const {monitors} = await res.json(); ``` -------------------------------- ### POST /api/v1/maintenance/:id/start Source: https://docs.unstatus.app/llms-full.txt Start a maintenance window. ```APIDOC ## POST /api/v1/maintenance/:id/start ### Description Moves a scheduled window to 'in_progress' status and sends notifications. ### Method POST ### Endpoint /api/v1/maintenance/:id/start ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the maintenance window ``` -------------------------------- ### cURL Request Example for Incident Creation Source: https://docs.unstatus.app/docs/api-reference/incidents Example of how to create an incident using cURL. This snippet demonstrates the basic structure of the request, including the HTTP method and endpoint. ```bash 22:[\ ``` ```bash $L19\",null,{\"className\":\ ``` ```bash shiki shiki-themes github-light github-dark\",\ ``` ```bash style\":{\"--shiki-light\":\ ``` ```bash #24292e\",\ ``` ```bash --shiki-dark\":\ ``` ```bash #e1e4e8\",\ ``` ```bash --shiki-light-bg\":\ ``` ```bash #fff\",\ ``` ```bash --shiki-dark-bg\":\ ``` ```bash #24292e\"},\ ``` ```bash tabIndex\":\ ``` ```bash 0\",\ ``` ```bash icon\":\ ``` ```bash \u003csvg viewBox=\\\ ``` ```bash 0 0 24 24\\\ ``` ```bash \u003e\u003cpath d=\\\ ``` ```bash m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z\\\ ``` ```bash fill=\\\ ``` ```bash currentColor\\\ ``` ```bash /\u003e\u003c/svg\u003e\",\ ``` ```bash children\":[\ ``` ```bash $L1a\",null,{\"children\":[\ ``` ```bash code\",null,{\"children\":[[\ ``` ```bash span\",null,{\"className\":\ ``` ```bash line\",\ ``` ```bash children\":[\ ``` ```bash span\",null,{\"style\":{\"--shiki-light\":\ ``` ```bash #6F42C1\",\ ``` ```bash --shiki-dark\":\ ``` ```bash #B392F0\"},\ ``` ```bash children\":\ ``` ```bash curl\ ``` ```bash \ ``` ```bash \ ``` ```bash span\",null,{\"style\":{\"--shiki-light\":\ ``` ```bash #005CC5\",\ ``` ```bash --shiki-dark\":\ ``` ```bash #79B8FF\"},\ ``` ```bash children\":\ ``` ```bash -X\ ``` ```bash \ ``` ```bash \ ``` ```bash ]]}\]]}]}]\ ``` -------------------------------- ### Start Maintenance Source: https://docs.unstatus.app/docs/api-reference/maintenance Marks a maintenance window as 'in_progress'. ```APIDOC ## Start Maintenance ### Description Initiates a maintenance window, changing its status to 'in_progress'. This will ensure affected monitors are excluded from alerting. ### Method POST ### Endpoint /api/v1/maintenance/{id}/start ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the maintenance window to start. ### Response #### Success Response (200) - **id** (string) - The unique identifier for the maintenance window. - **status** (string) - The updated status, which will be 'in_progress'. #### Response Example ```json { "id": "mw_12345", "status": "in_progress" } ``` ``` -------------------------------- ### Get Monitor by ID - cURL Example Source: https://docs.unstatus.app/docs/api-reference/monitors Use this cURL command to retrieve a single monitor by its ID. Ensure you replace ':id' with the actual monitor ID and include your API key in the Authorization header. ```bash curl https://unstatus.app/api/v1/monitors/clx1abc... \ -H "Authorization: Bearer usk_your_key" ``` -------------------------------- ### Example Incident Response JSON Source: https://docs.unstatus.app/docs/api-reference/incidents This is an example of the JSON response structure for a GET incident request. It includes incident data such as ID, title, status, and timeline. ```JSON { "data": { "id": "inc_...", "title": "API degraded performance", "status": "investigating", } ``` -------------------------------- ### Example Response Headers Source: https://docs.unstatus.app/docs/rate-limiting These headers are included in every API response to indicate rate limit status. ```text X-RateLimit-Limit: 1000 X-RateLimit-Remaining: 847 X-RateLimit-Reset: 1714636800 ``` -------------------------------- ### GET /api/v1/monitors Source: https://docs.unstatus.app/llms-full.txt Returns a paginated list of all monitors in your organization. ```APIDOC ## GET /api/v1/monitors ### Description Returns a paginated list of all monitors in your organization. ### Method GET ### Endpoint /api/v1/monitors ### Parameters #### Query Parameters - **limit** (number) - Optional - Default 20, max 100 - **offset** (number) - Optional - Default 0 ### Response #### Success Response (200) - **data** (array) - List of monitor objects - **pagination** (object) - Pagination metadata ``` -------------------------------- ### List Maintenance Windows Source: https://docs.unstatus.app/docs/api-reference/maintenance Retrieve a list of all maintenance windows using a GET request. ```bash curl https://unstatus.app/api/v1/maintenance \ -H "Authorization: Bearer usk_your_key" ``` -------------------------------- ### Start Maintenance Source: https://docs.unstatus.app/docs/api-reference/maintenance Moves a scheduled maintenance window to 'in_progress' state and sends notifications. ```APIDOC ## Start Maintenance ### Description Moves a scheduled maintenance window to `in_progress`. Sends notifications. ### Method POST ### Endpoint `/api/v1/maintenance/:id/start` ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the maintenance window to start. ### Request Example (Request example not provided in the source text) ### Response #### Success Response (200) - **(Maintenance Window Object)** - Description of the response structure is not provided in the source text. #### Response Example (Response example not provided in the source text) ``` -------------------------------- ### GET /api/v1/maintenance Source: https://docs.unstatus.app/llms-full.txt List all maintenance windows. ```APIDOC ## GET /api/v1/maintenance ### Description Retrieve a list of all maintenance windows. ### Method GET ### Endpoint /api/v1/maintenance ``` -------------------------------- ### Start Maintenance Source: https://docs.unstatus.app/docs/api-reference/maintenance Initiates a maintenance window, moving its status to 'in_progress'. Notifications are sent upon execution. ```APIDOC ## POST /api/v1/maintenance/:id/start ### Description Initiates a maintenance window, moving its status to 'in_progress'. Sends notifications. ### Method POST ### Endpoint /api/v1/maintenance/:id/start ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the maintenance window to start. ### Request Body (No request body is expected for this operation.) ### Response #### Success Response (200) (Success response details are not provided in the source text.) #### Response Example (Response example is not provided in the source text.) ``` -------------------------------- ### List Status Pages Source: https://docs.unstatus.app/docs/api-reference/status-pages Retrieve all status pages and their associated monitors using a GET request. ```bash curl https://unstatus.app/api/v1/status-pages \ -H "Authorization: Bearer usk_your_key" ``` -------------------------------- ### Get Monitor by ID Source: https://docs.unstatus.app/llms-full.txt Fetches a single monitor's details using its unique identifier. ```bash curl https://unstatus.app/api/v1/monitors/clx1abc... \ -H "Authorization: Bearer usk_your_key" ``` -------------------------------- ### List Notification Channels Response Source: https://docs.unstatus.app/llms-full.txt Example JSON response when listing notification channels. ```json { "data": [ { "id": "nc_...", "name": "Engineering Discord", "type": "discord", "webhookUrl": "https://discord.com/api/webhooks/...", "enabled": true, "onMonitorDown": true, "onMonitorRecovered": true, "onIncidentCreated": true, "onIncidentResolved": true, "onIncidentUpdated": true, "onMaintenanceScheduled": true, "onMaintenanceStarted": true, "onMaintenanceCompleted": true } ], "pagination": { "total": 1, "limit": 20, "offset": 0, "hasMore": false } } ``` -------------------------------- ### API Response Data Structure Source: https://docs.unstatus.app/llms-full.txt This is an example of a successful API response, showing the 'data' array containing monitor objects and 'pagination' details. ```json { "data": [ { "id": "clx1abc...", "name": "API Server", "type": "http", "active": true, "currentStatus": "up" } ], "pagination": { "total": 1, "limit": 20, "offset": 0, "hasMore": false } } ``` -------------------------------- ### List Monitors API Endpoint Source: https://docs.unstatus.app/docs/api-reference/monitors Use this GET request to retrieve a paginated list of all monitors in your organization. Supports 'limit' and 'offset' query parameters. ```bash curl https://unstatus.app/api/v1/monitors?limit=10 \ -H ``` -------------------------------- ### GET /api/v1/monitors/{id} Source: https://docs.unstatus.app/docs/api-reference/monitors Retrieves details for a specific monitor by its ID. ```APIDOC ## GET /api/v1/monitors/{id} ### Description Retrieves details for a specific monitor by its ID. ### Method GET ### Endpoint /api/v1/monitors/{id} ### Path Parameters - **id** (string) - Required - The unique identifier of the monitor. ### Request Example ```bash curl -X GET \ 'https://unstatus.app/api/v1/monitors/monitor-123' \ -H 'Authorization: Bearer YOUR_API_KEY' ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the monitor. - **name** (string) - The name of the monitor. - **type** (string) - The type of check (e.g., 'http', 'tcp', 'ping'). - **url** (string) - The URL or address being monitored. - **interval** (integer) - The check interval in seconds. - **enabled** (boolean) - Whether the monitor is currently enabled. - **created_at** (string) - The timestamp when the monitor was created. - **updated_at** (string) - The timestamp when the monitor was last updated. #### Response Example ```json { "id": "monitor-123", "name": "Example Website", "type": "http", "url": "https://example.com", "interval": 60, "enabled": true, "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### GET /api/v1/status-pages Source: https://docs.unstatus.app/docs/api-reference/status-pages Returns a list of all status pages associated with the account, including their linked monitors. ```APIDOC ## GET /api/v1/status-pages ### Description Returns all status pages with their linked monitors. ### Method GET ### Endpoint /api/v1/status-pages ### Request Example ```bash curl https://unstatus.app/api/v1/status-pages \ -H "Authorization: Bearer usk_your_key" ``` ``` -------------------------------- ### GET /api/v1/status-pages Source: https://docs.unstatus.app/docs/api-reference/status-pages Returns a list of all status pages associated with the account, including their linked monitors. ```APIDOC ## GET /api/v1/status-pages ### Description Returns all status pages with their linked monitors. ### Method GET ### Endpoint /api/v1/status-pages ### Response #### Success Response (200) - **data** (array) - List of status page objects - **pagination** (object) - Pagination metadata #### Response Example { "data": [ { "id": "sp_...", "name": "Acme Status", "slug": "acme", "isPublic": true, "brandColor": "#000000", "monitors": [ { "id": "spm_...", "monitorId": "clx1abc...", "displayName": "API", "sortOrder": 0, "monitor": { "id": "clx1abc...", "name": "API Server" } } ] } ], "pagination": { "total": 1, "limit": 20, "offset": 0, "hasMore": false } } ``` -------------------------------- ### Handle API Errors with Fetch Source: https://docs.unstatus.app/docs/errors Example of checking response status and parsing error details from the API response. ```javascript const res = await fetch("https://unstatus.app/api/v1/monitors", { headers: { Authorization: `Bearer ${apiKey}` }, }); if (!res.ok) { const { error } = await res.json(); console.error(`API error: ${error.code} - ${error.message}`); // Handle specific codes if (error.code === "UNAUTHORIZED") { // Re-authenticate } } ``` -------------------------------- ### Handling API Errors Source: https://docs.unstatus.app/docs/errors Example implementation for handling API errors using the fetch API. ```APIDOC ## Handling Errors ### Description Example of how to check for errors in a response and handle specific error codes. ### Request Example const res = await fetch("https://unstatus.app/api/v1/monitors", { headers: { Authorization: `Bearer ${apiKey}` }, }); if (!res.ok) { const { error } = await res.json(); console.error(`API error: ${error.code} - ${error.message}`); // Handle specific codes if (error.code === "UNAUTHORIZED") { // Re-authenticate } } ``` -------------------------------- ### Get Organization Details Source: https://docs.unstatus.app/llms-full.txt Retrieves organization information associated with the provided API key. Requires an Authorization header with a Bearer token. ```bash curl https://unstatus.app/api/v1/organization \ -H "Authorization: Bearer usk_your_key" ``` ```json { "data": { "id": "org_...", "name": "Acme Inc", "slug": "acme", "logo": null, "createdAt": "2025-01-01T00:00:00Z", "subscriptionActive": true, "subscriptionPlanName": "Pro", "cancelAtPeriodEnd": false, "plan": "pro" } } ``` -------------------------------- ### List Status Pages Response Source: https://docs.unstatus.app/docs/api-reference/status-pages Example JSON response structure for the list status pages endpoint. ```json { "data": [ { "id": "sp_...", "name": "Acme Status", "slug": "acme", "isPublic": true, "brandColor": "#000000", "monitors": [ { "id": "spm_...", "monitorId": "clx1abc...", "displayName": "API", "sortOrder": 0, "monitor": { "id": "clx1abc...", "name": "API Server" } } ] } ], "pagination": { "total": 1, "limit": 20, "offset": 0, "hasMore": false } } ``` -------------------------------- ### Get Incident Details Source: https://docs.unstatus.app/llms-full.txt Fetches a specific incident by its ID, including its update timeline and affected monitors. This endpoint is free to use. ```json { "data": { "id": "inc_...", "title": "API degraded performance", "status": "investigating", "severity": "major", "startedAt": "2025-01-15T10:00:00Z", "resolvedAt": null, "updates": [ { "id": "upd_...", "status": "investigating", "message": "We are investigating elevated error rates.", "createdAt": "2025-01-15T10:00:00Z" } ], "monitors": [ { "monitor": { "id": "clx1abc...", "name": "API Server" } } ] } } ``` -------------------------------- ### Create a Monitor via cURL Source: https://docs.unstatus.app/docs/api-reference/monitors Use this command to register a new monitor. Replace 'usk_your_key' with your actual API key. ```bash curl -X POST https://unstatus.app/api/v1/monitors \ -H "Authorization: Bearer usk_your_key" \ -H "Content-Type: application/json" \ -d '{ "name": "API Server", "type": "http", "url": "https://api.example.com/health", "interval": 30, "regions": ["eu", "us"] }' ``` -------------------------------- ### Update Status Page using cURL Source: https://docs.unstatus.app/docs/api-reference/status-pages This section details how to update an existing status page. The example shows the structure for the API call, but specific update parameters would be detailed in the full API documentation. ```bash curl -X POST https://unstatus.app/api/v1/status-pages ``` -------------------------------- ### Create Monitor Source: https://docs.unstatus.app/docs/api-reference/monitors Creates a new monitor with specified details. Supports HTTP, TCP, and ping types. Maximum 50 monitors per organization. ```bash curl -X POST https://unstatus.app/api/v1/monitors \ -H "Authorization: Bearer usk_your_key" \ -H "Content-Type: application/json" \ -d '{ \ "name": "API Server", \ "type": "http", \ "url": "https://api.example.com/health", \ "interval": 30, \ "regions": ["eu", "us"] \ }' ``` -------------------------------- ### Get Status Page Endpoint Source: https://docs.unstatus.app/docs/api-reference/status-pages This defines the GET endpoint for retrieving status page information. It requires the status page ID in the URL. ```http GET /api/v1/status-pages/:id ``` -------------------------------- ### POST /api/v1/monitors Source: https://docs.unstatus.app/docs/api-reference/monitors Creates a new monitor. ```APIDOC ## POST /api/v1/monitors ### Description Creates a new monitor. ### Method POST ### Endpoint /api/v1/monitors ### Request Body - **name** (string) - Required - The name of the monitor. - **type** (string) - Required - The type of check (e.g., 'http', 'tcp', 'ping'). - **url** (string) - Required - The URL or address to monitor. - **interval** (integer) - Optional - The check interval in seconds (default 60). - **enabled** (boolean) - Optional - Whether the monitor should be enabled (default true). ### Request Example ```json { "name": "New Service Monitor", "type": "http", "url": "https://newservice.com", "interval": 300, "enabled": true } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier for the newly created monitor. - **name** (string) - The name of the monitor. - **type** (string) - The type of check. - **url** (string) - The URL or address being monitored. - **interval** (integer) - The check interval in seconds. - **enabled** (boolean) - Whether the monitor is enabled. - **created_at** (string) - The timestamp when the monitor was created. - **updated_at** (string) - The timestamp when the monitor was last updated. #### Response Example ```json { "id": "monitor-456", "name": "New Service Monitor", "type": "http", "url": "https://newservice.com", "interval": 300, "enabled": true, "created_at": "2023-10-27T11:00:00Z", "updated_at": "2023-10-27T11:00:00Z" } ``` ``` -------------------------------- ### Run a Monitor via API Source: https://docs.unstatus.app/docs/api-reference/monitors Use this cURL command to trigger a monitor run. Replace `clx1abc...` with your monitor ID and `usk_your_key` with your actual API key. Ensure the Authorization header is correctly formatted. ```bash curl \ -X POST \ https://unstatus.app/api/v1/monitors/clx1abc.../run \ -H "Authorization: Bearer usk_your_key" ``` -------------------------------- ### Create Maintenance Window Source: https://docs.unstatus.app/docs/api-reference/maintenance Create a new maintenance window by sending a POST request with the required schedule and monitor details. ```bash curl -X POST https://unstatus.app/api/v1/maintenance \ -H "Authorization: Bearer usk_your_key" \ -H "Content-Type: application/json" \ -d '{ "title": "Database migration", "description": "Upgrading to PostgreSQL 17", "scheduledStart": "2025-02-01T02:00:00Z", "scheduledEnd": "2025-02-01T04:00:00Z", "monitorIds": ["clx1abc..."] }' ``` -------------------------------- ### GET /api/v1/incidents Source: https://docs.unstatus.app/llms-full.txt Retrieves a list of all incidents for the organization. ```APIDOC ## GET /api/v1/incidents ### Description Returns all incidents for your organization, including updates and affected monitors. ### Method GET ### Endpoint /api/v1/incidents ### Request Example curl https://unstatus.app/api/v1/incidents \ -H "Authorization: Bearer usk_your_key" ``` -------------------------------- ### Create HTTP Monitor Source: https://docs.unstatus.app/llms-full.txt Creates a new HTTP monitor. Requires `name`, `type`, and `url`. Optional fields include `interval`, `regions`, and more. Maximum 50 monitors per organization. ```bash curl -X POST https://unstatus.app/api/v1/monitors \ -H "Authorization: Bearer usk_your_key" \ -H "Content-Type: application/json" \ -d '{ "name": "API Server", "type": "http", "url": "https://api.example.com/health", "interval": 30, "regions": ["eu", "us"] }' ``` -------------------------------- ### List Maintenance Windows Source: https://docs.unstatus.app/docs/api-reference/maintenance Use this endpoint to retrieve a list of all maintenance windows. It is a free endpoint. ```bash curl https://unstatus.app/api/v1/maintenance \ -H ``` -------------------------------- ### Get Incident API Source: https://docs.unstatus.app/docs/api-reference/incidents Retrieves a specific incident by its ID. ```APIDOC ## GET /api/v1/incidents/{incident_id} ### Description Retrieves a specific incident by its ID. ### Method GET ### Endpoint /api/v1/incidents/{incident_id} ### Parameters #### Path Parameters - **incident_id** (string) - Required - The unique identifier of the incident to retrieve. ### Request Example ```bash curl https://unstatus.app/api/v1/incidents/inc_abc123 \ -H "Authorization: Bearer usk_your_key" ``` ### Response #### Success Response (200) - **incident** (object) - The incident object. - **id** (string) - The unique identifier of the incident. - **name** (string) - The name of the incident. - **status** (string) - The current status of the incident. - **impact** (string) - The impact level of the incident. - **created_at** (string) - The timestamp when the incident was created. - **updated_at** (string) - The timestamp when the incident was last updated. - **monitoring_urls** (array) - A list of URLs being monitored for this incident. #### Response Example ```json { "incident": { "id": "inc_abc123", "name": "Service Outage on Main Server", "status": "investigating", "impact": "major", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:30:00Z", "monitoring_urls": [ "https://example.com/status" ] } } ``` ``` -------------------------------- ### GET /api/v1/incidents/:id Source: https://docs.unstatus.app/docs/api-reference/incidents Retrieve details for a specific incident. ```APIDOC ## GET /api/v1/incidents/:id ### Description Returns an incident with its full update timeline and affected monitors. ### Method GET ### Endpoint /api/v1/incidents/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the incident. ### Response #### Success Response (200) - **data** (object) - Incident details including title, status, severity, timestamps, updates, and monitors. #### Response Example { "data": { "id": "inc_...", "title": "API degraded performance", "status": "investigating", "severity": "major", "startedAt": "2025-01-15T10:00:00Z", "resolvedAt": null, "updates": [ { "id": "upd_...", "status": "investigating", "message": "We are investigating elevated error rates.", "createdAt": "2025-01-15T10:00:00Z" } ], "monitors": [ { "monitor": { "id": "clx1abc...", "name": "API Server" } } ] } } ``` -------------------------------- ### GET /api/v1/checks Source: https://docs.unstatus.app/docs/api-reference/monitors Retrieves a paginated list of all checks performed by monitors. ```APIDOC ## GET /api/v1/checks ### Description Retrieves a paginated list of all checks performed by monitors. ### Method GET ### Endpoint /api/v1/checks ### Query Parameters - **monitor_id** (string) - Optional - Filter checks by a specific monitor ID. - **limit** (integer) - Optional - Default 20, max 100. - **offset** (integer) - Optional - Default 0. ### Request Example ```bash curl -X GET \ 'https://unstatus.app/api/v1/checks?monitor_id=monitor-123&limit=5' \ -H 'Authorization: Bearer YOUR_API_KEY' ``` ### Response #### Success Response (200) - **checks** (array) - A list of check result objects. - **id** (string) - The unique identifier for the check. - **monitor_id** (string) - The ID of the monitor that performed the check. - **status** (string) - The status of the check ('up', 'down', 'unknown'). - **response_time** (integer) - The response time in milliseconds. - **timestamp** (string) - The timestamp when the check was performed. #### Response Example ```json { "checks": [ { "id": "check-abc", "monitor_id": "monitor-123", "status": "up", "response_time": 150, "timestamp": "2023-10-27T10:01:00Z" } ], "total": 1 } ``` ``` -------------------------------- ### POST /api/v1/monitors Source: https://docs.unstatus.app/llms-full.txt Creates a new monitor for the organization. ```APIDOC ## POST /api/v1/monitors ### Description Creates a new monitor. Maximum 50 monitors per organization. ### Method POST ### Endpoint /api/v1/monitors ### Parameters #### Request Body - **name** (string) - Required - Display name - **type** (string) - Required - http, tcp, or ping - **url** (string) - For HTTP - URL to check - **host** (string) - For TCP - Hostname - **port** (number) - For TCP - Port number - **interval** (number) - Optional - Check interval in seconds - **timeout** (number) - Optional - Timeout in seconds - **method** (string) - Optional - HTTP method - **headers** (object) - Optional - HTTP headers - **body** (string) - Optional - HTTP request body - **regions** (array) - Optional - Regions to check from - **autoIncidents** (boolean) - Optional - Auto-create incidents on failure - **rules** (array) - Optional - Assertion rules ### Response #### Success Response (201) - **data** (object) - The created monitor object ``` -------------------------------- ### Create Monitor - POST Request Source: https://docs.unstatus.app/docs/api-reference/monitors This endpoint is used to create a new monitor. It requires authentication and accepts a JSON request body. Note the limit of 50 monitors per organization. ```http POST /api/v1/monitors ``` -------------------------------- ### GET /api/v1/monitors/:id/checks Source: https://docs.unstatus.app/docs/api-reference/monitors Retrieves the check history for a specific monitor. ```APIDOC ## GET /api/v1/monitors/:id/checks ### Description Returns paginated check history for a monitor (max 200 per page). ### Method GET ### Endpoint /api/v1/monitors/:id/checks ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the monitor #### Query Parameters - **limit** (number) - Optional - Max items per page ``` -------------------------------- ### GET /api/v1/monitors/:id Source: https://docs.unstatus.app/llms-full.txt Returns a single monitor by its unique ID. ```APIDOC ## GET /api/v1/monitors/:id ### Description Returns a single monitor by ID. ### Method GET ### Endpoint /api/v1/monitors/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the monitor ``` -------------------------------- ### GET /api/v1/incidents/:id Source: https://docs.unstatus.app/llms-full.txt Retrieves details for a specific incident by its ID. ```APIDOC ## GET /api/v1/incidents/:id ### Description Returns an incident with its full update timeline and affected monitors. ### Method GET ### Endpoint /api/v1/incidents/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the incident. ### Response #### Success Response (200) - **data** (object) - The incident object containing id, title, status, severity, startedAt, resolvedAt, updates, and monitors. #### Response Example { "data": { "id": "inc_...", "title": "API degraded performance", "status": "investigating", "severity": "major", "startedAt": "2025-01-15T10:00:00Z", "resolvedAt": null, "updates": [ { "id": "upd_...", "status": "investigating", "message": "We are investigating elevated error rates.", "createdAt": "2025-01-15T10:00:00Z" } ], "monitors": [ { "monitor": { "id": "clx1abc...", "name": "API Server" } } ] } } ``` -------------------------------- ### Create Incident API Request Source: https://docs.unstatus.app/docs/api-reference/incidents Use this command to create a new incident. Ensure you replace 'usk_your_key' with your actual API key and adjust the JSON payload as needed. ```bash curl \ -X POST https://unstatus.app/api/v1/incidents \ -H "Authorization: Bearer usk_your_key" \ -H "Content-Type: application/json" \ -d '{ "monitorIds": ["clx1abc..."], "title": "API degraded performance", "message": "We are investigating elevated error rates.", "severity": "major" }' ``` -------------------------------- ### Get Maintenance Window Source: https://docs.unstatus.app/docs/api-reference/maintenance Retrieves a specific maintenance window by its ID. ```APIDOC ## Get Maintenance Window ### Description Retrieves a specific maintenance window by its ID. ### Method GET ### Endpoint `/api/v1/maintenance/:id` ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the maintenance window to retrieve. ### Request Example (Request example not provided in the source text) ### Response #### Success Response (200) - **(Maintenance Window Object)** - Description of the response structure is not provided in the source text. #### Response Example (Response example not provided in the source text) ``` -------------------------------- ### GET /api/v1/maintenance/:id Source: https://docs.unstatus.app/docs/api-reference/maintenance Retrieves the details of a specific maintenance window by its ID. ```APIDOC ## GET /api/v1/maintenance/:id ### Description Retrieves the details of a specific maintenance window. ### Method GET ### Endpoint /api/v1/maintenance/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the maintenance window. ``` -------------------------------- ### Get Maintenance Window Source: https://docs.unstatus.app/docs/api-reference/maintenance Retrieves details of a specific maintenance window by its ID. ```APIDOC ## Get Maintenance Window ### Description Retrieves the details of a specific maintenance window using its unique identifier. ### Method GET ### Endpoint /api/v1/maintenance/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the maintenance window. ### Request Example ```bash curl https://unstatus.app/api/v1/maintenance/mw_12345 \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the maintenance window. - **name** (string) - The name of the maintenance window. - **description** (string) - A detailed description of the maintenance. - **start_time** (string) - The scheduled start time of the maintenance window (ISO 8601 format). - **end_time** (string) - The scheduled end time of the maintenance window (ISO 8601 format). - **status** (string) - The current status of the maintenance window. - **monitors** (array) - A list of monitor IDs affected by this maintenance. #### Response Example ```json { "id": "mw_12345", "name": "Server Upgrade", "description": "Scheduled maintenance for server upgrades.", "start_time": "2023-10-27T10:00:00Z", "end_time": "2023-10-27T12:00:00Z", "status": "scheduled", "monitors": ["mon_abc", "mon_def"] } ``` ``` -------------------------------- ### GET /api/v1/status-pages/:id Source: https://docs.unstatus.app/docs/api-reference/status-pages Retrieves details for a specific status page by ID. ```APIDOC ## GET /api/v1/status-pages/:id ### Description Retrieves a specific status page. ### Method GET ### Endpoint /api/v1/status-pages/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the status page ``` -------------------------------- ### Create Status Page Source: https://docs.unstatus.app/docs/api-reference/status-pages Create a new status page by sending a POST request with the required name and slug fields. ```bash curl -X POST https://unstatus.app/api/v1/status-pages \ -H "Authorization: Bearer usk_your_key" \ -H "Content-Type: application/json" \ -d '{ "name": "Acme Status", "slug": "acme", "brandColor": "#4f46e5" }' ``` -------------------------------- ### GET /api/v1/incidents/:id Source: https://docs.unstatus.app/docs/api-reference/incidents Retrieves an incident with its full update timeline and affected monitors. ```APIDOC ## GET /api/v1/incidents/:id ### Description Returns an incident with its full update timeline and affected monitors. ### Method GET ### Endpoint /api/v1/incidents/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the incident. ### Response #### Success Response (200) - **data** (object) - Contains the incident details. - **id** (string) - The unique identifier of the incident. - **title** (string) - The title of the incident. - **status** (string) - The current status of the incident (e.g., "investigating"). ### Request Example ```json { "example": "request body" } ``` ### Response Example ```json { "data": { "id": "inc_...", "title": "API degraded performance", "status": "investigating" } } ``` ``` -------------------------------- ### Authentication and Base Configuration Source: https://docs.unstatus.app/llms-full.txt Details on how to authenticate requests using API keys and the base URL for all API interactions. ```APIDOC ## Authentication ### Description All API requests require a valid API key passed as a Bearer token in the Authorization header. ### Base URL https://unstatus.app/api/v1 ### Headers - **Authorization** (string) - Required - "Bearer " ``` -------------------------------- ### Query Monitor Checks with cURL Source: https://docs.unstatus.app/docs/api-reference/monitors Use this command to fetch a list of checks for a specific monitor. Replace 'clx1abc...' with your monitor ID and 'usk_your_key' with your API key. ```bash curl https://unstatus.app/api/v1/monitors/clx1abc.../checks?limit=5 \ -H "Authorization: Bearer usk_your_key" ``` -------------------------------- ### Create Maintenance Event with cURL Source: https://docs.unstatus.app/docs/api-reference/maintenance Use this command to schedule a maintenance event. Ensure you replace 'usk_your_key' with your actual API key. ```bash curl -X POST https://unstatus.app/api/v1/maintenance \ -H "Authorization: Bearer usk_your_key" \ -H "Content-Type: application/json" \ -d '{ "title": "Database migration", "description": "Upgrading to PostgreSQL 17", "scheduledStart": "2025-02-01T02:00:00Z", "scheduledEnd": "2025-02-01T04:00:00Z", "monitorIds": ["clx1abc..."]' ``` -------------------------------- ### GET /api/status Source: https://docs.unstatus.app/docs/api-reference/monitors Retrieves the current status of the application, including latency and last checked time. ```APIDOC ## GET /api/status ### Description Retrieves the current status of the application, including latency and last checked time. This endpoint is useful for monitoring the health and responsiveness of the system. ### Method GET ### Endpoint /api/status ### Parameters None ### Request Example None ### Response #### Success Response (200) - **up** (boolean) - Indicates if the service is currently up. - **lastLatency** (integer) - The last recorded latency in milliseconds. - **lastCheckedAt** (string) - The ISO 8601 timestamp of the last status check. - **pagination** (object) - Information about pagination for status data. - **total** (integer) - The total number of items. - **limit** (integer) - The limit for items per page. - **offset** (integer) - The offset for the current page. - **hasMore** (boolean) - Indicates if there are more items available. #### Response Example ```json { "up": true, "lastLatency": 142, "lastCheckedAt": "2025-01-15T10:30:00Z", "pagination": { "total": 1, "limit": 10, "offset": 0, "hasMore": false } } ``` ``` -------------------------------- ### Get Status Page Source: https://docs.unstatus.app/docs/api-reference/status-pages Retrieves information about a specific status page. Supports pagination parameters. ```APIDOC ## GET /api/v1/status-pages/:pageId ### Description Retrieves a specific status page by its ID. This endpoint supports pagination through query parameters. ### Method GET ### Endpoint /api/v1/status-pages/:pageId ### Query Parameters - **pageId** (string) - Required - The unique identifier of the status page. - **total** (integer) - Optional - The total number of items available. - **limit** (integer) - Optional - The maximum number of items to return per page. Defaults to 20. - **offset** (integer) - Optional - The number of items to skip before starting to collect the result set. - **hasMore** (boolean) - Optional - Indicates if there are more items available beyond the current response. ### Response #### Success Response (200) - **pagination** (object) - Contains pagination details. - **total** (integer) - The total number of items. - **limit** (integer) - The limit applied to the current request. - **offset** (integer) - The offset applied to the current request. - **hasMore** (boolean) - True if there are more items, false otherwise. #### Response Example ```json { "pagination": { "total": 1, "limit": 20, "offset": 0, "hasMore": false } } ``` ``` -------------------------------- ### POST /api/v1/maintenance Source: https://docs.unstatus.app/llms-full.txt Create a new maintenance window. ```APIDOC ## POST /api/v1/maintenance ### Description Create a new maintenance window. Sends notifications to configured channels upon creation. ### Method POST ### Endpoint /api/v1/maintenance ### Parameters #### Request Body - **title** (string) - Required - Maintenance title - **description** (string) - Optional - Description - **scheduledStart** (string) - Required - ISO 8601 start time - **scheduledEnd** (string) - Required - ISO 8601 end time - **monitorIds** (string[]) - Required - Affected monitor IDs ### Request Example { "title": "Database migration", "description": "Upgrading to PostgreSQL 17", "scheduledStart": "2025-02-01T02:00:00Z", "scheduledEnd": "2025-02-01T04:00:00Z", "monitorIds": ["clx1abc..."] } ``` -------------------------------- ### POST /api/v1/monitors Source: https://docs.unstatus.app/docs/api-reference/monitors Creates a new monitor for the organization. Each organization is limited to a maximum of 50 monitors. ```APIDOC ## POST /api/v1/monitors ### Description Creates a new monitor. Maximum 50 monitors per organization. ### Method POST ### Endpoint /api/v1/monitors ### Parameters #### Request Body - **name** (string) - Required - The name for the new monitor. - **url** (string) - Required - The URL to be monitored. - **interval** (integer) - Optional - The interval in minutes between checks (default is 5). ### Request Example ```json { "name": "My New Website", "url": "https://mynewwebsite.com", "interval": 10 } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier of the newly created monitor. - **name** (string) - The name of the monitor. - **url** (string) - The URL being monitored. - **status** (string) - The initial status of the monitor. - **created_at** (string) - Timestamp when the monitor was created. #### Response Example ```json { "id": "clx9xyz...", "name": "My New Website", "url": "https://mynewwebsite.com", "status": "pending", "created_at": "2023-10-27T11:00:00Z" } ``` ``` -------------------------------- ### List Monitors Source: https://docs.unstatus.app/llms-full.txt Retrieves a paginated list of all monitors in your organization. Supports `limit` and `offset` query parameters. ```bash curl https://unstatus.app/api/v1/monitors?limit=10 \ -H "Authorization: Bearer usk_your_key" ``` -------------------------------- ### List Notification Channels Source: https://docs.unstatus.app/llms-full.txt Retrieves a list of configured notification channels. Requires authentication. ```bash curl https://unstatus.app/api/v1/notifications \ -H "Authorization: Bearer usk_your_key" ```