# EventSubscription

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.EventSubscription/

Struct for a single event subscription.

- **Full name:** `MFiles.EventSubscription`
- **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-type"></a>`type` | [`EventType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.EventType/index.md) | 1 | The type of the event. [ switch_is( eventtype ) ] EventTypeSpecificDataUnion etsdu;  //!< Additional event type -specific data as a union. |

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

## Used by methods

- [IRPCObjectOperations.GetDocEventSubscriptions](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/GetDocEventSubscriptions/index.md): Gets the caller's event subscriptions for an object.
- [IRPCObjectOperations.SetDocEventSubscriptions](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/SetDocEventSubscriptions/index.md): Replaces the caller's event subscriptions for an object.

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

## Used in fields

- [`NotificationRule.subscriptions`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.NotificationRule/index.md#f-subscriptions): The events that trigger a notification. A single `EVENT_TYPE_OBJECT_NOTIFICATION` subscription makes the rule filter-based: it then notifies about the objects that match `object_filter`.
- [`ObjectVersionData.user_event_subscriptions`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectVersionData/index.md#f-user_event_subscriptions): The pointer to event subscription. Null pointer, if data was not requested.
- [`GetDocEventSubscriptionsResponse.subscriptions`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/GetDocEventSubscriptions/index.md#response): Receives the results.
- [`SetDocEventSubscriptionsRequest.utf8szeventsubs`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/SetDocEventSubscriptions/index.md#request): Event subscriptions.
