# IRPCEventsAdmin.DeleteEventsRange

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 administration](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/index.md)

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

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

Deletes the events whose IDs are in the given range.

- **Service:** [Event administration](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/index.md) `MFiles.IRPCEventsAdmin`
- **gRPC method:** `/MFiles.IRPCEventsAdmin/DeleteEventsRange`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/delete-events-range`
- **Request:** [`DeleteEventsRangeRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/DeleteEventsRange/index.md#request)
- **Response:** [`DeleteEventsRangeResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/DeleteEventsRange/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:** no
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

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

## Remarks

- **Destructive.** Set both bounds to -1 to delete all events; the defaults (0 and 0) delete
  only an event with ID 0.
- Deletes only events for which notifications have been created. Before deleting, the server
  starts notification processing and waits about five seconds; events still waiting for it
  stay.
- Adds an "event log cleared" event (`EVENT_TYPE_EVENT_LOG_CLEARED`) with the range, when event
  logging is on.
- Requires a vault session and the vault right `manage_events`. Allowed also in vaults with the
  advanced event log features.

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

## Request: DeleteEventsRangeRequest

> 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 |
|---|---|---|
| `oldest_event_to_delete` | `int64` | The lowest event ID to delete, or -1 for no lower bound. |
| `newest_event_to_delete` | `int64` | The highest event ID to delete, or -1 for no upper bound. |

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

## Response: DeleteEventsRangeResponse

No fields.
