← All use cases
Developer & DevOpsJSONPath

JSON API Field Monitoring

Watch any JSON endpoint for changes to a specific field - feature flags, internal counters, third-party APIs, anything that returns JSON over HTTP.

Verid Use Cases·4 min read·Template: generic-json-field

The scenario

Your platform exposes a public JSON status endpoint, or you depend on someone else's. You'd like to know within a minute when a specific field in the response changes - a feature flag flips, a counter crosses a threshold, an API contract drifts. You don't want to build the polling, retry, and signature-validation plumbing for every JSON endpoint you watch.

The problem

JSON APIs are everywhere but they almost never offer push. Webhook subscriptions exist for some, but they're inconsistent, often vendor-locked, and don't help you watch your own staging endpoints. The DIY approach - cron job, fetch, diff, alert - is genuinely simple to write once and somehow becomes a forever-maintenance problem when you have ten of them.

How Verid solves it

The generic-json-field template wraps a JSON endpoint with a JSONPath extractor and a predicate of your choice. Point it at any URL that returns JSON, define one or more JSONPath fields, pick the predicate, and you're done. The same monitor shape covers public APIs, your own services, and third-party endpoints behind a bearer token (passed via custom headers).

Build the monitor

Extraction config

{
  "method": "json_path",
  "fields": {
    "active_users": "$.metrics.active_users",
    "feature_enabled": "$.flags.new_checkout",
    "version": "$.build.version"
  }
}

Predicate

Watch one specific field for a value transition:

{ "type": "field_equals", "field": "feature_enabled", "value": true }

Or watch for a counter spike of more than 20%:

{ "type": "field_increases_by_percent", "field": "active_users", "threshold": 20 }

Or just any-field-changed for a broad watch:

{ "type": "any_field_changes" }

Create the monitor

curl:

curl -X POST https://api.verid.dev/v1/monitors \
  -H "Authorization: Bearer vrd_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Staging build version",
    "url": "https://staging.example.com/api/health",
    "schedule_interval_seconds": 300,
    "extract_config": {
      "method": "json_path",
      "fields": { "version": "$.build.version" }
    },
    "diff_predicate": { "type": "field_changes", "field": "version" },
    "deliveries": [
      { "type": "slack", "webhookUrl": "https://hooks.slack.com/services/..." }
    ]
  }'

Authenticated endpoint via custom headers on the webhook delivery side - for now, supply auth at the source URL if possible (query token), or call from a public endpoint your service exposes that forwards to the protected one.

SDK:

import { VeridClient } from '@verid.dev/sdk';

const client = new VeridClient({ apiKey: 'vrd_your_api_key' });

await client.monitors.create({
  name: 'Staging build version',
  url: 'https://staging.example.com/api/health',
  schedule_interval_seconds: 300,
  extract_config: {
    method: 'json_path',
    fields: { version: '$.build.version' },
  },
  diff_predicate: { type: 'field_changes', field: 'version' },
  deliveries: [
    { type: 'slack', webhookUrl: 'https://hooks.slack.com/services/...' },
  ],
});

What the webhook delivers

{
  "id": "del_01H...",
  "fired_at": "2026-05-08T20:14:00Z",
  "diff": {
    "fields_changed": ["version"],
    "before": { "version": "2026.05.07-a1b2c3d" },
    "after":  { "version": "2026.05.08-d4e5f6a" }
  }
}

In this case the build hash on staging just rolled forward - your team's deploy bot can confirm the deploy succeeded by listening for the version change.

Caveats & tips

  • JSONPath syntax matches the standard. $.foo.bar, $.items[0].name, $.items[*].id all work. Verid uses a JSONPath implementation compatible with the common spec; nested arrays and filters work as expected.
  • Arrays as a field value. If a JSONPath query returns multiple matches (e.g. $.items[*].id), Verid stores them as a joined string. To detect "a new id appeared," compare the count via a second field: $.items.length (use whatever path your library supports for length).
  • Numeric vs string matters for percent predicates. If the JSON field is a number, percent predicates work. If it's a string version of a number, parse it in your downstream consumer instead.

Related use cases

For sitemap/RSS-style new-item detection, see sitemap new URLs and RSS feed new items. For status pages exposing JSON, see status page incident detection. For GitHub releases, see GitHub release monitoring.

Ship this monitor today

5 monitors free, no credit card. Set up takes about a minute.

Get started free