# Delete segment

> DELETE /segments/:id — remove a segment.

`DELETE /segments/:id`

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `segment_id` | string | Yes | The segment ID. |

**Node.js**

```js
import { SendPing } from 'sendping';

const mb = new SendPing('mb_xxxxxxxxx');

const { data, error } = await mb.segments.remove('4c1f8b2e-9a2f-4d71-8f0c-2b5d7e6a1c93');
console.log({ data, error });
```

**Ruby**

```ruby
require "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

SendPing::Segments.delete("4c1f8b2e-9a2f-4d71-8f0c-2b5d7e6a1c93")
```

**PHP**

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

use SendPing\SendPing;

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

$sendping->segments->remove('4c1f8b2e-9a2f-4d71-8f0c-2b5d7e6a1c93');
```

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

sendping.Segments.remove("4c1f8b2e-9a2f-4d71-8f0c-2b5d7e6a1c93")
```

**Go**

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

client := sendping.NewClient("mb_xxxxxxxxx")

removed, err := client.Segments.Remove("4c1f8b2e-9a2f-4d71-8f0c-2b5d7e6a1c93")
```

**Rust**

```rust
use sendping::SendPing;

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

let _removed = mb.segments.remove("4c1f8b2e-9a2f-4d71-8f0c-2b5d7e6a1c93").await?;
```

**Java**

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

SendPing sendping = new SendPing("mb_xxxxxxxxx");

SendPingResponse response = sendping.segments().remove("4c1f8b2e-9a2f-4d71-8f0c-2b5d7e6a1c93");
```

**.NET**

```csharp
using SendPing;

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

var resp = await sendping.SegmentDeleteAsync("4c1f8b2e-9a2f-4d71-8f0c-2b5d7e6a1c93");
```

**cURL**

```bash
curl -X DELETE 'https://www.sendping.co/api/segments/4c1f8b2e-9a2f-4d71-8f0c-2b5d7e6a1c93' \
  -H 'Authorization: Bearer mb_xxxxxxxxx'
```

**CLI**

```bash
sendping segments delete 4c1f8b2e-9a2f-4d71-8f0c-2b5d7e6a1c93
```

### Response

```json
{ "object": "segment", "id": "4c1f8b2e-9a2f-4d71-8f0c-2b5d7e6a1c93", "deleted": true }
```
