# Groups

This API mainly allows you to add, update, delete and list contacts but also you can unsubscribe and resubscribe contact or list segments.

## List contacts in group

> Use this method to list all contacts in a group.

OpenAPI:

```json
{"openapi":"3.0.0","info":{"title":"MessageFlow API","version":"v2.1.1.0"},"tags":[{"name":"Groups","description":"This API mainly allows you to add, update, delete and list contacts but also you can unsubscribe and resubscribe contact or list segments."}],"servers":[{"url":"https://api.messageflow.com","description":"Production server"}],"security":[{"APIKeyHeader":[],"APPKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","name":"Authorization","in":"header"}}},"paths":{"/v2.1/group/{groupId}/contact":{"get":{"tags":["Groups"],"summary":"List contacts in group","description":"Use this method to list all contacts in a group.","operationId":"ListContactsInGroup","parameters":[{"name":"offset","in":"query","description":"The number of items omitted from the beginning of the list. Default ‘0’.","required":false,"schema":{"type":"integer","default":"0"}},{"name":"limit","in":"query","description":"The maximum number of items returned by request. Default ‘100’. Maximum ‘1000’.","required":false,"schema":{"type":"integer","default":100,"maximum":1000}},{"name":"orderBy","in":"query","description":"Allows you to select the field by which the sort should be performed. ( For this method: id, createdAt )","required":false,"schema":{"type":"string","default":"id"}},{"name":"orderDirection","in":"query","description":"It allows you to set the sort order for a given field. ( ASC or DESC )","required":false,"schema":{"type":"string","default":"DESC"}},{"name":"groupId","in":"path","description":"The group id that should be searched","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Request was successfully processed","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"numberOfErrors":{"description":"Number of items in errors section, 0 if section not exists","type":"integer"},"numberOfData":{"description":"Number of items in data section, 0 if section not exists","type":"integer"},"status":{"description":"Request HTTP status","type":"integer"},"uniqId":{"description":"Unique identifier of a request - it allows us to find your request in the case of any troubles","type":"string"}},"type":"object"},"data":{"type":"array","items":{"properties":{"email":{"type":"string"},"externalId":{"type":"string"},"id":{"type":"string"},"phoneNumber":{"type":"string"}},"type":"object"}}},"type":"object"}}}},"400":{"description":"Bad Request - request was not processed due to validation errors","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group~1{groupId}~1contact/get/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"},"errors":{"type":"array","items":{"description":"Errors list","required":["title","message","code"],"properties":{"title":{"description":"General error name","type":"string"},"message":{"description":"Error details","type":"string"},"code":{"description":"Error code in our system","type":"string"}},"type":"object"}}},"type":"object"}}}},"404":{"description":"Request was successfully processed but no results were returned","content":{"application/json":{"schema":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group~1{groupId}~1contact/get/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"}}}},"500":{"description":"Request was not processed due to server error","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group~1{groupId}~1contact/get/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"}},"type":"object"}}}}}}}}}
```

## Add contacts to group

> Use this method to add contacts to a group.

OpenAPI:

```json
{"openapi":"3.0.0","info":{"title":"MessageFlow API","version":"v2.1.1.0"},"tags":[{"name":"Groups","description":"This API mainly allows you to add, update, delete and list contacts but also you can unsubscribe and resubscribe contact or list segments."}],"servers":[{"url":"https://api.messageflow.com","description":"Production server"}],"security":[{"APIKeyHeader":[],"APPKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","name":"Authorization","in":"header"}}},"paths":{"/v2.1/group/{groupId}/contact":{"post":{"tags":["Groups"],"summary":"Add contacts to group","description":"Use this method to add contacts to a group.","operationId":"AddContactToGroup","parameters":[{"name":"groupId","in":"path","description":"The id of the group.","required":true,"schema":{"type":"int"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"description":"The id of a object","required":["id"],"properties":{"id":{"description":"The id of a object","type":"array","items":{"type":"integer"}}},"type":"object"}}}},"responses":{"200":{"description":"Request was successfully processed","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"numberOfErrors":{"description":"Number of items in errors section, 0 if section not exists","type":"integer"},"numberOfData":{"description":"Number of items in data section, 0 if section not exists","type":"integer"},"status":{"description":"Request HTTP status","type":"integer"},"uniqId":{"description":"Unique identifier of a request - it allows us to find your request in the case of any troubles","type":"string"}},"type":"object"}},"type":"object"}}}},"207":{"description":"Some of request body items were not processed due to validation errors","content":{"application/json":{"schema":{"properties":{"data":{"description":"Simple data object","type":"array","items":{}},"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group~1{groupId}~1contact/post/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"},"errors":{"type":"array","items":{"description":"Errors list","required":["title","message","code"],"properties":{"title":{"description":"General error name","type":"string"},"message":{"description":"Error details","type":"string"},"code":{"description":"Error code in our system","type":"string"}},"type":"object"}}},"type":"object"}}}},"400":{"description":"Bad Request - request was not processed due to validation errors","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group~1{groupId}~1contact/post/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"},"errors":{"type":"array","items":{"description":"Errors list","required":["title","message","code"],"properties":{"$ref":"#/paths/~1v2.1~1group~1{groupId}~1contact/post/responses/207/content/application~1json/schema/properties/errors/items/properties"},"type":"object"}}},"type":"object"}}}},"404":{"description":"Request was successfully processed but no results were returned","content":{"application/json":{"schema":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group~1{groupId}~1contact/post/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"}}}},"500":{"description":"Request was not processed due to server error","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group~1{groupId}~1contact/post/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"}},"type":"object"}}}}}}}}}
```

