Monitor

Create a new HTTP monitor

POST /v1/monitor/http

Create new monitor with type "HTTP".

Headers

Name
Value

Authorization

Bearer <token>

Body

Name
Type
Description

workspace_id

string

name

string

name of the monitor

url

string

HTTP destination url

request

JSON

details on example request

expected

JSON

details on example request

interval

int

ping interval for monitor

timeout

int

timeout for ping request

Request

{
  "workspace_id": "{{WORKSPACE_ID}}",
  "name": "Document Channel.io",
  "url": "https://docs.channel.io/help/ko",
  "request": {
    "method": "GET",
    // "headers": {},
    // "body": ""
  },
  "expected": {
    "status_code": {
      "values": [
        200 // 100 ~ 599
      ],
      "ranges": [
        {
          "min": 300, // 100 ~ 599
          "max": 399 // 100 ~ 599
        }
      ]
    }
  },
  "interval": 300, // greater or equal than 60 (in seconds)
  "timeout": 3 // (in seconds)
}

Response

{
  "id": "monitor_01j50xm57n1anajqtgqbm2pb4s",
  "workspace_id": "workspace_01j4w5z8y8p1s492e5sgj9sbts",
  "type": "HTTP",
  "name": "Google",
  "url": "https://www.google.com",
  "request": {
    "method": "GET",
    "headers": {},
    "body": ""
  },
  "expected": {
    "status_code": {
      "values": [
        200
      ],
      "ranges": [
        {
          "min": 300,
          "max": 399
        }
      ]
    }
  },
  "interval": 300,
  "timeout": 3,
  "created_at": "2024-08-11 14:31:37",
  "updated_at": "2024-08-11 14:31:37",
  "deleted_at": null
}

Find monitors by workspace

GET /v1/monitor

Find all monitors by workspace.

Headers

Name
Value

Authorization

Bearer <token>

Query Parameters

Name
Type
Description

workspace_id

string

Response

[
  {
    "id": "monitor_01j4xdy62sa41a33tw59dg89pd",
    "workspace_id": "workspace_01j4w5z8y8p1s492e5sgj9sbts",
    "type": "HTTP",
    "name": "Google",
    "url": "https://google.com",
    "request": {
      "method": "GET",
      "headers": {},
      "body": ""
    },
    "expected": {
      "status_code": {
        "values": [
          200
        ],
        "ranges": [
          {
            "min": 300,
            "max": 399
          }
        ]
      }
    },
    "interval": 120,
    "timeout": 2,
    "created_at": "2024-08-10 05:59:45",
    "updated_at": "2024-08-10 05:59:45",
    "deleted_at": null
  }
]

Current status

GET /v1/monitor/:id/status/current

Get the current tick of monitor. It returns

Headers

Name
Value

Authorization

Bearer <token>

Path

Name
Type
Description

id

string

monitor_id

Response

{
  "monitor_id": "monitor_01j50cvmj4ykr3c22zcrmnnwb2",
  "last_tick": "2024-08-11 13:08:51",
  "next_tick": "2024-08-11 13:10:21",
  "counter": 33,
  "updated_at": "2024-08-11 09:38:36",
  "deleted_at": null,
  "current_status": "UP"
}

Last updated