# members (records)

| Required permit | Rate limit tokens cost |
| --- | --- |
| Reporting:Api:Report:Members | 10 |

This report allows you to get information about current members in your loyalty club (community).

Analytical member record is similar to the one in operational API however it's optimized for analytics with most of properties with personal data removed.


## Fields

### id

| Type | Filterable | Readonly |
| --- | --- | --- |
| Integer | <Icon icon="material-outline-highlight_off"/> | <Icon icon="material-outline-done"/> |

ID of member

### community_id

| Type | Filterable | Readonly |
| --- | --- | --- |
| Integer | <Icon icon="material-outline-done"/> (via `X-Customer` header) | <Icon icon="material-outline-done"/> |

ID of member's community

### optin_channel

| Type | Filterable | Readonly |
| --- | --- | --- |
| String | <Icon icon="material-outline-done"/> | <Icon icon="material-outline-done"/> |

Member's optin_channel.

Member receives optin_channel during creation. It's the value of `X-Product-Name` header.

### optin_subchannel

| Type | Filterable | Readonly |
| --- | --- | --- |
| String | <Icon icon="material-outline-done"/> | <Icon icon="material-outline-done"/> |

Member's optin_subchannel.

Member receives optin_subchannel during creation. It's the value of `X-Subproduct-Name` header.

### optin_platform

| Type | Filterable | Readonly |
| --- | --- | --- |
| Enum | <Icon icon="material-outline-done"/> | <Icon icon="material-outline-done"/> |

Represents platform used by member to opt-in. It's being set based on `optin_channel` value.

This field is an enum, possible values are:
* android
* ios
* website
* webforms
* other

### registration_medium
| Type | Filterable | Readonly |
| --- | --- | --- |
| Enum | <Icon icon="material-outline-highlight_off"/> | <Icon icon="material-outline-done"/> |

Represents medium used by member to opt-in.

This field is an enum, possible values are:
* email
* msisdn
* vipps
* google
* apple
* facebook
* import
* other


### gender

| Type | Filterable | Readonly |
| --- | --- | --- |
| String | <Icon icon="material-outline-done"/> | <Icon icon="material-outline-highlight_off"/> |

Member's gender.

Gender field is extracted from member property with key `gender`.

### age

| Type | Filterable | Readonly |
| --- | --- | --- |
| Enum | <Icon icon="material-outline-done"/> | <Icon icon="material-outline-highlight_off"/> |

Represents ranges of member's age.

This field is an enum, possible values are:
```
"-14", "15-19", "20-24", "25-29", "30-34", "35-39", "40-44", "45-49", "50-54", "55-59", "60-64", "65-69", "70-74", "75-79", "80-"
```

### birth_year_group

| Type | Filterable | Readonly |
| --- | --- | --- |
| Integer | <Icon icon="material-outline-highlight_off"/> | <Icon icon="material-outline-highlight_off"/> |

Represents 5 year range in which member was born.

For example: `2000` means that member was born between `2000` and `2004`.

### subunit_ids

| Type | Filterable | Readonly |
| --- | --- | --- |
| Array[Integer] | <Icon icon="material-outline-done"/> | <Icon icon="material-outline-highlight_off"/> |

List of IDs of subunits to which member is assigned.

This is relevant only when customer uses `Subunits` feature.

### group_ids

| Type | Filterable | Readonly |
| --- | --- | --- |
| Array[Integer] | <Icon icon="material-outline-done"/> | <Icon icon="material-outline-highlight_off"/> |

List of IDs of member groups to which member is assigned.

Member groups is are used for:
* Members' Lists
* Programs

### favorite_stores

| Type | Filterable | Readonly |
| --- | --- | --- |
| Array[Integer] | <Icon icon="material-outline-highlight_off"/> | <Icon icon="material-outline-highlight_off"/> |

IDs of member's favorite stores.

### properties

| Type | Filterable | Readonly |
| --- | --- | --- |
| Object(dynamic) | <Icon icon="material-outline-highlight_off"/> | <Icon icon="material-outline-highlight_off"/> |

Member's properties without personal data.

### consents

| Type | Filterable | Readonly |
| --- | --- | --- |
| Object(key: name of consent, value: boolean status of consent) | <Icon icon="material-outline-done"/> | <Icon icon="material-outline-highlight_off"/> |

Statuses of member's consents.

### marketing_via_sms

| Type | Filterable | Readonly |
| --- | --- | --- |
| Boolean | <Icon icon="material-outline-highlight_off"/> | <Icon icon="material-outline-highlight_off"/> |

