# Delete topic

> DELETE /topics/:id — delete a topic and all per-contact subscription state for it.

`DELETE /topics/:id`

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `topic_id` | string | Yes | The topic ID. |

**Node.js**

```js
import { SendDart } from 'senddart';

const mb = new SendDart('mb_xxxxxxxxx');

const { data, error } = await mb.topics.remove('topic_9a2f...');
console.log({ data, error });
```

**Ruby**

```ruby
require "senddart"

SendDart.api_key = "mb_xxxxxxxxx"

SendDart::Topics.delete("topic_9a2f...")
```

**PHP**

```php
<?php
require 'vendor/autoload.php';

use SendDart\SendDart;

$senddart = SendDart::client('mb_xxxxxxxxx');

$senddart->topics->remove('topic_9a2f...');
```

**Python**

```python
import senddart

senddart.api_key = "mb_xxxxxxxxx"

senddart.Topics.remove("topic_9a2f...")
```

**Go**

```go
import "github.com/shekhu10/senddart-sdks/senddart-go"

client := senddart.NewClient("mb_xxxxxxxxx")

removed, err := client.Topics.Remove("topic_9a2f...")
```

**Rust**

```rust
use senddart::SendDart;

let mb = SendDart::new("mb_xxxxxxxxx");

let _removed = mb.topics.remove("topic_9a2f...").await?;
```

**Java**

```java
import com.senddart.SendDart;
import com.senddart.SendDartResponse;

SendDart senddart = new SendDart("mb_xxxxxxxxx");

SendDartResponse response = senddart.topics().remove("topic_9a2f...");
```

**.NET**

```csharp
using SendDart;

ISendDart senddart = SendDartClient.Create("mb_xxxxxxxxx");

var resp = await senddart.TopicDeleteAsync("topic_9a2f...");
```

**cURL**

```bash
curl -X DELETE 'https://www.senddart.com/api/topics/topic_9a2f...' \
  -H 'Authorization: Bearer mb_xxxxxxxxx'
```

**CLI**

```bash
senddart topics delete topic_9a2f...
```

### Response

```json
{ "object": "topic", "id": "topic_9a2f...", "deleted": true }
```
