Trying the Gebeurtenissen (Events) API
With the Gebeurtenissen API you can follow particular persons for specific types of event.
Short description
An “event” means that something happens to a person, in response to which you have to start a process or carry out an action. For example, when a minor being treated by youth care moves to another municipality, the case file must be transferred to the new municipality and then closed.
Often something has also changed in the person's data when an event occurs. With the event “verhuisd.intergemeentelijk”, for example, the person's address has changed and so has the municipality of registration. You can then request this in the BRP Personen API.
In the API we call following a person for a type of event a “subscription” (abonnement).
In the API you can request, at a moment of your own choosing, whether events have occurred on your subscriptions. You may choose the frequency and the moment yourself, for example once a day or every hour.
In the API, subscriptions can be managed and events requested per service or task application. The idea behind this is that not every service, task or application has the same persons (clients) and is not interested in the same events. Youth care, for example, will only have purpose limitation to follow minor clients and their parents. Social services will only follow clients who receive benefits.
In the API we call a service or task application that sets subscriptions and requests events a “subscriber” (abonnee). A subscriber will normally subscribe persons to a fixed set of event types. We call such a set of event types a “group” (groep) in the API.
Several groups can be created for one subscriber, where different persons have to be followed for a different combination of event types because they have a different role in the process. For compulsory education, for example, think of a group “pupil subject to compulsory education” and a group “parent”. Or for social services, a group “benefit recipient” and a group “partner”. A subscriber can then subscribe a person to a group, which sets a subscription for that person to all event types in the group.
When requesting events, the subscriber supplies the last event received (processed), so as to receive only events the subscriber has not yet read. This puts the subscriber in control of when and which events are received. The subscriber is therefore also responsible for ensuring that it receives all events and processes them correctly.
How do I use the API?
The API is designed for going through the following steps:
- the municipality (as consumer) registers a task application as a subscriber, adds one or more groups to it, and adds per group the event types for which the subscriber has purpose limitation for that group. See “Registering a subscriber”.
- the subscriber takes out subscriptions on persons for a group. See “Subscribing to a person”.
- the subscriber requests (at a certain frequency) unread events. See “Requesting events”.
- if there are more unread events than can be answered in one request, the subscriber repeats the previous step until all events have been read.
- the subscriber processes the events and, if desired, requests the changed data of the person in the BRP API /personen or /verblijfplaatshistorie.
- the subscriber adds a new subscription when there is a new person (client) for whom they have to receive events.
- the subscriber ends the subscription for a person when the subscriber no longer needs events about that person (the person is no longer a client). See “Stopping a subscription”.
To make sure you actually receive events in the pilot environment, you can send changes. Do this after setting the subscription, but before requesting events. See “Sending a change”.
Trying the API out with Postman
We have prepared a Postman project so that you can get started quickly with the Gebeurtenissen API. The project contains a number of example messages.
To make this work in the pilot environment, you must enter the following values under Variables in Postman:
- tokerserviceUrl: https://probeerbrpapi.rvig.nl/realms/brp-api/protocol/openid-connect/token
- baseUrl: https://probeerbrpapi.rvig.nl/api/brp
- client_id: you receive this from us once you have registered as a participant in the API Lab
- client_secret: you receive this from us once you have registered as a participant in the API Lab
- scope: you receive this from us once you have registered as a participant in the API Lab
- resourceServer: ResourceServer02
- burgerservicenummer: enter a citizen service number of a test person — you receive this from us once you have registered as a participant in the API Lab — or replace {{burgerservicenummer}} in the requests you send with one of the test citizen service numbers you receive
- abonneeNaam: enter a name identifying the application or the process you are automating (maximum 8 characters, lowercase letters, digits and hyphens only)
You can also use different subscribers and/or different citizen service numbers in the various requests. In that case change {{abonneeNaam}} and/or {{burgerservicenummer}} to the desired value.
Specifications
View the specifications in ReDoc. The OpenAPI specifications of the Gebeurtenissen API can be downloaded as OAS3 BRP-API Gebeurtenissen. Use them to generate consumer code.
Authentication
To be able to use the API you must send an OAuth token with every request.
To request a token in the pilot environment, send a request like this:
curl --location 'https://probeerbrpapi.rvig.nl/realms/brp-api/protocol/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id={{client-id}}' \
--data-urlencode 'client_secret={{client-secret}}' \
--data-urlencode 'scope={{scope}}' \
--data-urlencode 'resourceServer=ResourceServer02'
Here you must replace everything between double braces with the credentials you have received.
The token you must send with every request is in the reply, in “access_token”.
Registering a subscriber
Before an application can use the Gebeurtenissen API to set subscriptions and request events, you must register it as a subscriber.
To register a subscriber in the pilot environment, send a request like this:
curl --location 'https://probeerbrpapi.rvig.nl/api/brp/abonnees' \
--header 'Content-Type: application/json' \
--header 'Authorization: {{token}}' \
--data '{
"naam": "{{naam van de abonnee}}"
}'
- Replace {{token}} with the access token you requested earlier.
- Replace {{naam van de abonnee}} with the name of the subscriber (the name of the service or task application).
Before the subscriber can take out a subscription, you must add a group to the subscriber. To add a group to the subscriber, send a request like this:
curl --location 'https://probeerbrpapi.rvig.nl/api/brp/abonnees/{{naam van de abonnee}}/groepen' \
--header 'Content-Type: application/json' \
--header 'Authorization: {{token}}' \
--data '{
"naam": "{{naam van de groep}}"
}'
- Replace {{token}} with the access token you requested earlier.
- Replace {{naam van de abonnee}} with the name of the subscriber (the name of the service or task application).
- Replace {{naam van de groep}} with the name you want to give the group.
Then add the event types to the group that the subscriber wants and is permitted to receive for this group. To add an event type to the group, send a request like this:
- Replace {{token}} with the access token you requested earlier.
- Replace {{naam van de abonnee}} with the name of the subscriber (the name of the service or task application).
- Replace {{naam van de groep}} with the name of the group you added earlier.
- Replace {{gebeurtenistype}} with the event type you want to add to the group. At present there are three types of event you can subscribe to:
- nl.brp.verhuisd.intergemeentelijk
- nl.brp.verhuisd.naar-buitenland
- nl.brp.overleden
Subscribing to a person
To take out a subscription in the pilot environment, send a request like this:
- Replace {{naam van de abonnee}} with the name of the subscriber (the name of the service or task application).
- Replace {{token}} with the access token you requested earlier.
- Replace {{naam van de groep}} with the name of the group you added earlier.
- Replace {{burgerservicenummer}}. You have received from us a list of citizen service numbers you can use for this.
Requesting events
To receive events in the pilot environment, send a request like this:
- Replace {{naam van de abonnee}} with the name of the subscriber (the name of the service or task application).
- Replace {{token}} with the access token you requested earlier.
- Replace {{gebeurtenis id}} with the id of the last event read, so as to receive only events you have not yet seen. Omit this parameter to receive all events.
- Replace {{aantal gebeurtenissen}} to specify the maximum number of events to be received per request. The default value is 10. Omit this parameter to receive the first 10 events (after the cursor).
Stopping a subscription
To end a subscription in the pilot environment, send a request like this:
- Replace {{naam van de abonnee}} with the name of the subscriber (the name of the service or task application).
- Replace {{token}} with the access token you requested earlier.
- Replace {{naam van de groep}} with the name of the group you took out a subscription on earlier.
- Replace {{burgerservicenummer}} with the citizen service number you took out a subscription on earlier.
Ending a subscription is a POST request to the same URL you use for taking out a subscription. The value of “type” in the body determines what the API does here.
Sending a change
In the pilot environment it is possible to send changes, so that you can determine yourself which events you get in your tests.
This does two things:
- A new event arises, which you can request with the Gebeurtenissen API.
- The data changes in the BRP, so that you can consult the changed data in the Personen API.
There are currently three kinds of change:
- AangifteVanAdreswijziging: with this you can create the event nl.brp.verhuisd.intergemeentelijk
- AangifteVanVertrekNaarBuitenland: with this you can create the event nl.brp.verhuisd.naar-buitenland
- AangifteVanOverlijden: with this you can create the event nl.brp.overleden
With the change you also supply the new data.
Event verhuisd.intergemeentelijk (moved between municipalities)
- Replace {{token}} with the access token you requested earlier.
- Replace {{burgerservicenummer}} with that of the person the change relates to. You will only receive the event if you first took out a subscription to this event for this person.
- Replace {{datum}} with the date on which the person was registered at the new address. This is a date in the format yyyy-mm-dd (for example “2026-04-09”).
- Replace {{adresseerbaar object identificatie}} with the addressable object identification of the address the person is moving to.
- This must be an identification that already exists in the pilot environment. For example 0014010011076306, 0034011440028001, 0091010000033261.
- Only where the new address is in a different municipality from the person's current address will this lead to the event verhuisd.intergemeentelijk. If it is in the same municipality, no event arises.
- The first 4 digits of the addressable object identification tell you which municipality it is in. Compare that with the person's current municipality of registration (you can request this with the BRP API /personen).
Event verhuisd.naar-buitenland (moved abroad)
- Replace {{token}} with the access token you requested earlier.
- Replace {{burgerservicenummer}} with that of the person the change relates to. You will only receive the event if you first took out a subscription to this event for this person.
- Replace {{datum}} with the date on which the person left. This is a date in the format yyyy-mm-dd (for example “2026-04-09”).
- Replace {{regel 1 van het buitenlandse adres}}, {{regel 2 van het buitenlandse adres}} and {{regel 2 van het buitenlandse adres}} with the address lines of the foreign address. Where the foreign address fits on two lines, the third line can be omitted.
- Replace {{landcode}} with a code appearing in the country table. If you want to state that the person left with an unknown place of residence, enter only the value “0000” for “landCode” and omit “regel1”, “regel2” and “regel3” from the request.
Event overleden (died)
- Replace {{token}} with the access token you requested earlier.
- Replace {{burgerservicenummer}} with that of the person the change relates to. You will only receive the event if you first took out a subscription to this event for this person.
- Replace {{datum}} with the date on which the person died. This is a date in the format yyyy-mm-dd (for example “2026-04-09”).
- Replace {{plaats}} with the municipality code in the municipality table or the place name (for example “London” or “Berlin”) where it concerns a place of residence abroad.
- Replace {{landcode}} with a code appearing in the country table. Where the person died in the Netherlands, enter “6030”. If you want to state that the person left with an unknown place of residence, enter only the value “0000” for “landCode” and omit “regel1”, “regel2” and “regel3” from the request.
Consulting
It is possible to consult everything you create. For this, use the “GET” operations with method “GET” (see the API specifications).
For example, to consult the event types in a group in the pilot environment, send a request like this:
- Replace {{naam van de abonnee}} with the name of the subscriber (the name of the service or task application).
- Replace {{naam van de groep}} with the name of the group you added earlier.
- Replace {{token}} with the access token you requested earlier.
To consult all active subscriptions in the pilot environment, send a request of the same kind.
Deleting the subscriber and its groups and subscriptions
It is possible to delete everything you create. For this, use the “DELETE” operations (see the API specifications).
When you delete something, all underlying items are deleted immediately as well:
- If you remove an event type from a group, existing subscriptions to the group will no longer receive events of this type.
- If you delete a group, you automatically also delete the event types in the group and end all subscriptions to this group.
- If you deregister a subscriber, you automatically also delete the associated groups and event types and end all subscriptions of this subscriber.
To delete a subscriber and all underlying groups and subscriptions in the pilot environment, send a request of the same kind.
- Replace {{naam van de abonnee}} with the name of the subscriber you want to deregister.
- Replace {{token}} with the access token you requested earlier.
The source page contains a further eight curl examples for these operations. They are reproduced in the source; only the surrounding instructions are translated here.