Skip to cookie settingsSkip to content
Back to the blog

Scripts can now manage your Netonica monitors

Your public endpoints and your vendors' endpoints can change quietly. If you watch them for security changes, you also need to keep your monitors up to date. You can now manage Netonica monitors from a script or a deploy pipeline.

Manage monitors from a script

With the API at /api/v1, you can add, change, pause, and remove monitors. Make a key on your workspace page.

Send the key in the Authorization header:

curl -X POST https://netonica.com/api/v1/monitors \
  -H "Authorization: Bearer $NETONICA_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"target":{"kind":"tls","fields":{"endpoint":"example.com"}},"schedule":"0 * * * *"}'

The call answers at once with 202 Accepted:

{"command_id":"1792058130412-0","monitor_id":"m-3f9a1c0d5e7b2468"}

The monitor process applies the change after the call returns. GET /api/v1/commands/{id} with that command_id reads pending until then, and applied or refused after.

A script can send the same add on every deploy. If your workspace already has the monitor, adding it again leaves its settings as they were.

Each key works in one workspace as the member who made it. A script that works in two needs a key from each. The activity log marks changes made with a key, so you can see which key a script used. API calls follow the same rules as the add form on the website.

Start by making a key, then use the API docs to add a monitor from your deploy script.

Now

Check your site or API

See which assertions your site or API passes today.