## Delete contacts from group

> Use this method to delete contacts from a group.

OpenAPI:

```json
{"openapi":"3.0.0","info":{"title":"MessageFlow API","version":"v2.1.1.0"},"tags":[{"name":"Groups","description":"This API mainly allows you to add, update, delete and list contacts but also you can unsubscribe and resubscribe contact or list segments."}],"servers":[{"url":"https://api.messageflow.com","description":"Production server"}],"security":[{"APIKeyHeader":[],"APPKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","name":"Authorization","in":"header"}}},"paths":{"/v2.1/group/{groupId}/contact":{"delete":{"tags":["Groups"],"summary":"Delete contacts from group","description":"Use this method to delete contacts from a group.","operationId":"DeleteContactFromGroup","parameters":[{"name":"groupId","in":"path","description":"The id of the group.","required":true,"schema":{"type":"int"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"description":"The id of a object","required":["id"],"properties":{"id":{"description":"The id of a object","type":"array","items":{"type":"integer"}}},"type":"object"}}}},"responses":{"200":{"description":"Request was successfully processed","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"numberOfErrors":{"description":"Number of items in errors section, 0 if section not exists","type":"integer"},"numberOfData":{"description":"Number of items in data section, 0 if section not exists","type":"integer"},"status":{"description":"Request HTTP status","type":"integer"},"uniqId":{"description":"Unique identifier of a request - it allows us to find your request in the case of any troubles","type":"string"}},"type":"object"}},"type":"object"}}}},"207":{"description":"Some of request body items were not processed due to validation errors","content":{"application/json":{"schema":{"properties":{"data":{"description":"Simple data object","type":"array","items":{}},"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group~1{groupId}~1contact/delete/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"},"errors":{"type":"array","items":{"description":"Errors list","required":["title","message","code"],"properties":{"title":{"description":"General error name","type":"string"},"message":{"description":"Error details","type":"string"},"code":{"description":"Error code in our system","type":"string"}},"type":"object"}}},"type":"object"}}}},"400":{"description":"Bad Request - request was not processed due to validation errors","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group~1{groupId}~1contact/delete/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"},"errors":{"type":"array","items":{"description":"Errors list","required":["title","message","code"],"properties":{"$ref":"#/paths/~1v2.1~1group~1{groupId}~1contact/delete/responses/207/content/application~1json/schema/properties/errors/items/properties"},"type":"object"}}},"type":"object"}}}},"404":{"description":"Request was successfully processed but no results were returned","content":{"application/json":{"schema":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group~1{groupId}~1contact/delete/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"}}}},"500":{"description":"Request was not processed due to server error","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group~1{groupId}~1contact/delete/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"}},"type":"object"}}}}}}}}}
```

## List groups

> Use this method to list all groups.

OpenAPI:

