Developers / Guides

Guide

Alerts and webhooks

Standing searches and watches that tell you as new data arrives, through a feed you poll or a signed webhook, and how to fetch what you missed.

An alert is a standing search or a watch on named entities. You set one up the way you build a search, and Atlas tells you when something matches, as the registers publish it. The API calls an alert an interest: its paths and fields say interests, and this guide uses them as written. Every alert belongs to one consumer, and each consumer has one feed and can have one webhook.

A standing search costs tokens a month, its first month by the days left in it; a watch and the events either sends cost nothing, as a held entity's month covers its watching. A standing search whose month cannot be paid is stopped with the reason unpaid and resumes once it can. What a standing search costs is on the pricing page.

Set one up

Key What
kind search (conditions) or watch (entityIds, the named entities).
label Your own name for the alert. It is kept as long as the alert, as its conditions are, and erased with the consumer. Never put a person's details in a label or a condition.
conditions What POST /v1/search takes, with its narrowing rule: at least one positive condition on a narrowing field, so an alert never follows a whole register.
level organisation or premises: the same as a level condition.
fields The catalogue keys whose change counts. Left out, any change you could see counts.
on entered (a record starts matching), changed (a watched field changes on a matching record), left (a record stops matching). Left out, entered and changed. A watch is sent changed alone.

A new alert starts quiet: you are not sent what already matches. To see today's list, run the same conditions as a search. The answer says whether new data is being checked against the alert (matching), and if not, why (notice): run its conditions as a search instead. region and localAuthority take the names a search takes; they are not checked when you create an alert, so take them from the catalogue's options, as a name no register uses never matches. An event's changes give one name for an area.

Refusals

Code Status Why
INTEREST_LIMIT_REACHED 409 A consumer keeps at most 50 alerts.
INTEREST_LAYER_NOT_ALLOWED 403 An enrichment-only layer (the ICO, for example): its licence allows no standing search.
INTEREST_PERSON_FIELD 403 A condition or watched field about a person.
INTEREST_FIELD_INVALID 400 A watched field the layers in scope do not send.
WATCH_NOT_LIVE 400 A watch Atlas cannot follow on these layers or fields: refused rather than charged.
WATCH_ENTITY_NOT_IN_LAYERS 400 A watched entity with no current record in the watch's layers.
WATCH_ENTITY_NOT_FOUND 404 A watched entity Atlas has never issued. An id that merged still works, and is followed.
CONDITIONS_INVALID, NARROWING_REQUIRED, VIA_NOT_CONNECTED 400 As for a search.
curl -X POST https://api.atlas.oromiq.com/v1/interests \
  -H "Authorization: Bearer $ATLAS_KEY" \
  -H "x-atlas-consumer: $CONSUMER_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "search",
    "label": "Nursing homes in the South East rated Inadequate",
    "level": "premises",
    "layers": ["cqc"],
    "conditions": [
      { "field": "region", "operator": "equals", "value": "South East" },
      { "field": "cqc.rating", "operator": "equals", "value": "Inadequate" }
    ],
    "fields": ["cqc.status"],
    "on": ["entered", "changed", "left"]
  }'

The feed

One feed per consumer, for all its alerts, oldest first. Keep next and send it back as after; wait (up to 30 seconds) holds the call until an event arrives.

  • A cursor is your consumer's alone: another consumer's, or one past the end of your feed, is refused with INTEREST_CURSOR_INVALID; leave it out, or use from, to start again.
  • Show attributions wherever you show the data. Where currency.required is true, show asOf with it.
  • An event about a record too new to have an entity has entityId: null. Find its entity later with POST /v1/entities/lookup and the record's register id.
  • People are never named in an event. A postcode in an event is its outward code alone; read the entity for more, as you read one at any time. homeBased says when the address is likely a private home.
  • Read type first, and ignore a type you do not know: new ones may be added.

The event types

Type What
interest.change A record entered, changed in a watched field, or left.
interest.too_broad Past 1,000 events for the alert in the hour: this one event says so, and the rest are dropped until until.
consumer.too_broad Past 5,000 events across all this consumer's alerts in the hour: this one event says so, and the rest are dropped until until.
report.moved A saved report moved on a new release: reportId, release, total and moves, figures as the report gives them, never a register row. See the reports guide.
person.notice A person this consumer was served has objected or asked for erasure: act on it by actBy. It has interestId: null and comes with or without alerts. See the holdings and people guide.

