> For the complete documentation index, see [llms.txt](https://api.senderwiz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.senderwiz.com/customer/segments/get-all-list-segments.md).

# Get All List Segments

Retrieve all segments created within a specific subscriber list. Each segment includes a unique identifier, name, and the number of subscribers it contains.

### 🧩 Get All List Segments

Retrieve all available **segments** associated with a specific subscriber list. Segments allow you to filter and target contacts based on predefined conditions.

#### 🔹 HTTP Request

```http
GET API-URL/lists/LIST-UNIQUE-ID/segments
```

#### 🔸 URL Segments

| Segment          | Required | Description                               |
| ---------------- | -------- | ----------------------------------------- |
| `LIST-UNIQUE-ID` | Yes      | Unique identifier of the subscriber list. |

#### 🔸 Query Parameters

| Parameter  | Default | Description                            |
| ---------- | ------- | -------------------------------------- |
| `page`     | 1       | Page number to retrieve.               |
| `per_page` | 10      | Number of segments to return per page. |

#### 🔐 Authorization Header

```
X-API-KEY: your-api-key-here
```

***

#### 💻 PHP Example

```php
// GET ALL ITEMS
$response = $endpoint->getSegments('LIST-UNIQUE-ID');

// DISPLAY RESPONSE
echo '<pre>';
print_r($response->body);
echo '</pre>';
```

***

#### 📦 Sample JSON Response

```json
{
  "status": "success",
  "data": {
    "count": "1",
    "total_pages": 1,
    "current_page": 1,
    "next_page": null,
    "prev_page": null,
    "records": [
      {
        "segment_uid": "mj54284tyo084",
        "name": "test",
        "subscribers_count": 18200
      }
    ]
  }
}
```