```json
{"openapi":"3.0.0","info":{"title":"MessageFlow API","version":"v2.1.1.0"},"tags":[{"name":"Groups","description":"This API mainly allows you to add, update, delete and list contacts but also you can unsubscribe and resubscribe contact or list segments."}],"servers":[{"url":"https://api.messageflow.com","description":"Production server"}],"security":[{"APIKeyHeader":[],"APPKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","name":"Authorization","in":"header"}}},"paths":{"/v2.1/group":{"get":{"tags":["Groups"],"summary":"List groups","description":"Use this method to list all groups.","operationId":"ListGroups","parameters":[{"name":"offset","in":"query","description":"The number of items omitted from the beginning of the list. Default ‘0’.","required":false,"schema":{"type":"integer","default":"0"}},{"name":"limit","in":"query","description":"The maximum number of items returned by request. Default ‘100’. Maximum ‘1000’.","required":false,"schema":{"type":"integer","default":100,"maximum":1000}},{"name":"orderBy","in":"query","description":"Specifies a required order for the query results. You can order only by id, createdAt and name.","required":false,"schema":{"type":"string","default":"id"}},{"name":"orderDirection","in":"query","description":"Specifies the sort order. To sort the groups in descending order, use DESC to sort in ascending order, use ASC.","required":false,"schema":{"type":"string","default":"DESC"}}],"responses":{"200":{"description":"Request was successfully processed","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"numberOfErrors":{"description":"Number of items in errors section, 0 if section not exists","type":"integer"},"numberOfData":{"description":"Number of items in data section, 0 if section not exists","type":"integer"},"status":{"description":"Request HTTP status","type":"integer"},"uniqId":{"description":"Unique identifier of a request - it allows us to find your request in the case of any troubles","type":"string"}},"type":"object"},"data":{"type":"array","items":{"allOf":[{"properties":{"createdAt":{"description":"Unix timestamp","type":"number"}},"type":"object"},{"description":"Group object","properties":{"id":{"description":"The id of the group.","type":"integer"},"name":{"description":"The unique name of the group.","type":"string"},"description":{"description":"The group description.","type":"string"}},"type":"object"}]}}},"type":"object"}}}},"400":{"description":"Bad Request - request was not processed due to validation errors","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group/get/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"},"errors":{"type":"array","items":{"description":"Errors list","required":["title","message","code"],"properties":{"title":{"description":"General error name","type":"string"},"message":{"description":"Error details","type":"string"},"code":{"description":"Error code in our system","type":"string"}},"type":"object"}}},"type":"object"}}}},"404":{"description":"Request was successfully processed but no results were returned","content":{"application/json":{"schema":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group/get/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"}}}},"500":{"description":"Request was not processed due to server error","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group/get/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"}},"type":"object"}}}}}}}}}
```

## Create group

> Use this method to create a group that you can use to send email and sms campaigns.

OpenAPI:

```json
{"openapi":"3.0.0","info":{"title":"MessageFlow API","version":"v2.1.1.0"},"tags":[{"name":"Groups","description":"This API mainly allows you to add, update, delete and list contacts but also you can unsubscribe and resubscribe contact or list segments."}],"servers":[{"url":"https://api.messageflow.com","description":"Production server"}],"security":[{"APIKeyHeader":[],"APPKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","name":"Authorization","in":"header"}}},"paths":{"/v2.1/group":{"post":{"tags":["Groups"],"summary":"Create group","description":"Use this method to create a group that you can use to send email and sms campaigns.","operationId":"CreateGroup","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"description":"Group object","required":["name"],"properties":{"name":{"description":"The group name.","type":"string"},"description":{"description":"The group description.","type":"string"},"externalId":{"description":"The unique identifier of the group","type":"string"}},"type":"object"}}}}},"responses":{"200":{"description":"Request was successfully processed","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"numberOfErrors":{"description":"Number of items in errors section, 0 if section not exists","type":"integer"},"numberOfData":{"description":"Number of items in data section, 0 if section not exists","type":"integer"},"status":{"description":"Request HTTP status","type":"integer"},"uniqId":{"description":"Unique identifier of a request - it allows us to find your request in the case of any troubles","type":"string"}},"type":"object"}},"type":"object"}}}},"207":{"description":"Some of request body items were not processed due to validation errors","content":{"application/json":{"schema":{"properties":{"data":{"description":"Simple data object","type":"array","items":{}},"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group/post/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"},"errors":{"type":"array","items":{"description":"Errors list","required":["title","message","code"],"properties":{"title":{"description":"General error name","type":"string"},"message":{"description":"Error details","type":"string"},"code":{"description":"Error code in our system","type":"string"}},"type":"object"}}},"type":"object"}}}},"400":{"description":"Bad Request - request was not processed due to validation errors","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group/post/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"},"errors":{"type":"array","items":{"description":"Errors list","required":["title","message","code"],"properties":{"$ref":"#/paths/~1v2.1~1group/post/responses/207/content/application~1json/schema/properties/errors/items/properties"},"type":"object"}}},"type":"object"}}}},"404":{"description":"Request was successfully processed but no results were returned","content":{"application/json":{"schema":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group/post/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"}}}},"500":{"description":"Request was not processed due to server error","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group/post/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"}},"type":"object"}}}}}}}}}
```

