EU law · 24 official languagesArticle-level JSON · typed citation graphMCP server · Claude, Cursor, VS CodeSDKs · Python, TypeScriptFree plan · 500 credits to start
Brussels · CET
Vol. II·Section S — Solutions Desk
Webhooks · Watch lists · Signed deliveries

§ Change monitoring — For developers

Know when an EU act changes, without polling EUR-Lex.

Put the acts you depend on on a watch list. When one is amended, corrected or repealed, or gets a new consolidated version, LexAPI posts which document changed it to your endpoint, signed. Webhooks are evaluated hourly.

The free plan starts with 500 credits, no card. Your API key is on the dashboard once you confirm your email.

Webhooks need a paid plan. The polling requests on this page work on every plan.

Create a free accountQuickstart

§ 01 — Watch

A watch list of acts.

You need: a paid plan, an HTTPS endpoint, and an API key

Create a webhook with the CELEX numbers to watch. This one watches the GDPR and the AI Act. Run it with your key in place of lex_your_key and your endpoint in place of the example URL.

curl
curl -X POST "https://lex-api.com/api/v1/webhooks" \
  -H "x-api-key: lex_your_key" \
  -H "Content-Type: application/json" \
  -d '{"name":"GDPR and AI Act watch","url":"https://example.com/lexapi-webhook","watchCelex":["32016R0679","32024R1689"]}'
  • The answer carries webhook.secret once. Store it: you verify deliveries with it.
  • watchCelex takes the CELEX numbers of the acts themselves, not of consolidated versions.
  • url must be a public HTTPS endpoint. Redirects are not followed.
  • A new webhook fires only for documents that appear after it was created.
  • Deliveries cost no credits.

The same call with the SDKs

Install with pip install lexapi-client or npm install @lexapi/client.

Python
from lexapi import LexAPI

client = LexAPI(api_key="lex_your_key")

resp = client.webhooks.create("GDPR and AI Act watch", "https://example.com/lexapi-webhook", watch_celex=["32016R0679", "32024R1689"])

print(resp.webhook.id, resp.webhook.status)
print("store this secret:", resp.webhook.secret)
TypeScript
import { LexAPI } from "@lexapi/client";

const client = new LexAPI({ apiKey: "lex_your_key" });

const resp = await client.webhooks.create({
  name: "GDPR and AI Act watch",
  url: "https://example.com/lexapi-webhook",
  watchCelex: ["32016R0679", "32024R1689"],
});

console.log(resp.webhook.id, resp.webhook.status);
console.log("store this secret:", resp.webhook.secret);

Webhooks reference

§ 02 — Delivery

What arrives at your endpoint.


A POST with a JSON body. This delivery reports a new consolidated version of a watched act.

A delivery (abridged)
{
  "event": "watchlist.changes",
  "timestamp": "2026-10-05T11:35:50.493Z",
  …
  "data": {
    "count": 1,
    "changes": [
      {
        "watchedCelex": "32008R1272",
        "relation": "consolidated_version",
        "document": {
          "celex": "02008R1272-20270101",
          "title": "Regulation (EC) No 1272/2008 of the European Parliament and of the Council of 16 December 2008 on classification, labelling and packaging of substances and mixtures, …",
          "documentType": "Consolidated text",
          "consolidationDate": "2027-01-01",
          "addedAt": "2026-09-29T18:38:19.634Z",
          "url": "https://eur-lex.europa.eu/legal-content/EN/ALL/?uri=CELEX:02008R1272-20270101",
          …
        }
      }
    ]
  }
}
  • relation is one of amended_by, corrected_by, repealed_by, consolidated_version.
  • document.celex is the document that changes the watched act. Read it with the document endpoint.
  • A consolidated version’s consolidationDate is the date that version applies from. It can be in the future.
  • A failed delivery is retried for about 24 hours. Each retry keeps the same delivery.id: deduplicate on it.
§ 03 — Verify

Check the signature before you trust it.


Every delivery carries X-Webhook-Signature: the HMAC-SHA256 of the request body, hex-encoded, keyed with the webhook’s secret. Compute it over the raw body bytes.

Node.js (Express)
const crypto = require('crypto');
const express = require('express');
const app = express();

app.post('/lexapi-webhook', express.raw({ type: 'application/json' }), (req, res) => {
  const signature = req.get('X-Webhook-Signature') || '';
  const expected = crypto
    .createHmac('sha256', process.env.LEXAPI_WEBHOOK_SECRET)
    .update(req.body) // raw Buffer — exactly the bytes LexAPI signed
    .digest('hex');

  // Timing-safe comparison (compare digests as bytes, guard length first)
  const a = Buffer.from(expected, 'hex');
  const b = Buffer.from(signature, 'hex');
  if (b.length !== a.length || !crypto.timingSafeEqual(a, b)) {
    return res.status(401).send('invalid signature');
  }

  const event = JSON.parse(req.body);

  // Replay guard: the signed payload carries `timestamp` — reject stale events
  if (Math.abs(Date.now() - Date.parse(event.timestamp)) > 5 * 60 * 1000) {
    return res.status(401).send('stale event');
  }

  // …process event…
  res.status(200).end(); // respond within 10s — LexAPI times out after that
});

