# GroupsModeratorsApi

All URIs are relative to *https://admin-api.connected.dev*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**addGroupModerator**](#addgroupmoderator) | **POST** /groups/{groupId}/moderators/{accountId} | Promote a group member to moderator|
|[**getGroupModerators**](#getgroupmoderators) | **GET** /groups/{groupId}/moderators | List a group\&#39;s moderators|
|[**removeGroupModerator**](#removegroupmoderator) | **DELETE** /groups/{groupId}/moderators/{accountId} | Demote a group moderator to member|

# **addGroupModerator**
> AddAccountGroup200Response addGroupModerator()

Promotes the specified account to moderator of the given group, creating a moderator-role membership if none exists and clearing any pending join requests or invitations for that account; requires read and update permissions on both groups and accounts.

### Example

```typescript
import {
    GroupsModeratorsApi,
    Configuration
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new GroupsModeratorsApi(configuration);

let groupId: string; //The group identifier (default to undefined)
let accountId: string; //The account identifier (default to undefined)

const { status, data } = await apiInstance.addGroupModerator(
    groupId,
    accountId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **groupId** | [**string**] | The group identifier | defaults to undefined|
| **accountId** | [**string**] | The account identifier | defaults to undefined|


### Return type

**AddAccountGroup200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getGroupModerators**
> GetAccountGroups200Response getGroupModerators()

Returns a paginated list of accounts with the \"moderator\" role in the given group, optionally filtered by a search term matching the account\'s name or email and sorted via orderBy; requires \"read\" permission on groups and accounts.

### Example

```typescript
import {
    GroupsModeratorsApi,
    Configuration
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new GroupsModeratorsApi(configuration);

let groupId: string; //The group identifier (default to undefined)
let page: number; //Page number (optional) (default to 1)
let pageSize: number; //Number of items per page (optional) (default to 25)
let orderBy: string; //Field to order by (optional) (default to undefined)
let search: string; //Search query (optional) (default to undefined)

const { status, data } = await apiInstance.getGroupModerators(
    groupId,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **groupId** | [**string**] | The group identifier | defaults to undefined|
| **page** | [**number**] | Page number | (optional) defaults to 1|
| **pageSize** | [**number**] | Number of items per page | (optional) defaults to 25|
| **orderBy** | [**string**] | Field to order by | (optional) defaults to undefined|
| **search** | [**string**] | Search query | (optional) defaults to undefined|


### Return type

**GetAccountGroups200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **removeGroupModerator**
> AddAccountGroup200Response removeGroupModerator()

Demotes the specified account from moderator back to a regular member of the given group; requires read and update permissions on both groups and accounts.

### Example

```typescript
import {
    GroupsModeratorsApi,
    Configuration
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new GroupsModeratorsApi(configuration);

let groupId: string; //The group identifier (default to undefined)
let accountId: string; //The account identifier (default to undefined)

const { status, data } = await apiInstance.removeGroupModerator(
    groupId,
    accountId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **groupId** | [**string**] | The group identifier | defaults to undefined|
| **accountId** | [**string**] | The account identifier | defaults to undefined|


### Return type

**AddAccountGroup200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

