# 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 { SendDart } from 'senddart';

const mb = new SendDart('mb_xxxxxxxxx');

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

**Ruby**

```ruby
require "senddart"

SendDart.api_key = "mb_xxxxxxxxx"

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

**PHP**

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

use SendDart\SendDart;

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

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

**Python**

```python
import senddart

senddart.api_key = "mb_xxxxxxxxx"

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

**Go**

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

client := senddart.NewClient("mb_xxxxxxxxx")

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

**Rust**

```rust
use senddart::SendDart;

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

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

**Java**

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

SendDart senddart = new SendDart("mb_xxxxxxxxx");

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

**.NET**

```csharp
using SendDart;

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

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

**cURL**

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

**CLI**

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

### Response

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