The signature covers the body only, and there is no nonce: check timestamp for freshness, as above. Answer with a 2xx within 10 seconds and process the event afterwards.

§ 04 — New documents

New documents that match filters.


A webhook can also fire for new documents: give it searchCriteria instead of, or next to, a watch list. This one reports new regulations with both words in the title.

curl
curl -X POST "https://lex-api.com/api/v1/webhooks" \
  -H "x-api-key: lex_your_key" \
  -H "Content-Type: application/json" \
  -d '{"name":"New AI regulations","url":"https://example.com/lexapi-webhook","searchCriteria":{"query":"artificial intelligence","documentType":"regulation"}}'
  • query matches words of the document title, not the full text. Every term must match.
  • Other filters: author, subdomain, dateFrom, dateTo and year. A filter the API cannot apply is refused with a 400, not ignored.
  • Which documents count as new is decided by when they appeared on EUR-Lex. dateFrom, dateTo and year filter on the document date.
§ 05 — Polling

Amendments, corrigenda and repeals, by request.


Without a webhook, ask for the edges yourself. This lists what amends, corrects or repeals the AI Act; compare it with the last answer you stored.

curl — changes to one act
curl "https://lex-api.com/api/v1/citations/cited-by/32024R1689?citationType=amendment,corrigendum,repeal&limit=20" \
  -H "x-api-key: lex_your_key"
You get (abridged)
{
  "success": true,
  "targetDocument": "32024R1689",
  "totalEdges": 5,
  "citedBy": [
    {
      "id": "32024R1689R(01)",
      "celexNumber": "32024R1689R(01)",
      "citations": [
        { "citationType": "corrigendum", "provenance": "cellar", "extractedAt": "2026-11-18T10:09:29.987Z", … }
      ],
      …
    },
    …
    {
      "id": "32026R1744",
      "celexNumber": "32026R1744",
      "title": "Regulation (EU) 2026/1744 of the European Parliament and of the Council of 8 July 2026 amending Regulations (EU) 2024/1689, (EU) 2018/1139 and (EU) 2023/1230 … (Digital Omnibus on AI) …",
      "citations": [
        { "citationType": "amendment", "provenance": "cellar", "extractedAt": "2026-11-18T10:09:29.987Z", … }
      ],
      …
    }
  ],
  "relationSync": { "source": "cellar", "status": "fresh", "syncedAt": "2026-11-18T10:09:30.014Z" },
  "credits": { "operation_weight": 1, … }
}

Costs 1 credit. relationSync says when these edges were last refreshed; a read refreshes them when they are more than 7 days old.

curl — recently published documents
curl "https://lex-api.com/api/v1/documents/recent?days=2&limit=10" \
  -H "x-api-key: lex_your_key"

Costs 3 credits per page of results. days is the look-back window.

Cited-by reference

§ 06 — FAQ

Asked & answered.

N° 01How do I get notified when an EU regulation or directive is amended?+
Create a LexAPI webhook with the act’s CELEX number in watchCelex. When the act is amended, corrected or repealed, or gets a new consolidated version, LexAPI sends a signed POST to your HTTPS endpoint with the document that changes it. Webhooks are on paid plans.
N° 02How soon does a change arrive?+
Webhooks are evaluated hourly. Matching is keyed on when a document appeared on EUR-Lex, not on its document date. A newly created webhook fires only for documents that appear after it was created.
N° 03How do I know a delivery came from LexAPI?+
Each delivery carries an X-Webhook-Signature header: the HMAC-SHA256 of the request body, hex-encoded, keyed with the webhook’s secret. Compute it over the raw body bytes exactly as received and compare.
N° 04What happens if my endpoint is down?+
A failed delivery is retried with increasing delays for about 24 hours. If every attempt fails, the webhook is set to FAILED and stops until you re-enable it.
§ 07 — Next

Keep building.


  • EU law citation graph APIList what an act or judgment cites and what cites, amends, corrects or repeals it, as typed edges.
  • EU law on a dateThe consolidated version listed for a date, or the act as published, and one article of it.
  • Transposition measures APIThe measures each member state notified to the Commission for an EU directive, by CELEX number.
  • QuickstartA first request by curl, MCP, Python and TypeScript.
  • API referenceEvery endpoint, parameter, response field and error.
  • MCP serverSetup for Claude, Cursor and VS Code, and the tool list.
  • PricingPlans, credit pools and what each call costs.

LexAPI returns source texts and their identifiers. It does not assess compliance and gives no legal advice.