> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cuey.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Event

> Delete a pending event

## Overview

Delete an event. Only pending events that were created manually (not by cron jobs) can be deleted.

<RequestExample>
  ```typescript Delete event theme={null}
  import { cuey } from "cuey";

  await cuey.events.delete("event-id");
  ```
</RequestExample>

## Parameters

<ParamField path="id" type="string" required>
  The UUID of the event to delete.
</ParamField>

## Response

Returns `void` on success. No response body is returned.

<ResponseExample>
  ```typescript Success theme={null}
  // Method returns void, no response body
  ```
</ResponseExample>

## Errors

<Warning>
  Only pending events that were created manually (not by cron jobs) can be deleted. Events created by cron jobs cannot be deleted individually.
</Warning>

* `NotFoundError`: If the event doesn't exist
* `BadRequestError`: If the event cannot be deleted (e.g., created by cron, not pending)
* `UnauthorizedError`: If API key is invalid or missing

## Examples

### Delete a Pending Event

```typescript theme={null}
import { cuey } from "cuey";

const event = await cuey.events.get("event-id");

if (event.status === "pending" && !event.cron_id) {
  await cuey.events.delete(event.id);
  console.log("Event deleted successfully");
}
```

### Safe Delete with Error Handling

```typescript theme={null}
import { cuey } from "cuey";
import { NotFoundError, BadRequestError } from "cuey";

try {
  await cuey.events.delete("event-id");
  console.log("Event deleted successfully");
} catch (error) {
  if (error instanceof NotFoundError) {
    console.error("Event not found");
  } else if (error instanceof BadRequestError) {
    console.error("Cannot delete event:", error.message);
  } else {
    console.error("Error deleting event:", error);
  }
}
```