Too many events are dropped, not delayed

An alert is sent at most 1,000 events an hour. Past that, you get one interest.too_broad event, and every further event for that alert in that hour is dropped: never sent, never in the feed, and not fetchable later. A time window or a redelivery only finds events that were made, so it cannot get these back. The event's heldBack says how many had been dropped when it was written; heldBackLastDay on each alert in GET /v1/interests gives the running count for the last 24 hours. To see what matches, run the same conditions as a search, and narrow the alert. A consumer also has a limit across all its alerts: 5,000 events an hour. Past it you get one consumer.too_broad event, and the rest are dropped the same way; heldBackLastDay beside data in GET /v1/interests gives its running count.

curl "https://api.atlas.oromiq.com/v1/interests/events?after=$CURSOR&wait=30" \
  -H "Authorization: Bearer $ATLAS_KEY" -H "x-atlas-consumer: $CONSUMER_ID"
Response
{
  "data": [
    {
      "id": "ev_1842_aB3dE9xY",
      "occurredAt": "2026-10-30T10:14:05.000Z",
      "type": "interest.change",
      "interestId": "int_9Hq2LmT8xYp3kQ7v",
      "entityId": "prm_pdFPkhx7RuGEeFl8Q1pP",
      "record": { "layer": "cqc", "source": "locations", "externalId": "1-2000000009" },
      "what": "changed",
      "changes": [
        { "field": "cqc.status", "from": "Registered", "to": "Deregistered", "asOf": "2026-10-29" }
      ],
      "attributions": [
        {
          "layer": "cqc",
          "text": "Care Quality Commission ratings and registration data, © CQC, licensed under the Open Government Licence v3.0."
        }
      ],
      "currency": { "asOf": "2026-10-29", "required": false },
      "homeBased": false
    }
  ],
  "next": "ev_1842_aB3dE9xY"
}

When an alert stops

An alert's answer always says whether it is being checked (matching), and when it is not, why (stopped and notice). A notice can also say why fewer events are sent while the alert goes on, such as a paused watch or a layer you no longer subscribe to: show it whenever it is present. It resumes by itself when the reason ends. What happens while it is stopped is not sent later: to catch up, run its conditions as a search.

  • consumer_suspended, client_suspended: the consumer or its client is suspended. The webhook sends nothing until it is resumed, then carries on where it was.
  • layers_unsubscribed: a layer it depends on is dropped: a condition or watched field of that layer, or no layer left in its scope. stopped.layers names them. The webhook carries on with the consumer's other alerts. Events carrying the dropped layer's data are no longer served, by the feed, a redelivery or a waiting delivery, but stay for their 30 days: subscribe again and read the window.
  • consumer_deleted: the consumer has gone. The webhook sends nothing; both are erased.

Watches. A watched entity costs nothing: each entry in watches says active and the month it is paid through, renewed on the first of the month. An entity that merges or splits keeps being watched.

How reliable it is

Events are delivered at least once, nearly always. A delivery can repeat (a timeout on your side, a redelivery): use the event's id to treat it once. On rare occasions an event is not made, though the data itself is served: if you must never miss a change, also run the conditions as a search from time to time. An event can reach the feed after one numbered later, so a reader with a cursor can pass it; it is still in the feed, and a time window finds it. Everything that was made stays in the feed for 30 days, whatever happens to your webhook.

If you miss events

Events are kept for 30 days, so nothing is lost while a webhook or a connection is down. If you still have your cursor, carry on from it: the feed gives you everything since. If you lost your cursor, or want a window again, ask by time, with from and to on GET /v1/interests/events; interestId keeps to one alert. Page by sending next back as after, with the same from, to and interestId; a call that gives no events has read the window.

