# List segments

> GET /segments — list a sending domain’s segments.

`GET /segments`

Lists the segments on one sending domain. The `domain` query parameter is required, and the result always includes the domain’s auto-created **General** segment (all contacts).

**Query parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | string | Yes | The sending domain whose segments to list. |
| `limit` | number | No | Number of segments to retrieve. An integer between `1` and `100`. Optional; if omitted, every segment on the domain is returned in a single response up to a ceiling of **1,000**, and `has_more` is `true` when that ceiling truncated the page — keep walking with `after`. |
| `after` | string | No | The segment ID *after* which to retrieve more segments (for pagination). The ID is not included in the result. Cannot be combined with `before`. |
| `before` | string | No | The segment ID *before* which to retrieve more segments (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.list({ domain: 'yourdomain.com' });
console.log({ data, error });
```

**Ruby**

```ruby
require "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

SendPing::Segments.list({
  "domain": "yourdomain.com"
})
```

**PHP**

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

use SendPing\SendPing;

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

$sendping->segments->list([
  'domain' => "yourdomain.com"
]);
```

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

sendping.Segments.list({
  "domain": "yourdomain.com"
})
```

**Go**

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

client := sendping.NewClient("mb_xxxxxxxxx")

segments, err := client.Segments.List(&sendping.ListSegmentsRequest{
    Domain: "yourdomain.com",
})
```

**Rust**

```rust
use sendping::{ListSegmentsParams, SendPing};

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

let _segments = mb.segments.list(ListSegmentsParams::new("yourdomain.com")).await?;
```

**Java**

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

SendPing sendping = new SendPing("mb_xxxxxxxxx");

SendPingResponse response = sendping.segments().list("yourdomain.com");
```

**.NET**

```csharp
using SendPing;

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

var resp = await sendping.SegmentListAsync("yourdomain.com");
```

**cURL**

```bash
curl -X GET 'https://www.sendping.co/api/segments?domain=yourdomain.com' \
  -H 'Authorization: Bearer mb_xxxxxxxxx'
```

**CLI**

```bash
sendping segments list \
  --domain yourdomain.com
```

### Response

```json
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "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"
    }
  ]
}
```
