> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wander-app.fr/llms.txt
> Use this file to discover all available pages before exploring further.

# Create and maintain your database

> This page explains how to use the [get events catalogue](/api-reference/event-data-fetching-and-storage/get-events-catalogue) endpoint to create and maintain your own event database.

## Initial database synchronisation

<Steps>
  <Step title="Fetch all upcoming events">
    Use the [get events catalogue](/api-reference/event-data-fetching-and-storage/get-events-catalogue) endpoint without the `lastUpdatedAt` parameter to retrieve **all upcoming events**.

    You can't get all the events at once. To retrieve all events, make multiple requests by incrementing the `pageNumber` parameter until it exceeds the total number of pages indicated in `pagination.totalPages`.
  </Step>

  <Step title="Store them">
    Store the event details found in `data.events` in your own database.

    Make sure to save the event `id` returned for each event to identify them for future updates.
  </Step>
</Steps>

## Database maintenance

<Steps>
  <Step title="Retrieve updates since your last sync">
    Set the `lastUpdatedAt` parameter to the timestamp of your **last successful synchronisation**.
    <Warning>This timestamp should reflect the **start date** of your last update.</Warning>
    Again, increment the `pageNumber` parameter to retrieve all updates.
    <Tip>Availabilities are checked **every 20 minutes**. Major updates are released at **10am**.</Tip>
  </Step>

  <Step title="Store changes">
    This will retrieve all event details, including unchanged ones, for events that have been **modified since your last sync**.

    You can choose to either completely **replace** the existing **event information** with the new data or **update the fields** individually by checking for changes.
  </Step>

  <Step title="Update deleted events">
    You will also receive an array of event ids in `eventIdsDeleted` for events removed due to duplicates identified since your last sync.
    To keep your database up to date, **delete the events matching these ids**.
    <Note>You can identify the events with which these have been merged by checking the `sources` `id`s.
    For example, if you've stored interactions with these events, you can transfer them to the newly merged events.</Note>
  </Step>
</Steps>

## Major update times

1. **10am** : up to 10 000 events at once, including overnight updates and integrations.
2. 2pm : up to 1000 events
3. 6pm : up to 1000 events
4. 10pm : up to 1000 events

<Note>Event availabilities are updates every 20 minutes.</Note>

## Best practices

...
