# List Contact Segments

> GET /contacts/:id/segments — retrieve the segments a contact is part of.

`GET /contacts/:id/segments`

Retrieve a list of segments that a contact is part of. The contact is identified in the path by either its ID or its email address.

Either `id` or `email` must be provided.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | No | The Contact ID. |
| `email` | string | No | The Contact Email. |

**Query parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | number | No | Number of segments to retrieve. Maximum value: `100`. Minimum value: `1`. |
| `after` | string | No | The ID *after* which we'll retrieve more segments (for pagination). This ID will *not* be included in the returned list. Cannot be used with the `before` parameter. |
| `before` | string | No | The ID *before* which we'll retrieve more segments (for pagination). This ID will *not* be included in the returned list. Cannot be used with the `after` parameter. |

**Node.js**

```js
import { SendDart } from 'senddart';

const mb = new SendDart('mb_xxxxxxxxx');

const { data, error } = await mb.contacts.listSegments('e169aa45-1ecf-4183-9955-b1499d5701d3');
console.log({ data, error });
```

**Ruby**

```ruby
require "senddart"

SendDart.api_key = "mb_xxxxxxxxx"

SendDart::Contacts.list_segments("e169aa45-1ecf-4183-9955-b1499d5701d3")
```

**PHP**

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

use SendDart\SendDart;

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

$senddart->contacts->listSegments('e169aa45-1ecf-4183-9955-b1499d5701d3');
```

**Python**

```python
import senddart

senddart.api_key = "mb_xxxxxxxxx"

senddart.Contacts.list_segments("e169aa45-1ecf-4183-9955-b1499d5701d3")
```

**Go**

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

client := senddart.NewClient("mb_xxxxxxxxx")

segments, err := client.Contacts.ListSegments("e169aa45-1ecf-4183-9955-b1499d5701d3", nil)
```

**Rust**

```rust
use senddart::SendDart;

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

let _segments = mb.contacts.list_segments("e169aa45-1ecf-4183-9955-b1499d5701d3", None).await?;
```

**Java**

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

SendDart senddart = new SendDart("mb_xxxxxxxxx");

SendDartResponse response = senddart.contacts().listSegments("e169aa45-1ecf-4183-9955-b1499d5701d3");
```

**.NET**

```csharp
using SendDart;

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

var resp = await senddart.ContactListSegmentsAsync("e169aa45-1ecf-4183-9955-b1499d5701d3");
```

**cURL**

```bash
curl -X GET 'https://www.senddart.com/api/contacts/e169aa45-1ecf-4183-9955-b1499d5701d3/segments' \
  -H 'Authorization: Bearer mb_xxxxxxxxx'
```

**CLI**

```bash
senddart contacts segments e169aa45-1ecf-4183-9955-b1499d5701d3
```

### Response

```json
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
      "name": "Registered Users",
      "created_at": "2026-10-06T22:59:55.000Z"
    }
  ]
}
```
