# 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 { SendPing } from 'sendping';

const mb = new SendPing('mb_xxxxxxxxx');

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

**Ruby**

```ruby
require "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

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

**PHP**

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

use SendPing\SendPing;

$sendping = SendPing::client('mb_xxxxxxxxx');

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

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

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

**Go**

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

client := sendping.NewClient("mb_xxxxxxxxx")

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

**Rust**

```rust
use sendping::SendPing;

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

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

**Java**

```java
import co.sendping.SendPing;
import co.sendping.SendPingResponse;

SendPing sendping = new SendPing("mb_xxxxxxxxx");

SendPingResponse response = sendping.topics().remove("topic_9a2f...");
```

**.NET**

```csharp
using SendPing;

ISendPing sendping = SendPingClient.Create("mb_xxxxxxxxx");

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

**cURL**

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

**CLI**

```bash
sendping topics delete topic_9a2f...
```

### Response

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