## Update group

> Use this method to update a group.

OpenAPI:

```json
{"openapi":"3.0.0","info":{"title":"MessageFlow API","version":"v2.1.1.0"},"tags":[{"name":"Groups","description":"This API mainly allows you to add, update, delete and list contacts but also you can unsubscribe and resubscribe contact or list segments."}],"servers":[{"url":"https://api.messageflow.com","description":"Production server"}],"security":[{"APIKeyHeader":[],"APPKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","name":"Authorization","in":"header"}}},"paths":{"/v2.1/group":{"put":{"tags":["Groups"],"summary":"Update group","description":"Use this method to update a group.","operationId":"UpdateGroup","requestBody":{"required":true,"content":{"application/json":{"schema":{"required":["id"],"type":"array","items":{"description":"Group object","properties":{"id":{"description":"The id of the group.","type":"integer"},"name":{"description":"The unique name of the group.","type":"string"},"description":{"description":"The group description.","type":"string"}},"type":"object"}}}}},"responses":{"200":{"description":"Request was successfully processed","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"numberOfErrors":{"description":"Number of items in errors section, 0 if section not exists","type":"integer"},"numberOfData":{"description":"Number of items in data section, 0 if section not exists","type":"integer"},"status":{"description":"Request HTTP status","type":"integer"},"uniqId":{"description":"Unique identifier of a request - it allows us to find your request in the case of any troubles","type":"string"}},"type":"object"}},"type":"object"}}}},"207":{"description":"Some of request body items were not processed due to validation errors","content":{"application/json":{"schema":{"properties":{"data":{"description":"Simple data object","type":"array","items":{}},"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group/put/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"},"errors":{"type":"array","items":{"description":"Errors list","required":["title","message","code"],"properties":{"title":{"description":"General error name","type":"string"},"message":{"description":"Error details","type":"string"},"code":{"description":"Error code in our system","type":"string"}},"type":"object"}}},"type":"object"}}}},"400":{"description":"Bad Request - request was not processed due to validation errors","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group/put/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"},"errors":{"type":"array","items":{"description":"Errors list","required":["title","message","code"],"properties":{"$ref":"#/paths/~1v2.1~1group/put/responses/207/content/application~1json/schema/properties/errors/items/properties"},"type":"object"}}},"type":"object"}}}},"404":{"description":"Request was successfully processed but no results were returned","content":{"application/json":{"schema":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group/put/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"}}}},"500":{"description":"Request was not processed due to server error","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group/put/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"}},"type":"object"}}}}}}}}}
```

## Delete group

> Use this method to delete an existing group.

OpenAPI:

