Calendar API: Webhooks
In order to be notified with updates on our economic calendar data, our Economic Calendar service offers webhooks.
Instead of constantly polling our API, you can subscribe to the updates that you are interested in (like when an event is created or deleted) and we will notify you when this happens in order to update the precise part of our data at the precise time. An explanation about how webhooks work can be found here.
How to subscribe to events
In order to manage your calendar webhooks, we provide you with a set of endpoints:
The endpoints you subscribe to for certain events, will receive POST HTTP requests with the event notification you subscribed to.
caution
You should respond our server with a 200 OK
or 204 No Content
status code.
This way, we can know if the request was successful.
Events
Name | Description |
---|---|
event_created | New event created |
eventDate_created | New event occurrence created |
eventDate_updated | Event occurrence updated |
eventDate_deleted | Event occurrence deleted |
To see more info about the webhooks events and their payloads (request body), you can take a look at the API Reference. Open the POST /webhooks
endpoint documentation, and examine the Callbacks tab:
There you can find examples like the eventDate_updated
event. You see its payload here:
There are other cases, like the event_created
event, that only sends the ID of the event. This can be used to get the full data of the new event (using our /events/{id}
endpoint) at the exact moment you are notified of its creation.
Debugging webhooks
Tip: Testing on local
To test your webhooks locally, we recommend you to use tools like ngrok
to expose your local API instance so that our service can call your test server and you can debug your own code.
Tip: Last successful call
You can use the lastSentAt
value of the Webhook object to see the last successful call to that webhook endpoint (last POST request with a 200 OK
or 204 No Content
response from your side).