# IRPCEventHandlersAdmin.GetServerEventHandlers

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md) > [Event handlers](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventHandlersAdmin/index.md)

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

Badges: `Administration API / specialized` `admin` `session` `idempotent`

Gets all server-level event handlers, with their code.

- **Service:** [Event handlers](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventHandlersAdmin/index.md) `MFiles.IRPCEventHandlersAdmin`
- **gRPC method:** `/MFiles.IRPCEventHandlersAdmin/GetServerEventHandlers`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/get-server-event-handlers`
- **Request:** [`GetServerEventHandlersRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventHandlersAdmin/GetServerEventHandlers/index.md#request)
- **Response:** [`GetServerEventHandlersResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventHandlersAdmin/GetServerEventHandlers/index.md#response)
- **Book and level:** Administration API, specialized
- **Kind:** admin
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** yes
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

- Requires the server right `run_code`. A server-level session is enough. A vault administrator
  without `run_code` gets "Access denied. You do not have the server-level access rights
  required by this operation." (0x800400A8).

<a id="request"></a>

## Request: GetServerEventHandlersRequest

No fields.

<a id="response"></a>

## Response: GetServerEventHandlersResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `values[]` | repeated [`InternalEventHandler`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.InternalEventHandler/index.md) | The server-level event handlers. See [InternalEventHandler](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.InternalEventHandler/index.md). |
| `values[].event_type` | [`InternalEventType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.InternalEventType/index.md) | The event type the handler is associated with. |
| `values[].sort_index` | `int32` | The sort index defines the order in which the event handlers are executed in response to an event. |
| `values[].is_active` | `bool` | True when this handler is active and is executed in response to events. |
| `values[].description` | `string` | Description of the event handler. A user friendly identifier for the event handler. |
| `values[].code` | `string` | The actual code for the event handler that is executed in response an event.. |
| `values[].guid` | `string` | GUID for the event handler. |