Will member receive marketing SMSes?

This field is computed as following:
* member must have msisdn provided
* member's sms_status must be `verified`
* member must have `sms_marketing` consent

### marketing_via_email

| Type | Filterable | Readonly |
| --- | --- | --- |
| Boolean | <Icon icon="material-outline-highlight_off"/> | <Icon icon="material-outline-highlight_off"/> |

Will member receive marketing e-mails?

This field is computed as following:
* member must have email provided
* member's email_status must be `enabled` or `verified`
* member must have `email_marketing` consent

### marketing_via_push

| Type | Filterable | Readonly |
| --- | --- | --- |
| Boolean | <Icon icon="material-outline-highlight_off"/> | <Icon icon="material-outline-highlight_off"/> |

Will member receive marketing push notifications?

This field is computed as following:
* member must have at least one push device token registered
* member's push_status must be `enabled`

### marketing_via_anything

| Type | Filterable | Readonly |
| --- | --- | --- |
| Boolean | <Icon icon="material-outline-highlight_off"/> | <Icon icon="material-outline-highlight_off"/> |

Will member receive marketing messaging?

This field is `true` when at least one of: `marketing_via_sms`, `marketing_via_email` or `marketing_via_push` is `true`

### sms_status

| Type | Filterable | Readonly |
| --- | --- | --- |
| Enum | <Icon icon="material-outline-highlight_off"/> | <Icon icon="material-outline-highlight_off"/> |

Status of member's SMS channel.

This field is an enum, possible values are:
* disabled
* enabled
* verified
* barred

### email_status

| Type | Filterable | Readonly |
| --- | --- | --- |
| Enum | <Icon icon="material-outline-highlight_off"/> | <Icon icon="material-outline-highlight_off"/> |

Status of member's email channel.

This field is an enum, possible values are:
* disabled
* enabled
* verified
* complained
* hard_bounced
* unsubscribed (deprecated)

### push_status

| Type | Filterable | Readonly |
| --- | --- | --- |
| Enum | <Icon icon="material-outline-highlight_off"/> | <Icon icon="material-outline-highlight_off"/> |

Status of member's push channel.

This field is an enum, possible values are:
* disabled
* enabled

### push_devices

| Type | Filterable | Readonly |
| --- | --- | --- |
| Integer | <Icon icon="material-outline-highlight_off"/> | <Icon icon="material-outline-highlight_off"/> |

This field represents number of push notifications provider tokens registered for a member.

### msisdn_country

| Type | Filterable | Readonly |
| --- | --- | --- |
| String(`ISO 3166-1 alpha-2`) | <Icon icon="material-outline-highlight_off"/> | <Icon icon="material-outline-highlight_off"/> |

This field represents country extracted from member's msisdn country code.
Note that there are some countries that have same country code (for example `+1`)

### location_country

| Type | Filterable | Readonly |
| --- | --- | --- |
| String(`ISO 3166-1 alpha-2`) | <Icon icon="material-outline-highlight_off"/> | <Icon icon="material-outline-highlight_off"/> |

Country of member based on property, zip code or loyalty club's country.

### city_place_id

| Type | Filterable | Readonly |
| --- | --- | --- |
| String | <Icon icon="material-outline-done"/> | <Icon icon="material-outline-highlight_off"/> |

ID of place which is member's city.

### place_id

| Type | Filterable | Readonly |
| --- | --- | --- |
| String | <Icon icon="material-outline-done"/> | <Icon icon="material-outline-highlight_off"/> |

ID of place which is member's most detailed location.

### created_at

| Type | Filterable | Readonly |
| --- | --- | --- |
| String(`ISO 8601` timestamp) | <Icon icon="material-outline-done"/> | <Icon icon="material-outline-done"/> |

Time of member's creation.

### updated_at

| Type | Filterable | Readonly |
| --- | --- | --- |
| String(`ISO 8601` timestamp) | <Icon icon="material-outline-highlight_off"/> | <Icon icon="material-outline-highlight_off"/> |

Time of member's last update.

## Query without aggregations

Query returns list of members.

