Docs Sign in Get a key

Docs / Platform

Monitors API

Reference of the Hapti monitors endpoints: parameters, fields and real responses.

Every endpoint takes a key in the Authorization header: Authorization: Bearer hp_test_.... Base address: https://api.hapti.dev. The full specification is in openapi.json.

Create a monitor

HTTP
POST /v1/monitors

Checks a website on a schedule with a task, compares each result with the previous one and sends monitor.changed only when something was added, removed or changed. Takes the fields of a task (url, goal, output, user, data, files...) plus every or cron.

ParameterInDescription
Idempotency-KeyheaderAny unique string of 1 to 255 visible characters. The same key with the same request within 24 hours returns the first answer again instead of acting twice.
FieldTypeDescription
url (required)string
goal (required)string
outputobjectA JSON Schema for the result. When it holds a list, items are compared one by one.
keystringThe field that names an item of the list, like url or reference; a dotted path works. Without it an item is known by its content.
everystring
cronstring
timezonestring
notifystring: changes, alwayschanges (default): monitor.changed only. always: also monitor.checked after every check.
webhookstringAn https address that receives this monitor's events, besides your webhook endpoints
namestring
run_nowbooleantrue by default: the first check runs at once and sets the starting value
Request
{
  "url": "https://www.agence-exemple.fr/locations",
  "goal": "List the flats to rent in Lyon under 900 euros with their title, price and address",
  "output": {
    "type": "object",
    "properties": {
      "listings": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "price": {
              "type": "number"
            },
            "url": {
              "type": "string"
            }
          }
        }
      }
    }
  },
  "key": "url",
  "every": "1h",
  "timezone": "Europe/Paris"
}

List monitors

HTTP
GET /v1/monitors

Every monitor of the organisation.

Get a monitor

HTTP
GET /v1/monitors/{id}
ParameterInDescription
idpathMonitor id

Pause, resume or change a monitor

HTTP
PATCH /v1/monitors/{id}

Send paused, notify, webhook or name.

ParameterInDescription
idpathMonitor id
FieldTypeDescription
pausedboolean
notifystring: changes, always
webhookstring or null
namestring

Delete a monitor

HTTP
DELETE /v1/monitors/{id}

Stops it and deletes its values and history.

ParameterInDescription
idpathMonitor id

Read the current value

HTTP
GET /v1/monitors/{id}/latest

The last value the monitor read on the website, as an API: the website has none, the monitor gives one.

ParameterInDescription
idpathMonitor id

List the changes

HTTP
GET /v1/monitors/{id}/changes

What was added, removed or changed at each check that found a change, newest first.

ParameterInDescription
idpathMonitor id