---
title: Reference - Global system events
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

Each section below represents an event category (class) that serves as an entry point for accessing that specific group of events.

## ObjectEvents

**Namespace**: CMS.DataEngine

Contains events that occur for all types of objects in the system. See also: [Handle object events](https://docs.kentico.com/documentation/developers-and-admins/customization/handle-global-events/handle-object-events.md)

> **Note:** **Important**
>
> Use the following classes to access the object events in the API:
>
> - **ObjectEvents** – events triggered for all object types
> - **Info.TYPEINFO.Events** – events triggered only for a specific object type, for example: `UserInfo.TYPEINFO.Events`

| Event       | Event types                | Handler parameters                                                                                                                     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ----------- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Insert      | Before<br>After<br>Failure | ObjectEventArgs<br>**Properties**<br>Object (BaseInfo)                                                                                 | **Note**: We recommend using the newer [event handlers with async support](https://docs.kentico.com/documentation/developers-and-admins/customization/handle-global-events/handle-object-events.md) for _Insert_ object events.<br>Occurs when a new object is created.<br>To reliably handle all possible object creation events, you may also need to assign a matching handler to the **BulkInsert** event. The system triggers the _BulkInsert_ event instead of _Insert_ in certain cases, particularly for operations that can affect multiple objects.                                                         |
| Update      | Before<br>After<br>Failure | ObjectEventArgs<br>**Properties**<br>Object (BaseInfo)                                                                                 | **Note**: We recommend using the newer [event handlers with async support](https://docs.kentico.com/documentation/developers-and-admins/customization/handle-global-events/handle-object-events.md) for _Update_ object events.<br>Occurs when the data of an existing object is updated.<br>To reliably handle all possible object update events, you may also need to assign a matching handler to the **BulkUpdate** event. The system triggers the _BulkUpdate_ event instead of _Update_ in certain cases, particularly for operations that can affect multiple objects.                                         |
| Delete      | Before<br>After<br>Failure | ObjectEventArgs<br>**Properties**<br>Object (BaseInfo)                                                                                 | **Note**: We recommend using the newer [event handlers with async support](https://docs.kentico.com/documentation/developers-and-admins/customization/handle-global-events/handle-object-events.md) for _Delete_ object events.<br>Occurs when an object is deleted.<br>To reliably handle all possible object deletion events, you may also need to assign a matching handler to the **BulkDelete** event. The system triggers the _BulkDelete_ event instead of _Delete_ in certain cases, particularly for operations that can affect multiple objects.                                                            |
| BulkInsert  | Before<br>After<br>Failure | BulkInsertEventArgs<br>**Properties**<br>InsertedObjects (IEnumerable)<br>TypeInfo (ObjectTypeInfo)                                    | Occurs when the system performs object creation operations that can affect multiple objects. To reliably handle all possible object creation events, assign matching handlers to both the **BulkInsert** and **Insert** events.                                                                                                                                                                                                                                                                                                                                                                                       |
| BulkUpdate  | Before<br>After<br>Failure | BulkUpdateEventArgs<br>**Properties**<br>ChangedColumns (IEnumerable)<br>TypeInfo (ObjectTypeInfo)<br>WhereCondition (IWhereCondition) | Occurs when the system performs object update operations that can affect multiple objects. To reliably handle all possible object update events, assign matching handlers to both the **BulkUpdate** and **Update** events.                                                                                                                                                                                                                                                                                                                                                                                           |
| BulkDelete  | Before<br>After<br>Failure | BulkDeleteEventArgs<br>**Properties**<br>TypeInfo (ObjectTypeInfo)<br>WhereCondition (IWhereCondition)                                 | Occurs when the system performs object deletion operations that can affect multiple objects. To reliably handle all possible object deletion events, assign matching handlers to both the **BulkDelete** and **Delete** events.                                                                                                                                                                                                                                                                                                                                                                                       |
| Sort        | Before<br>After<br>Failure | ObjectSortEventArgs<br>**Properties**<br>Object (BaseInfo)<br>Ascending (bool)<br>OrderColumn (string)<br>NameColumn (string)          | Occurs when sorting of objects is requested.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ChangeOrder | Before<br>After<br>Failure | ObjectChangeOrderEventArgs<br>**Properties**<br>Object (BaseInfo)<br>NewOrder (int)<br>RelativeOrder (int)<br>OrderColumn (string)     | Occurs when a change in the order of objects is requested.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| GetData     | Before<br>After<br>Failure | ObjectDataEventArgs<br>**Properties**<br>Data (DataSet)<br>Query (IObjectQuery)<br>TotalRecords (int)                                  | Occurs when the system retrieves object data using the ObjectQuery API.<br>The **Before** event type is suitable, for example, when you want to retrieve data from an external source. Assign the external data into the **Data** property of the handler's _ObjectDataEventArgs_ parameter, which is empty by default in the Before event.<br>Use the **After** event type if you need to edit the data retrieved from Xperience in the **Data** property.<br>The **Total** **Records** property provides a number of total records in case paging is used. Use _-1_ to use the rows count of the **Data** property. |

## ContentItemEvents

**Namespace**: CMS.ContentEngine

Contains events that occur when changes are made to [content items](https://docs.kentico.com/documentation/business-users/content-hub/content-items.md).

> **Note:** **Async content item event handlers**
>
> We recommend using the newer approach for implementing and registering content item events, which provides full support for async/await code and dependency injection. See [Handle content events](https://docs.kentico.com/documentation/developers-and-admins/customization/handle-global-events/handle-content-events.md).

| Event                  | Event types                | Handler          | Handler parameters                         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ---------------------- | -------------------------- | ---------------- | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Create                 | Before<br>After<br>Failure | Advanced handler | CreateContentItemEventArgs                 | Occurs when a new content item (not a language variant) is created.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| CreateLanguageVariant  | Before<br>After<br>Failure | Advanced handler | CreateContentItemLanguageVariantEventArgs  | Occurs when a new language variant of an existing content item is created.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| UpdateDraft            | Before<br>After<br>Failure | Advanced handler | UpdateContentItemDraftEventArgs            | Occurs when a draft is updated.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Publish                | Execute                    | Basic handler    | PublishContentItemEventArgs                | Occurs when an item is published.<br>Also triggers when the system publishes an item that was [scheduled to be published](https://docs.kentico.com/documentation/business-users/content-hub/content-items.md#scheduled-publishing). The scheduling action itself triggers the `UpdateLanguageMetadata` event for the item.                                                                                                                                                                                                                                                                                                                                                             |
| Unpublish              | Execute                    | Basic handler    | UnpublishContentItemEventArgs              | Occurs when an item is unpublished.<br>Also triggers when the system unpublishes an item that was scheduled to be unpublished. The scheduling action itself triggers the `UpdateLanguageMetadata` event for the item.                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Delete                 | Execute                    | Basic handler    | DeleteContentItemEventArgs                 | Occurs when an item is deleted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| UpdateMetadata         | Before<br>After<br>Failure | Advanced handler | UpdateContentItemMetadataEventArgs         | Occurs when an item's metadata is updated (e.g., security settings).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| UpdateLanguageMetadata | Before<br>After<br>Failure | Advanced handler | UpdateContentItemLanguageMetadataEventArgs | Occurs when an item's [language](https://docs.kentico.com/documentation/developers-and-admins/configuration/languages.md) variant-specific metadata is updated (e.g., administration display name).<br>This metadata includes the time when an item is [scheduled to be published](https://docs.kentico.com/documentation/business-users/content-hub/content-items.md#scheduled-publishing) or unpublished. As a result, scheduling an item to be published or unpublished (or canceling a scheduled publish action) triggers the `UpdateLanguageMetadata` event, not `Publish` or `Unpublish`. These events are triggered when the system actually publishes or unpublishes the item. |

> **Info:** **General information**
>
> Events are not cancelable. If you try to cancel an event, an exception is thrown instead. You can also throw exceptions to stop the corresponding operation. For example, an exception thrown from an event while creating an object will roll back the transaction.
>
> **Event handlers**
>
> **Advanced handler**
>
> Events handled by advanced handlers expose property setters in their event args that can be used to further modify the item before it is stored in the database. Content type-specific data can be updated via the `ContentItemData` property, if present.
>
> **Basic handler**
>
> Events handled by basic handlers are only used for notification.

## WebPageEvents

**Namespace**: CMS.Websites

Contains events that occur when changes are made to [pages](https://docs.kentico.com/documentation/business-users/website-content.md).

> **Note:** **Async page event handlers**
>
> We recommend using the newer approach for implementing and registering page events, which provides full support for async/await code and dependency injection. See [Handle content events](https://docs.kentico.com/documentation/developers-and-admins/customization/handle-global-events/handle-content-events.md).

| Event                       | Event types                | Handler          | Handler parameters                                                                                                                                                                                         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| --------------------------- | -------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Create                      | Before<br>After<br>Failure | Advanced handler | CreateWebPageLanguageVariantEventArgs                                                                                                                                                                      | Occurs when a new page is created.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| CreateFolder                | Before<br>After<br>Failure | Advanced handler | CreateFolderLanguageVariantEventArgs                                                                                                                                                                       | Occurs when a new folder is created.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| CreateLanguageVariant       | Before<br>After<br>Failure | Advanced handler | CreateWebPageLanguageVariantEventArgs                                                                                                                                                                      | Occurs when a new page language variant is created.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| CreateFolderLanguageVariant | Before<br>After<br>Failure | Advanced handler | CreateFolderLanguageVariantEventArgs                                                                                                                                                                       | Occurs when a new folder language variant is created.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| UpdateDraft                 | Before<br>After<br>Failure | Advanced handler | UpdateWebPageDraftEventArgs                                                                                                                                                                                | Occurs when a page draft is updated.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Publish                     | Execute                    | Basic handler    | PublishWebPageEventArgs                                                                                                                                                                                    | Occurs when a page is published.<br>Also triggers when the system publishes a page that was [scheduled to be published](https://docs.kentico.com/documentation/business-users/website-content/edit-and-publish-pages.md#scheduled-publishing). The scheduling action itself triggers the `UpdateLanguageMetadata` event for the page.                                                                                                                                                                                                                                                                                                                                                              |
| Unpublish                   | Execute                    | Basic handler    | UnpublishWebPageEventArgs<br>Also triggers when the system unpublishes a page that was scheduled to be unpublished. The scheduling action itself triggers the `UpdateLanguageMetadata` event for the page. | Occurs when a page is unpublished.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Move                        | Execute                    | Basic handler    | MoveWebPageEventArgs                                                                                                                                                                                       | Occurs when a page is moved.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| UpdateMetadata              | Before<br>After<br>Failure | Advanced handler | UpdateWebPageMetadataEventArgs                                                                                                                                                                             | Occurs when page properties are updated.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| UpdateTreePathSlug          | Before<br>After<br>Failure | Advanced handler | UpdateWebPageTreePathSlugEventArgs                                                                                                                                                                         | Occurs when the page URL slug is changed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| UpdateSecuritySettings      | Before<br>After<br>Failure | Advanced handler | UpdateWebPageSecuritySettingsEventsArgs                                                                                                                                                                    | Occurs when page security settings are updated.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Delete                      | Execute                    | Basic handler    | DeleteWebPageEventArgs                                                                                                                                                                                     | Occurs when a page is deleted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| UpdateLanguageMetadata      | Before<br>After<br>Failure | Advanced handler | UpdateWebPageLanguageMetadataEventArgs                                                                                                                                                                     | Occurs when a page's [language](https://docs.kentico.com/documentation/developers-and-admins/configuration/languages.md) variant-specific metadata is updated (e.g., administration display name).<br>This metadata includes the time when a page is [scheduled to be published](https://docs.kentico.com/documentation/business-users/website-content/edit-and-publish-pages.md#scheduled-publishing) pr unpublished. As a result, scheduling a page to be published or unpublished (or canceling the scheduled publish action) triggers the `UpdateLanguageMetadata` event, not `Publish` or `Unpublish`. These events are triggered when the system actually publishes or unpublishes the page. |

> **Info:** **General information**
>
> Events are not cancelable. If you try to cancel an event, an exception is thrown instead. You can also throw exceptions to stop the corresponding operation. For example, an exception thrown from an event while creating an object will roll back the transaction.
>
> **Event handlers**
>
> **Advanced handler**
>
> Events handled by advanced handlers expose property setters in their event args that can be used to further modify the item before it is stored in the database. Content type-specific data can be updated via the `ContentItemData` property, if present.
>
> **Basic handler**
>
> Events handled by basic handlers are only used for notification.

## HeadlessItemEvents

**Namespace**: CMS.ContentEngine

Contains events that occur when changes are made to [headless items](https://docs.kentico.com/documentation/business-users/headless-content.md).

> **Note:** **Async headless item event handlers**
>
> We recommend using the newer approach for implementing and registering headless item events, which provides full support for async/await code and dependency injection. See [Handle content events](https://docs.kentico.com/documentation/developers-and-admins/customization/handle-global-events/handle-content-events.md).

| Event                  | Event types                | Handler          | Handler parameters                          | Description                                                                               |
| ---------------------- | -------------------------- | ---------------- | ------------------------------------------- | ----------------------------------------------------------------------------------------- |
| Create                 | Before<br>After<br>Failure | Advanced handler | CreateHeadlessItemEventArgs                 | Occurs when a new headless item (not a language variant) is created.                      |
| CreateLanguageVariant  | Before<br>After<br>Failure | Advanced handler | CreateHeadlessItemLanguageVariantEventArgs  | Occurs when a new language variant of an existing headless item is created.               |
| UpdateDraft            | Before<br>After<br>Failure | Advanced handler | UpdateHeadlessItemDraftEventArgs            | Occurs when a headless item draft is updated.                                             |
| Publish                | Execute                    | Basic handler    | PublishHeadlessItemEventArgs                | Occurs when a headless item is published.                                                 |
| Unpublish              | Execute                    | Basic handler    | UnpublishHeadlessItemEventArgs              | Occurs when a headless item is unpublished.                                               |
| Delete                 | Execute                    | Basic handler    | DeleteHeadlessItemEventArgs                 | Occurs when a headless item is deleted.                                                   |
| UpdateMetadata         | Before<br>After<br>Failure | Advanced handler | UpdateHeadlessItemMetadataEventArgs         | Occurs when a headless item's metadata is updated (e.g., security settings).              |
| UpdateLanguageMetadata | Before<br>After<br>Failure | Advanced handler | UpdateHeadlessItemLanguageMetadataEventArgs | Occurs when a headless item's language metadata is updated (e.g., admin UI display name). |

> **Info:** **General information**
>
> Events are not cancelable. If you try to cancel an event, an exception is thrown instead. You can also throw exceptions to stop the corresponding operation. For example, an exception thrown from an event while creating an object will roll back the transaction.
>
> **Event handlers**
>
> **Advanced handler**
>
> Events handled by advanced handlers expose property setters in their event args that can be used to further modify the item before it is stored in the database. Content type-specific data can be updated via the `ContentItemData` property, if present.
>
> **Basic handler**
>
> Events handled by basic handlers are only used for notification.

## Workflow events

**Namespace**: CMS.ContentWorkflowEngine

The following classes contain events related to items under [workflow](https://docs.kentico.com/documentation/developers-and-admins/configuration/workflows.md):

- `WebPageWorkflowEvents` – for [pages](https://docs.kentico.com/documentation/business-users/website-content.md) in website channels.
- `ContentItemWorkflowEvents` – for reusable content items in the [Content hub](https://docs.kentico.com/documentation/business-users/content-hub.md).
- `HeadlessItemWorkflowEvents` – for [headless items](https://docs.kentico.com/documentation/business-users/headless-content.md) in headless channels.

| Event      | Event types | Handler parameters                                                                                                        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ---------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| MoveToStep | Execute     | WebPageWorkflowMoveToStepArguments&#xA;ContentItemWorkflowMoveToStepArguments&#xA;HeadlessItemWorkflowMoveToStepArguments | Occurs when a page/content item/headless item is moved from one workflow step to another.<br>The event arguments allow you to access the name of the current and original workflow step, the [user](https://docs.kentico.com/documentation/developers-and-admins/configuration/users.md) who changed the step, and also properties of the given page, content item or headless item (ID, name, content type, language, etc.).<br>If built-in [workflow notifications](https://docs.kentico.com/documentation/developers-and-admins/configuration/workflows.md#workflow-notifications) are enabled for the step the item is moved to, you can also access the comment entered by the user who moved the item.<br>The event is **not** triggered when an item is published or scheduled to be published. For publish transitions, you need to handle the `Publish` or `UpdateLanguageMetadata` event of `WebPageEvents`, `ContentItemEvents` or `HeadlessItemEvents`.<br>**Example**: [Set up custom workflow notifications](https://docs.kentico.com/documentation/developers-and-admins/customization/handle-global-events/set-up-custom-workflow-notifications.md) |

## DataProtectionEvents

**Namespace**: CMS.DataProtection

Contains events related to protection of personal data in the system.

| Event                  | Event types | Handler parameters                                                                                                                             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ---------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| RevokeConsentAgreement | Execute     | RevokeConsentAgreementEventArgs<br>**Properties**<br>ConsentAgreement (ConsentAgreementInfo)<br>Consent (ConsentInfo)<br>Contact (ContactInfo) | Occurs when a consent agreement is revoked. When a contact's consent agreement is revoked, this event can be used to perform custom actions, such as terminating tracking of the contact or deleting [personal data](https://docs.kentico.com/documentation/developers-and-admins/data-protection.md) related to the contact.<br>**See also**: [Consent management](https://docs.kentico.com/documentation/developers-and-admins/data-protection/consent-management.md), [Consent development](https://docs.kentico.com/documentation/developers-and-admins/data-protection/consent-development.md) |

## EventLogEvents

**Namespace**: CMS.EventLog

Contains events that occur when writing [logged events](https://docs.kentico.com/documentation/developers-and-admins/development/logging.md) into the system's [event log](https://docs.kentico.com/documentation/developers-and-admins/configuration/event-log.md).

| Event    | Event types                | Handler parameters                                     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| -------- | -------------------------- | ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| LogEvent | Before<br>After<br>Failure | LogEventArgs<br>**Properties**<br>Event (EventLogInfo) | Occurs when the system writes a record into the event log. Only affects events in the built-in Xperience event log, not log entries created via `ILogger` in general.<br>You can use the _Before_ event to customize the data logged for events or cancel logging for certain types of events. The _After_ event allows you to perform custom actions after events are successfully logged.<br>**See also**: [Customize event logging](https://docs.kentico.com/documentation/developers-and-admins/development/logging.md#customize-event-logging) |

## BizFormItemEvents

**Namespace**: CMS.OnlineForms

Contains events related to [form](https://docs.kentico.com/documentation/business-users/digital-marketing/forms.md) actions. See [Handle form events](https://docs.kentico.com/documentation/developers-and-admins/customization/handle-global-events/handle-form-events.md) for an example.

| Event  | Event types                | Handler parameters                                           | Description                                                   |
| ------ | -------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------- |
| Insert | Before<br>After<br>Failure | BizFormItemEventArgs<br>**Properties**<br>Item (BizFormItem) | Occurs when inserting new form items (data records of forms). |
| Update | Before<br>After<br>Failure | BizFormItemEventArgs<br>**Properties**<br>Item (BizFormItem) | Occurs when updating form data records.                       |
| Delete | Before<br>After<br>Failure | BizFormItemEventArgs<br>**Properties**<br>Item (BizFormItem) | Occurs when deleting data records from forms.                 |

## ContactManagementEvents

**Namespace**: CMS.ContactManagement

| Event               | Event types | Handler parameters                                                                                                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ContactInfosDeleted | Execute     | ContactInfosDeletedHandlerEventArgs<br>**Properties**<br>DeletedContactsIds (IEnumerable)<br>DeletedContactsGUIDs (IEnumberable) | Occurs when multiple contacts are deleted in a batch. This event is triggered when calling `IContactsBulkDeletionService.BulkDelete`, for example when [deleting inactive contacts](https://docs.kentico.com/documentation/developers-and-admins/digital-marketing-setup/contact-configuration/delete-inactive-contacts.md).<br>When a single contact is deleted, the _TypeInfoEvents.Delete_ event can be used on _ContactInfo.TYPEINFO_. |

## ActivityEvents

**Namespace**: CMS.Activities

| Event                         | Event types                | Handler parameters | Description                                                                                                                                                                                                                                                                                                                                                   |
| ----------------------------- | -------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ActivityBulkInsertPerformed   | Before<br>After<br>Failure | CMSEventArgs>      | Occurs when the system processes [digital marketing activities](https://docs.kentico.com/documentation/business-users/digital-marketing/contact-activities.md) that are logged in memory and inserts them into the database.                                                                                                                                  |
| ActivityProcessedInLogService | Execute                    | CMSEventArgs       | Occurs when a [digital marketing activity](https://docs.kentico.com/documentation/business-users/digital-marketing/contact-activities.md) is logged and processed. At this point, the activity is only stored in the application memory (activities are regularly processed and saved in bulk to the database – see the _ActivityBulkInsertPerformed_ event). |

## SystemEvents

**Namespace**: CMS.Base

Contains general system events.

| Event     | Event types | Handler parameters                                                                | Description                                             |
| --------- | ----------- | --------------------------------------------------------------------------------- | ------------------------------------------------------- |
| Exception | Execute     | SystemEventArgs<br>**Properties**<br>Exception (Exception)<br>LogException (bool) | Fires when an unhandled exception occurs in the system. |

## SqlEvents

**Namespace**: CMS.DataEngine

Contains events related to the execution of queries and other database operations.

| Event           | Event types                | Handler parameters                                                                                                                                                                       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| --------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| BulkInsert      | Before<br>After<br>Failure | BulkInsertDataEventArgs<br>**Properties**<br>Connection (IDataConnection)<br>InsertSettings (BulkInsertSettings)<br>SourceData (DataTable)<br>TargetTable (string)                       | Occurs when the system creates objects by directly inserting data into a database table.                                                                                                                                                                                                                                                                                                                                                                                                    |
| ExecuteQuery    | Before<br>After<br>Failure | ExecuteQueryEventArgs<br>**Properties**<br>Connection (IDataConnection)<br>Query (QueryParameters)<br>Result (DataSet)                                                                   | Occurs when the system executes a [DataSet](https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/populating-a-dataset-from-a-dataadapter) database query.                                                                                                                                                                                                                                                                                                                         |
| ExecuteNonQuery | Before<br>After<br>Failure | ExecuteQueryEventArgs<br>**Properties**<br>Connection (IDataConnection)<br>Result (DataSet)                                                                                              | Occurs when the system executes a non-query database operation.                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ExecuteScalar   | Before<br>After<br>Failure | ExecuteQueryEventArgs<br>**Properties**<br>Connection (IDataConnection)<br>Query (QueryParameters)<br>Result (DataSet)                                                                   | Occurs when the system executes a scalar query.                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ExecuteReader   | Before<br>After<br>Failure | ExecuteQueryEventArgs<[DbDataReader](https://docs.microsoft.com/en-us/dotnet/api/system.data.common.dbdatareader)><br>**Properties**<br>Connection (IDataConnection)<br>Result (DataSet) | Occurs when the system runs a database [DataReader](https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/dataadapters-and-datareaders), e.g., when the system (or custom code) materializes an [ObjectQuery](https://docs.kentico.com/documentation/developers-and-admins/api/objectquery-api.md) or [content item query](https://docs.kentico.com/documentation/developers-and-admins/api/content-item-api/content-item-query-api.md) call, typically by enumerating the results. |

## Application events

Xperience provides a set of events that you can use to customize the global behavior of the application.

### ApplicationEvents

**Namespace**: CMS.Base

Contains events related to the application lifecycle.

The following table lists the events that **occur once in the application's lifecycle, in order of execution**:

| Event          | Event types | Handler parameters                                                        | Description                                                                                                                                                                                                                                                                                              |
| -------------- | ----------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| PreInitialized | Execute     | [EventArgs](https://docs.microsoft.com/en-us/dotnet/api/system.eventargs) | Occurs when the application finishes pre-initialization (preparation of things unrelated to the database).<br>Handlers need to be assigned in the **PreInit** method of [custom modules](https://docs.kentico.com/documentation/developers-and-admins/customization/run-code-on-application-startup.md). |
| Initialized    | Execute     | [EventArgs](https://docs.microsoft.com/en-us/dotnet/api/system.eventargs) | Occurs when the application finishes initialization and starts (including all modules and the database connection). Handle this event to perform standard application start events.                                                                                                                      |
| End            | Execute     | [EventArgs](https://docs.microsoft.com/en-us/dotnet/api/system.eventargs) | Occurs when the application ends.                                                                                                                                                                                                                                                                        |

The following events occur as needed during the application lifecycle:

| Event | Event types | Handler parameters                                                        | Description                                    |
| ----- | ----------- | ------------------------------------------------------------------------- | ---------------------------------------------- |
| Error | Execute     | [EventArgs](https://docs.microsoft.com/en-us/dotnet/api/system.eventargs) | Fires when an error occurs in the application. |

### RequestEvents

**Namespace**: CMS.Base

Contains events related to the handling of requests.

The following table lists available events **in the order they are invoked by the application**:

| Event                 | Event type | Handler parameters                                                        | Description                                                                                                                                                                                                                            |
| --------------------- | ---------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Prepare               | Execute    | [EventArgs](https://docs.microsoft.com/en-us/dotnet/api/system.eventargs) | Occurs before request processing begins.                                                                                                                                                                                               |
| Begin                 | Execute    | [EventArgs](https://docs.microsoft.com/en-us/dotnet/api/system.eventargs) | Occurs when request processing starts.                                                                                                                                                                                                 |
| PreSendRequestHeaders | Execute    | [EventArgs](https://docs.microsoft.com/en-us/dotnet/api/system.eventargs) | Occurs just before ASP.NET sends HTTP headers to the client.<br>**Note**: Added delegates are invoked during [HttpResponse.OnStarting](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httpresponse.onstarting). |
| End                   | Execute    | [EventArgs](https://docs.microsoft.com/en-us/dotnet/api/system.eventargs) | Occurs at the end of request processing.                                                                                                                                                                                               |
| RunEndRequestTasks    | Execute    | [EventArgs](https://docs.microsoft.com/en-us/dotnet/api/system.eventargs) | Allows you to execute background tasks at the end of request processing. Running long tasks in this event's handlers can negatively affect the response time of requests.                                                              |
| Finalize              | Execute    | [EventArgs](https://docs.microsoft.com/en-us/dotnet/api/system.eventargs) | Occurs when the request is finalized. Use to clean up and release any resources used by the request. Running long tasks in this event's handlers can negatively affect the response time of requests.                                  |