```json
{
    "records": [
        {
            "id": 4066131,
            "community_id": 235,
            "optin_channel": "webforms",
            "optin_subchannel": null,
            "optin_platform": "webforms",
            "gender": "woman",
            "birth_year_group": 2000,
            "subunit_ids": [
                5
            ],
            "group_ids": [
                32454,
                32463,
                39504,
                40645,
                75637,
                76853,
                92517
            ],
            "favorite_stores": [],
            "properties": {
                "bool": false,
                "interests": [
                    "dietary_and_nutrition"
                ],
                "bonus_points": 0
            },
            "consents": {
                "dmp_profiling": true,
                "sms_marketing": true,
                "cookie_tracking": true,
                "email_marketing": true,
            },
            "marketing_via_sms": true,
            "marketing_via_email": true,
            "marketing_via_push": true,
            "marketing_via_anything": true,
            "sms_status": "verified",
            "email_status": "verified",
            "push_status": "enabled",
            "push_devices": 1,
            "msisdn_country": "NO",
            "location_country": "NO",
            "city_place_id": 2,
            "place_id": 3,
            "created_at": "2017-06-19T09:56:22.527000Z",
            "updated_at": "2024-04-09T13:34:29.439000Z"
        }
    ],
    "pagination": {
        "next_page_info": "CNOW-AE"
    },
    "result_type": "records"
}
```

## Aggregations

### count

Fetch number of members.

#### Example query response

```json
{
    "records": [
        {
            "community_id": 42,
            "members_count": 1
        }
    ],
    "pagination": {
        "next_page_info": "CNOW-AE"
    },
    "result_type": "records"
}
```

### total_count

Fetch number of members in context of all available communities.

#### Example query response

```json
{
    "records": [
        {
            "members_count": 1
        }
    ],
    "pagination": {
        "next_page_info": "CNOW-AE"
    },
    "result_type": "records"
}
```

### gender_count

Fetch distribution of gender.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| community_id | Integer | See in `Fields` |
| gender | String | See in `Fields` |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "community_id": 42,
            "gender": "woman",
            "members_count": 1
        },
        {
            "community_id": 42,
            "gender": null,
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": "CNOW-AE"
    },
    "result_type": "records"
}
```

### total_gender_count

Fetch distribution of gender in context of all available communities.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| gender | String | See in `Fields` |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "gender": "woman",
            "members_count": 1
        },
        {
            "gender": null,
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": "CNOW-AE"
    },
    "result_type": "records"
}
```

### age_count

Fetch distribution of age.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| community_id | Integer | See in `Fields` |
| age | Enum | See in `Fields` |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "community_id": 42,
            "age": "20-24",
            "members_count": 1
        },
        {
            "community_id": 42,
            "age": null,
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": "CNOW-AE"
    },
    "result_type": "records"
}
```

### total_age_count

Fetch distribution of age in context of all communities.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| age | Enum | See in `Fields` |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "age": "20-24",
            "members_count": 1
        },
        {
            "age": null,
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": "CNOW-AE"
    },
    "result_type": "records"
}
```

### optin_channel_count

Fetch distribution of optin_channel.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| community_id | Integer | See in `Fields` |
| optin_channel | String | See in `Fields` |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "community_id": 42,
            "optin_channel": "default",
            "members_count": 1
        },
        {
            "community_id": 42,
            "optin_channel": "webforms",
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": null
    },
    "result_type": "records"
}
```

### total_optin_channel_count

Fetch distribution of optin_channel in context of all communities.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| optin_channel | String | See in `Fields` |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "optin_channel": "default",
            "members_count": 1
        },
        {
            "optin_channel": "webforms",
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": null
    },
    "result_type": "records"
}
```

### optin_subchannel_count

Fetch distribution of optin_subchannel.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| community_id | Integer | See in `Fields` |
| optin_subchannel | String | See in `Fields` |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "community_id": 42,
            "optin_subchannel": null,
            "members_count": 1
        },
        {
            "community_id": 42,
            "optin_subchannel": "2242",
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": null
    },
    "result_type": "records"
}
```

### total_optin_subchannel_count

Fetch distribution of optin_subchannel in context of all communities.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| optin_subchannel | String | See in `Fields` |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "optin_subchannel": null,
            "members_count": 1
        },
        {
            "optin_subchannel": "2242",
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": null
    },
    "result_type": "records"
}
```

### optin_platform_count

Fetch distribution of optin_platform.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| community_id | Integer | See in `Fields` |
| optin_platform | Enum | See in `Fields` |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "community_id": 42,
            "optin_platform": "android",
            "members_count": 1
        },
        {
            "community_id": 42,
            "optin_platform": "other",
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": null
    },
    "result_type": "records"
}
```

### total_optin_platform_count

Fetch distribution of optin_platform in context of all communities.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| optin_platform | Enum | See in `Fields` |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "optin_platform": "android",
            "members_count": 1
        },
        {
            "optin_platform": "other",
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": null
    },
    "result_type": "records"
}
```

