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

# Events

> App lifecycle events

Events allow developers to perform setup or teardown tasks, such as registering or
unregistering a [webhook](../webhooks/webhook-handlers) in a third-party system or validating
a user's [connections](../connections/connections).

Event files ***MUST***:

* Live in `src/events`
* Have a `.event.ts` suffix.
* Contain an `export default async function` that:
  * Takes a `{ connection: Connection }` argument
  * Returns `void`

The arguments passed to the handler function depend on the type of event and are documented below.

## Available Events:

* [`connection-added`](./connection-added) – called when a connection is added
* [`connection-removed`](./connection-removed) – called when a connection is removed
