# List

Lists segments to which the user has access.

<mark style="color:blue;">`GET`</mark> `https://ga-services-zvqgeah36q-uc.a.run.app/ga/segments/list/`

#### Query Parameters

| Name                                               | Type   | Description  |
| -------------------------------------------------- | ------ | ------------ |
| name<mark style="color:red;">\*</mark>             | String | ft-4         |
| connection\_name<mark style="color:red;">\*</mark> | String | ga-02        |
| account\_id<mark style="color:red;">\*</mark>      | String | 6712930      |
| webproperty\_id<mark style="color:red;">\*</mark>  | String | UA-6712930-1 |
| profiles\_id<mark style="color:red;">\*</mark>     | String | 13573529     |

#### Headers

| Name                                            | Type   | Description                                                                                                                                                                                                                                    |
| ----------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| x-api-key<mark style="color:red;">\*</mark>     | String | U2Fsd...                                                                                                                                                                                                                                       |
| Authorization<mark style="color:red;">\*</mark> | String | ya29.a0Aa4xrXPgfscocWaLFAjpjVmeOE4ylR25e2z\_XAHwWXzNEUoyCCcA4MticQ1x2Ku\_CUnNCcAg2zg\_Oc\_UWd\_gVUr80gfYLVchm\_k5am51ObCiVVn8RdRBJbJRw2S9621BBpxtzRjXxu0Q7LqdELX3HjIoaatm\_sq\_vXRwN\_4l0vDbAxEaCgYKATASARMSFQEjDvL9mdgUKe6n1K7ptMwJrY19xQ0182 |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    "kind": "analytics#segments",
    "username": "sschouse@gmail.com",
    "totalResults": 25,
    "startIndex": 1,
    "itemsPerPage": 1000,
    "items": [
        {
            "id": "-1",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-1",
            "segmentId": "gaid::-1",
            "name": "All Users",
            "definition": "",
            "type": "BUILT_IN"
        },
        {
            "id": "-2",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-2",
            "segmentId": "gaid::-2",
            "name": "New Users",
            "definition": "sessions::condition::ga:userType==New Visitor",
            "type": "BUILT_IN"
        },
        {
            "id": "-3",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-3",
            "segmentId": "gaid::-3",
            "name": "Returning Users",
            "definition": "sessions::condition::ga:userType==Returning Visitor",
            "type": "BUILT_IN"
        },
        {
            "id": "-4",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-4",
            "segmentId": "gaid::-4",
            "name": "Paid Traffic",
            "definition": "sessions::condition::ga:medium=~^(cpc|ppc|cpa|cpm|cpv|cpp)$",
            "type": "BUILT_IN"
        },
        {
            "id": "-5",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-5",
            "segmentId": "gaid::-5",
            "name": "Organic Traffic",
            "definition": "sessions::condition::ga:medium==organic",
            "type": "BUILT_IN"
        },
        {
            "id": "-6",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-6",
            "segmentId": "gaid::-6",
            "name": "Search Traffic",
            "definition": "sessions::condition::ga:medium=~^(cpc|ppc|cpa|cpm|cpv|cpp|organic)$",
            "type": "BUILT_IN"
        },
        {
            "id": "-7",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-7",
            "segmentId": "gaid::-7",
            "name": "Direct Traffic",
            "definition": "sessions::condition::ga:medium==(none)",
            "type": "BUILT_IN"
        },
        {
            "id": "-8",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-8",
            "segmentId": "gaid::-8",
            "name": "Referral Traffic",
            "definition": "sessions::condition::ga:medium==referral",
            "type": "BUILT_IN"
        },
        {
            "id": "-9",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-9",
            "segmentId": "gaid::-9",
            "name": "Sessions with Conversions",
            "definition": "sessions::condition::ga:goalCompletionsAll>0",
            "type": "BUILT_IN"
        },
        {
            "id": "-10",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-10",
            "segmentId": "gaid::-10",
            "name": "Sessions with Transactions",
            "definition": "sessions::condition::ga:transactions>0",
            "type": "BUILT_IN"
        },
        {
            "id": "-11",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-11",
            "segmentId": "gaid::-11",
            "name": "Mobile and Tablet Traffic",
            "definition": "sessions::condition::ga:deviceCategory==mobile,ga:deviceCategory==tablet",
            "type": "BUILT_IN"
        },
        {
            "id": "-12",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-12",
            "segmentId": "gaid::-12",
            "name": "Non-bounce Sessions",
            "definition": "sessions::condition::ga:bounces==0",
            "type": "BUILT_IN"
        },
        {
            "id": "-13",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-13",
            "segmentId": "gaid::-13",
            "name": "Tablet Traffic",
            "definition": "sessions::condition::ga:deviceCategory==tablet",
            "type": "BUILT_IN"
        },
        {
            "id": "-14",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-14",
            "segmentId": "gaid::-14",
            "name": "Mobile Traffic",
            "definition": "sessions::condition::ga:deviceCategory==mobile",
            "type": "BUILT_IN"
        },
        {
            "id": "-15",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-15",
            "segmentId": "gaid::-15",
            "name": "Tablet and Desktop Traffic",
            "definition": "sessions::condition::ga:deviceCategory==tablet,ga:deviceCategory==desktop",
            "type": "BUILT_IN"
        },
        {
            "id": "-16",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-16",
            "segmentId": "gaid::-16",
            "name": "Android Traffic",
            "definition": "sessions::condition::ga:operatingSystem==Android",
            "type": "BUILT_IN"
        },
        {
            "id": "-17",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-17",
            "segmentId": "gaid::-17",
            "name": "iOS Traffic",
            "definition": "sessions::condition::ga:operatingSystem=~^(iOS|iPad|iPhone|iPod)$",
            "type": "BUILT_IN"
        },
        {
            "id": "-18",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-18",
            "segmentId": "gaid::-18",
            "name": "Other Traffic (Neither iOS nor Android)",
            "definition": "sessions::condition::ga:operatingSystem!~^(Android|iOS|iPad|iPhone|iPod)$",
            "type": "BUILT_IN"
        },
        {
            "id": "-19",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-19",
            "segmentId": "gaid::-19",
            "name": "Bounced Sessions",
            "definition": "sessions::condition::ga:bounces>0",
            "type": "BUILT_IN"
        },
        {
            "id": "-100",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-100",
            "segmentId": "gaid::-100",
            "name": "Single Session Users",
            "definition": "users::condition::ga:sessions==1",
            "type": "BUILT_IN"
        },
        {
            "id": "-101",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-101",
            "segmentId": "gaid::-101",
            "name": "Multi-session Users",
            "definition": "users::condition::ga:sessions>1",
            "type": "BUILT_IN"
        },
        {
            "id": "-102",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-102",
            "segmentId": "gaid::-102",
            "name": "Converters",
            "definition": "users::condition::ga:goalCompletionsAll>0,ga:transactions>0",
            "type": "BUILT_IN"
        },
        {
            "id": "-103",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-103",
            "segmentId": "gaid::-103",
            "name": "Non-Converters",
            "definition": "users::condition::ga:goalCompletionsAll==0;ga:transactions==0",
            "type": "BUILT_IN"
        },
        {
            "id": "-104",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-104",
            "segmentId": "gaid::-104",
            "name": "Made a Purchase",
            "definition": "users::condition::ga:transactions>0",
            "type": "BUILT_IN"
        },
        {
            "id": "-105",
            "kind": "analytics#segment",
            "selfLink": "https://www.googleapis.com/analytics/v3/management/segments/gaid::-105",
            "segmentId": "gaid::-105",
            "name": "Performed Site Search",
            "definition": "users::sequence::ga:searchKeyword!~^$|^\\(not set\\)$",
            "type": "BUILT_IN"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request GET 'https://ga-services-zvqgeah36q-uc.a.run.app/ga/segments/list?name=ft-4&connection_name=ga-02&account_id=6712930&webproperty_id=UA-6712930-1&profiles_id=13573529' \
--header 'x-api-key: U2Fsd...' \
--header 'Authorization: ya29.a0Aa4xrXPgfscocWaLFAjpjVmeOE4ylR25e2z_XAHwWXzNEUoyCCcA4MticQ1x2Ku_CUnNCcAg2zg_Oc_UWd_gVUr80gfYLVchm_k5am51ObCiVVn8RdRBJbJRw2S9621BBpxtzRjXxu0Q7LqdELX3HjIoaatm_sq_vXRwN_4l0vDbAxEaCgYKATASARMSFQEjDvL9mdgUKe6n1K7ptMwJrY19xQ0182'
```

{% endtab %}

{% tab title="NodeJs - Axios" %}

```javascript
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://ga-services-zvqgeah36q-uc.a.run.app/ga/segments/list?name=ft-4&connection_name=ga-02&account_id=6712930&webproperty_id=UA-6712930-1&profiles_id=13573529',
  headers: { 
    'x-api-key': 'U2Fsd...', 
    'Authorization': 'ya29.a0Aa4xrXPgfscocWaLFAjpjVmeOE4ylR25e2z_XAHwWXzNEUoyCCcA4MticQ1x2Ku_CUnNCcAg2zg_Oc_UWd_gVUr80gfYLVchm_k5am51ObCiVVn8RdRBJbJRw2S9621BBpxtzRjXxu0Q7LqdELX3HjIoaatm_sq_vXRwN_4l0vDbAxEaCgYKATASARMSFQEjDvL9mdgUKe6n1K7ptMwJrY19xQ0182'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

```

{% endtab %}

{% tab title="PHP - cURL" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://ga-services-zvqgeah36q-uc.a.run.app/ga/segments/list?name=ft-4&connection_name=ga-02&account_id=6712930&webproperty_id=UA-6712930-1&profiles_id=13573529',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'x-api-key: U2Fsd...',
    'Authorization: ya29.a0Aa4xrXPgfscocWaLFAjpjVmeOE4ylR25e2z_XAHwWXzNEUoyCCcA4MticQ1x2Ku_CUnNCcAg2zg_Oc_UWd_gVUr80gfYLVchm_k5am51ObCiVVn8RdRBJbJRw2S9621BBpxtzRjXxu0Q7LqdELX3HjIoaatm_sq_vXRwN_4l0vDbAxEaCgYKATASARMSFQEjDvL9mdgUKe6n1K7ptMwJrY19xQ0182'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}
{% endtabs %}