### registration_medium_count

Fetch distribution of registration_medium.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| community_id | Integer | See in `Fields` |
| registration_medium | Enum | See in `Fields` |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "community_id": 42,
            "registration_medium": "msisdn",
            "members_count": 1
        },
        {
            "community_id": 42,
            "registration_medium": "other",
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": null
    },
    "result_type": "records"
}
```

### total_registration_medium_count

Fetch distribution of registration_medium in context of all communities.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| registration_medium | Enum | See in `Fields` |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "registration_medium": "msisdn",
            "members_count": 1
        },
        {
            "registration_medium": "other",
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": null
    },
    "result_type": "records"
}
```

### marketing_via_anything_count

Fetch distribution of marketing_via_anything.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| community_id | Integer | See in `Fields` |
| marketing_via_anything | Bool | See in `Fields` |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "community_id": 42,
            "marketing_via_anything": true,
            "members_count": 1
        },
        {
            "community_id": 42,
            "marketing_via_anything": false,
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": null
    },
    "result_type": "records"
}
```

### total_marketing_via_anything_count

Fetch distribution of marketing_via_anything in context of all communities.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| marketing_via_anything | Bool | See in `Fields` |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "marketing_via_anything": true,
            "members_count": 1
        },
        {
            "marketing_via_anything": false,
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": null
    },
    "result_type": "records"
}
```

### place_count

Fetch distribution of places.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| community_id | Integer | See in `Fields` |
| place_id | String | See in `Fields` |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "community_id": 42,
            "place_id": 40,
            "members_count": 1
        },
        {
            "community_id": 42,
            "place_id": 43,
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": "CNOW-AE"
    },
    "result_type": "records"
}
```

### total_place_count

Fetch distribution of place in context of all communities.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| place_id | String | See in `Fields` |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "place_id": "Oslo",
            "members_count": 1
        },
        {
            "place_id": "Oslo",
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": "CNOW-AE"
    },
    "result_type": "records"
}
```

### city_place_count

Fetch distribution of cities.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| community_id | Integer | See in `Fields` |
| city_place_id | String | See in `Fields` |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "community_id": 42,
            "city_place_id": 40,
            "members_count": 1
        },
        {
            "community_id": 42,
            "city_place_id": 43,
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": "CNOW-AE"
    },
    "result_type": "records"
}
```

### total_city_place_count

Fetch distribution of city in context of all communities.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| city_place_id | String | See in `Fields` |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "city_place_id": "Oslo",
            "members_count": 1
        },
        {
            "city_place_id": "Oslo",
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": "CNOW-AE"
    },
    "result_type": "records"
}
```

### consents_count

Fetch distribution of consents.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| community_id | Integer | See in `Fields` |
| consent_key | String | Key of consent from `consents` field |
| consent_value | Boolean | - |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "community_id": 42,
            "location_city": "Oslo",
            "location_detail": null,
            "members_count": 1
        },
        {
            "community_id": 42,
            "location_city": "Oslo",
            "location_detail": "Frogner",
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": "CNOW-AE"
    },
    "result_type": "records"
}
```

### total_consents_count

Fetch distribution of consents in context of all communities.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| consent_key | String | Key of consent from `consents` field |
| consent_value | Boolean | - |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "location_city": "Oslo",
            "location_detail": null,
            "members_count": 1
        },
        {
            "location_city": "Oslo",
            "location_detail": "Frogner",
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": "CNOW-AE"
    },
    "result_type": "records"
}
```

### interests_count

Fetch distribution of interests.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| community_id | Integer | See in `Fields` |
| interest | String | One of interest key |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "community_id": 42,
            "interest": "swimming",
            "members_count": 1
        },
        {
            "community_id": 42,
            "interest": "cars",
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": "CNOW-AE"
    },
    "result_type": "records"
}
```

### total_interests_count

Fetch distribution of interests in context of all communities.

#### Returned fields

| Key | Type | Description |
| --- | --- | --- |
| interest | String | One of interest key |
| members_count | Integer | Count of members |

#### Example query response

```json
{
    "records": [
        {
            "interest": "swimming",
            "members_count": 1
        },
        {
            "interest": "cars",
            "members_count": 2
        }
    ],
    "pagination": {
        "next_page_info": "CNOW-AE"
    },
    "result_type": "records"
}
```