# InternalEventHandler

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Reference](https://developer.m-files.com/APIs/gRPC-API/Reference/index.md) > [Messages](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.InternalEventHandler/

The definition of an EventHandler struct.

- **Full name:** `MFiles.InternalEventHandler`
- **Proto file:** [`mfiles/structs.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/structs.proto)

<a id="fields"></a>

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-event_type"></a>`event_type` | [`InternalEventType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.InternalEventType/index.md) | 1 | The event type the handler is associated with. |
| <a id="f-sort_index"></a>`sort_index` | `int32` | 2 | The sort index defines the order in which the event handlers are executed in response to an event. |
| <a id="f-is_active"></a>`is_active` | `bool` | 3 | True when this handler is active and is executed in response to events. |
| <a id="f-description"></a>`description` | `string` | 4 | Description of the event handler. A user friendly identifier for the event handler. |
| <a id="f-code"></a>`code` | `string` | 5 | The actual code for the event handler that is executed in response an event.. |
| <a id="f-guid"></a>`guid` | `string` | 6 | GUID for the event handler. |

<a id="used-by-methods"></a>

## Used by methods

- [IRPCEventHandlersAdmin.GetServerEventHandlers](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventHandlersAdmin/GetServerEventHandlers/index.md): Gets all server-level event handlers, with their code.
- [IRPCEventHandlersAdmin.GetVaultEventHandlers](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventHandlersAdmin/GetVaultEventHandlers/index.md): Gets all event handlers of the vault, with their code.
- [IRPCEventHandlersAdmin.SetServerEventHandlers](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventHandlersAdmin/SetServerEventHandlers/index.md): Replaces all server-level event handlers with the given list.
- [IRPCEventHandlersAdmin.SetVaultEventHandlers](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventHandlersAdmin/SetVaultEventHandlers/index.md): Replaces all event handlers of the vault with the given list.

<a id="used-in-fields"></a>

## Used in fields

- [`GetVaultEventHandlersResponse.values`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventHandlersAdmin/GetVaultEventHandlers/index.md#response): The event handlers of the vault. See [InternalEventHandler](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.InternalEventHandler/index.md).
- [`SetVaultEventHandlersRequest.event_handlers`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventHandlersAdmin/SetVaultEventHandlers/index.md#request): The complete new list of the vault's event handlers. Include existing handlers with their `guid`; leave `guid` empty for a new handler.
- [`GetServerEventHandlersResponse.values`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventHandlersAdmin/GetServerEventHandlers/index.md#response): The server-level event handlers. See [InternalEventHandler](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.InternalEventHandler/index.md).
- [`SetServerEventHandlersRequest.event_handlers`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventHandlersAdmin/SetServerEventHandlers/index.md#request): The complete new list of the server's event handlers.
