> ## Documentation Index
> Fetch the complete documentation index at: https://developers.luccasoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Started

Events are our way of letting you know when something that might interest you happens in Lucca.
Whenever it does a new event resource is created. For example, when a leave-request is eventually
approved, a `leave-request.updated` event is created to notify you that its status changed.

In general, events occur whenever the state of a resource representation changes. The state of that
resource at the time of the change is embedded in the event's `data` attribute. Given the previous
example, the `leave-request.updated` event will contain the representation of the corresponding leave-request
in its `data` attribute.

#### About topics

The topic of an event indicates both the type of the related resource and the nature of the change.

```bnf theme={null}
<resource_type> = "legal-entity" | "business-establishment" | "employee" | ...
<operation> = "created" | "updated" | "deleted"
<topic> = <resource_type> "." <operation>
```

Examples: `employee.updated`, `legal-entity.deleted`, etc…

[List of topics](./event-topics)

#### About update events

`{resource}.updated` events are triggered whenever an attribute of a resource that already existed is changed.
This behavior is restricted to the direct attributes of the resource. As such, a change in the state of an embedded
resource does not trigger a `{resource}.updated` event on the embedding resource.

The list of modified attributes, as well as their value before the change, can be found in the `data.previousAttributes`
JSON object (`<attribute> => <previous_value>` dictionary).

#### About ApiVersion

Any time an event occurs, it is created as many times as there are supported Lucca [API versions](../../../documentation/using-api/versioning).
Each event thus has an `apiVersion` attribute that indicates the relevant API version.

The `data` contained in an event is a representation of the related resource that conforms to the schema in the related
API version.

<Warning>This means that if the event occurred before the release of a specific API version, then there will be no related
event for this version.</Warning>

<Tip>Events are only kept for up to 2 months.</Tip>
