# List segment contacts

> GET /segments/:id/contacts — the contacts that match a segment.

`GET /segments/:id/contacts`

Returns the contacts in the segment’s audience that match its filter — a live preview of who a campaign to this segment would reach.

**Path parameters**

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

**Query parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | number | No | Number of contacts to retrieve. An integer between `1` and `100`. Optional; if omitted, all matching contacts are returned in a single response up to a ceiling of **1,000** — a segment matching 5,000 contacts returns the first 1,000 with `has_more: true`, so keep walking with `after`. |
| `after` | string | No | The contact ID *after* which to retrieve more contacts (for pagination). The ID is not included in the result. Cannot be combined with `before`. |
| `before` | string | No | The contact ID *before* which to retrieve more contacts (for pagination). The ID is not included in the result. Cannot be combined with `after`. |

**Node.js**

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

const mb = new SendPing('mb_xxxxxxxxx');

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

**Ruby**

```ruby
require "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

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

**PHP**

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

use SendPing\SendPing;

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

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

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

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

**Go**

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

client := sendping.NewClient("mb_xxxxxxxxx")

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

**Rust**

```rust
use sendping::SendPing;

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

let _contacts = mb.segments.contacts("4c1f8b2e-9a2f-4d71-8f0c-2b5d7e6a1c93", None).await?;
```

**Java**

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

SendPing sendping = new SendPing("mb_xxxxxxxxx");

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

**.NET**

```csharp
using SendPing;

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

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

**cURL**

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

**CLI**

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

### Response

```json
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "479e3145-dd0e-4f64-bf48-1d4b6d4cd8f6",
      "email": "ada@gmail.com",
      "first_name": "Ada",
      "last_name": null,
      "unsubscribed": false,
      "created_at": "2026-06-23T10:00:00.000Z"
    }
  ]
}
```