```json
{"openapi":"3.0.0","info":{"title":"MessageFlow API","version":"v2.1.1.0"},"tags":[{"name":"Groups","description":"This API mainly allows you to add, update, delete and list contacts but also you can unsubscribe and resubscribe contact or list segments."}],"servers":[{"url":"https://api.messageflow.com","description":"Production server"}],"security":[{"APIKeyHeader":[],"APPKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","name":"Authorization","in":"header"}}},"paths":{"/v2.1/group":{"delete":{"tags":["Groups"],"summary":"Delete group","description":"Use this method to delete an existing group.","operationId":"DeleteGroups","requestBody":{"required":true,"content":{"application/json":{"schema":{"description":"The id of a object","required":["id"],"properties":{"id":{"description":"The id of a object","type":"array","items":{"type":"integer"}}},"type":"object"}}}},"responses":{"200":{"description":"Request was successfully processed","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"numberOfErrors":{"description":"Number of items in errors section, 0 if section not exists","type":"integer"},"numberOfData":{"description":"Number of items in data section, 0 if section not exists","type":"integer"},"status":{"description":"Request HTTP status","type":"integer"},"uniqId":{"description":"Unique identifier of a request - it allows us to find your request in the case of any troubles","type":"string"}},"type":"object"}},"type":"object"}}}},"207":{"description":"Some of request body items were not processed due to validation errors","content":{"application/json":{"schema":{"properties":{"data":{"description":"Simple data object","type":"array","items":{}},"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group/delete/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"},"errors":{"type":"array","items":{"description":"Errors list","required":["title","message","code"],"properties":{"title":{"description":"General error name","type":"string"},"message":{"description":"Error details","type":"string"},"code":{"description":"Error code in our system","type":"string"}},"type":"object"}}},"type":"object"}}}},"400":{"description":"Bad Request - request was not processed due to validation errors","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group/delete/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"},"errors":{"type":"array","items":{"description":"Errors list","required":["title","message","code"],"properties":{"$ref":"#/paths/~1v2.1~1group/delete/responses/207/content/application~1json/schema/properties/errors/items/properties"},"type":"object"}}},"type":"object"}}}},"404":{"description":"Request was successfully processed but no results were returned","content":{"application/json":{"schema":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group/delete/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"}}}},"500":{"description":"Request was not processed due to server error","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group/delete/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"}},"type":"object"}}}}}}}}}
```

## Count number of contacts in group

> Use this method to count number of contacts in group (either dynamic or static). When using this method for getting dynamic group count you may get response with Retry-After header. Please check chapter 'Long running actions - Retry-After header explained'.

OpenAPI:

```json
{"openapi":"3.0.0","info":{"title":"MessageFlow API","version":"v2.1.1.0"},"tags":[{"name":"Groups","description":"This API mainly allows you to add, update, delete and list contacts but also you can unsubscribe and resubscribe contact or list segments."}],"servers":[{"url":"https://api.messageflow.com","description":"Production server"}],"security":[{"APIKeyHeader":[],"APPKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","name":"Authorization","in":"header"}}},"paths":{"/v2.1/group/{groupId}/count":{"get":{"tags":["Groups"],"summary":"Count number of contacts in group","description":"Use this method to count number of contacts in group (either dynamic or static). When using this method for getting dynamic group count you may get response with Retry-After header. Please check chapter 'Long running actions - Retry-After header explained'.","operationId":"CountContactsInGroup","parameters":[{"name":"groupId","in":"path","description":"The id of the group.","required":true,"schema":{"type":"int"}}],"responses":{"200":{"description":"Request was successfully processed","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"numberOfErrors":{"description":"Number of items in errors section, 0 if section not exists","type":"integer"},"numberOfData":{"description":"Number of items in data section, 0 if section not exists","type":"integer"},"status":{"description":"Request HTTP status","type":"integer"},"uniqId":{"description":"Unique identifier of a request - it allows us to find your request in the case of any troubles","type":"string"}},"type":"object"}},"type":"object"}}}},"207":{"description":"Some of request body items were not processed due to validation errors","content":{"application/json":{"schema":{"properties":{"data":{"description":"Simple data object","type":"array","items":{}},"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group~1{groupId}~1count/get/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"},"errors":{"type":"array","items":{"description":"Errors list","required":["title","message","code"],"properties":{"title":{"description":"General error name","type":"string"},"message":{"description":"Error details","type":"string"},"code":{"description":"Error code in our system","type":"string"}},"type":"object"}}},"type":"object"}}}},"400":{"description":"Bad Request - request was not processed due to validation errors","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group~1{groupId}~1count/get/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"},"errors":{"type":"array","items":{"description":"Errors list","required":["title","message","code"],"properties":{"$ref":"#/paths/~1v2.1~1group~1{groupId}~1count/get/responses/207/content/application~1json/schema/properties/errors/items/properties"},"type":"object"}}},"type":"object"}}}},"404":{"description":"Request was successfully processed but no results were returned","content":{"application/json":{"schema":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group~1{groupId}~1count/get/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"}}}},"500":{"description":"Request was not processed due to server error","content":{"application/json":{"schema":{"properties":{"meta":{"description":"Additional data","required":["numberOfErrors","numberOfData","status","uniqId"],"properties":{"$ref":"#/paths/~1v2.1~1group~1{groupId}~1count/get/responses/200/content/application~1json/schema/properties/meta/properties"},"type":"object"}},"type":"object"}}}}}}}}}
```
