# Introduction

<aside class="warning">
This API is in development. Therefore, it may not be ready for use and is a subject to change at any time.
</aside>

Members may be grouped into groups. It's up to API client / customer how they are utilized.

## Automatic groups

Group is automatic (and has `"automatic": true` attribute ) when it has been created with `audience_id` or
`audience_conditions` param.

Automatic group doesn't allow API client to manually manage its members - instead, those are fetched from the given audience.

See more [here](api-3511028)

## System groups

System groups (with `"system": true` attribute) are created automatically by system and are not editable
by API client - only MPC system can create, edit and destroy system groups.

The set of system groups present in given Loyalty Club depends on its configuration. An example of system group could be
"All members" group that would contain all Loyalty Club members.

## MembersGroup model

### Example

```json
{
    "id": 6813,
    "name": "Red",
    "type": "Color",
    "description": "Lorem ipsum dolor est",
    "automatic": false,
    "system": false,
    "audience_id": 351,
    "audience_conditions": [
        {
            "type": "array",
            "field": "members_group_ids",
            "value": [6813],
            "operator": "any",
            "condition_group": "member_properties"
        }
    ],
    "members_count": 42
}

```

### Definition

Key | Type | Optional? | Description
--------- | --------- | -------- | ---------
id | integer | no |
name | string| yes |
type | string| yes | Types are not predefined. It's up to API client to define them.
automatic | boolean | no | Is the group automatic?
system | boolean | no | Is the group system group?
description | string| yes |
members_count | integer| yes |
audience_id | integer | no| ID of related audience
audience_conditions | Object | no| Conditions of related audience - See [DMP docs](https://dmp.boostcom.no/docs/#conditions)

## MembersGroup payload model

Used as an input of creations and updates.

### Example

```json
{
    "name": "Red",
    "type": "Color",
    "description": "Lorem ipsum dolor est",
    "system": false,
    "audience_id": 351,
    "audience_conditions": [
        {
            "type": "array",
            "field": "members_group_ids",
            "value": [6813],
            "operator": "any",
            "condition_group": "member_properties"
        }
    ]
}

```

### Definition

Key | Type | Optional? | Description
--------- | --------- | -------- | ---------
name | string| yes |
type | string| yes | Types are not predefined. It's up to API client to define them.
system | boolean | no | Is the group system group?
description | string| yes |
audience_id | integer | no| ID of related audience
audience_conditions | Object | no| Conditions of related audience

## Members Groups Bulk Members payload model

Payload for bulk operation on members groups members

### Example

```json
{
    "identifier_type": "email",
    "identifiers": ["foo@bar.bz", "bar@foo.bz", ... ]
}
```

### Definition

Key | Type | Required | Description
--------- | --------- | -------- | ---------
identifier_type | string| yes | type of member identifier - email, msisdn, id 
identifiers | array | yes | array of emails, msisdn, id - only one type a time