# 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. Optional; if omitted, all segments are returned in a single response. Minimum `1`, maximum `100`. |
| `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 { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('mb_xxxxxxxxx');

const { data, error } = await mb.segments.list({ domain: 'yourdomain.com' });
console.log({ data, error });
```

**Ruby**

```ruby
require "mailblastr"

Mailblastr.api_key = "mb_xxxxxxxxx"

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

**PHP**

```php
$mailblastr = Mailblastr::client('mb_xxxxxxxxx');

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

**Python**

```python
import mailblastr

mailblastr.api_key = "mb_xxxxxxxxx"

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

**Go**

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

**Rust**

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

**Java**

```java
Mailblastr mailblastr = new Mailblastr("mb_xxxxxxxxx");
mailblastr.segments().list("yourdomain.com");
```

**.NET**

```csharp
IMailblastr mailblastr = MailblastrClient.Create("mb_xxxxxxxxx");
var resp = await mailblastr.SegmentListAsync("yourdomain.com");
```

**cURL**

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

**CLI**

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

### Response

```json
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "object": "segment",
      "id": "seg_9a2f...",
      "audience_id": "aud_3b1c...",
      "name": "Gmail subscribers",
      "filter": { "status": "subscribed", "email_contains": "@gmail.com", "property_filters": [] },
      "created_at": "2026-06-23T10:00:00.000Z",
      "updated_at": "2026-06-23T10:00:00.000Z"
    }
  ]
}
```
