# Retrieve segment

> GET /segments/:id — fetch a single segment.

`GET /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.get('4c1f8b2e-9a2f-4d71-8f0c-2b5d7e6a1c93');
console.log({ data, error });
```

**Ruby**

```ruby
require "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

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

**PHP**

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

use SendPing\SendPing;

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

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

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

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

**Go**

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

client := sendping.NewClient("mb_xxxxxxxxx")

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

**Rust**

```rust
use sendping::SendPing;

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

let _segment = mb.segments.get("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().get("4c1f8b2e-9a2f-4d71-8f0c-2b5d7e6a1c93");
```

**.NET**

```csharp
using SendPing;

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

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

**cURL**

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

**CLI**

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

### Response

```json
{
  "object": "segment",
  "id": "4c1f8b2e-9a2f-4d71-8f0c-2b5d7e6a1c93",
  "audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
  "name": "Gmail subscribers",
  "filter": { "status": "subscribed", "email_contains": "@gmail.com", "property_filters": [], "engagement": null },
  "created_at": "2026-06-23T10:00:00.000Z",
  "updated_at": "2026-06-23T10:00:00.000Z"
}
```
