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

# Deleting Records

> How to delete entities in Nexudus using the SDK.

# Deleting Records

Use `DeleteAsync` to remove an entity by its ID.

## Delete a record

```csharp theme={null}
var endpoint = new CoworkerEndpoint(client);
await endpoint.DeleteAsync(id);
Console.WriteLine("Coworker deleted.");
```

## Error handling

`DeleteAsync` throws `InvalidOperationException` if the deletion fails — for example, when the entity has dependent records:

```csharp theme={null}
try
{
    await endpoint.DeleteAsync(id);
    Console.WriteLine("Deleted successfully.");
}
catch (InvalidOperationException ex)
{
    Console.WriteLine($"Deletion failed: {ex.Message}");
}
```

<Warning>
  Deletions are permanent. There is no undo. Make sure you are deleting the correct entity.
</Warning>