You want your webhook to receive them: POST /v1/interests/webhook/redeliver with from and to sends the window again, and failedOnly: true keeps to events no delivery was answered for. The answer says how many are queued; they are sent in order after anything new, as deliveries with the header x-atlas-redelivery: true. A second request replaces the first, and a paused webhook is refused with WEBHOOK_PAUSED: register it again first.

curl "https://api.atlas.oromiq.com/v1/interests/events?from=2026-10-29T14:00:00Z&to=2026-10-29T16:30:00Z&limit=500" \
  -H "Authorization: Bearer $ATLAS_KEY" -H "x-atlas-consumer: $CONSUMER_ID"

Webhooks

The answer holds secret, shown this once. Keep it safe. Registering again replaces the webhook with a new secret, resumes a paused one and starts from the newest event. An address that is not https, or that reaches a private, loopback or link-local address, is refused (WEBHOOK_URL_NOT_ALLOWED). Deliveries come from no fixed address, so do not allowlist one: check the signature instead. When deliveries are held up on Atlas's side, GET /v1/interests/webhook says so in notice; events stay in the feed.

Each delivery is a POST of { "data": [...], "next": "..." }: up to 50 events, oldest first, and the cursor after them, with these headers.

Header What
x-atlas-timestamp Unix seconds when it was signed.
x-atlas-signature v1= and the hex HMAC SHA-256 of <timestamp>.<raw body>, keyed with your secret.
x-atlas-delivery The delivery's id, the same on each retry of it.
x-atlas-redelivery true on a delivery you asked to be sent again.

Respond 2xx within 10 seconds. Anything else, a redirect included, is a failure: the same delivery is tried again after 30 seconds, then with gaps doubling up to an hour, for 24 hours, with new events waiting behind it. After that the webhook is paused: GET /v1/interests/webhook says why in pausedReason, and nothing is sent until you register it again. Then ask for what you missed, as above. Deliveries can arrive more than once: use the event's id to treat them once.

Checking the signature

Check the signature against the raw body, before parsing it, and refuse a timestamp more than five minutes old.

curl -X POST https://api.atlas.oromiq.com/v1/interests/webhook \
  -H "Authorization: Bearer $ATLAS_KEY" -H "x-atlas-consumer: $CONSUMER_ID" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://hooks.oakfield.example/atlas" }'
curl and openssl, one delivery by hand with a saved body
TIMESTAMP=1793729645            # the x-atlas-timestamp header
RECEIVED="v1=..."               # the x-atlas-signature header
EXPECTED="v1=$(printf '%s.%s' "$TIMESTAMP" "$(cat body.json)" \
  | openssl dgst -sha256 -hmac "$ATLAS_WEBHOOK_SECRET" -hex | sed 's/^.* //')"
[ "$EXPECTED" = "$RECEIVED" ] && echo ok || echo refused
TypeScript, Node with Express
import { createHmac, timingSafeEqual } from 'node:crypto'
import express from 'express'

const SECRET = process.env.ATLAS_WEBHOOK_SECRET ?? ''

function verified(rawBody: Buffer, timestamp: string, signature: string): boolean {
  const age = Math.abs(Date.now() / 1000 - Number(timestamp))
  if (!Number.isFinite(age) || age > 300) return false
  const digest = createHmac('sha256', SECRET).update(`${timestamp}.`).update(rawBody).digest('hex')
  const expected = Buffer.from(`v1=${digest}`)
  const received = Buffer.from(signature)
  return expected.length === received.length && timingSafeEqual(expected, received)
}

const app = express()
app.post('/atlas', express.raw({ type: 'application/json' }), (req, res) => {
  const body = req.body as Buffer
  const timestamp = String(req.headers['x-atlas-timestamp'] ?? '')
  const signature = String(req.headers['x-atlas-signature'] ?? '')
  if (!verified(body, timestamp, signature)) return res.sendStatus(401)
  const { data, next } = JSON.parse(body.toString('utf8'))
  queue(data, next) // store the events and next, then do the work elsewhere: respond within 10 seconds
  return res.sendStatus(204)
})

Limits

Limit Value
Alerts per consumer 50
Events per alert 1,000 an hour; past that, one interest.too_broad and the rest dropped
Events kept 30 days
Longest wait on the feed 30 seconds
Webhook retries 24 hours, then paused