# AccountsGroupsApi

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

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**addAccountGroup**](#addaccountgroup) | **POST** /accounts/{accountId}/groups/{groupId} | Add an account to a group|
|[**getAccountGroups**](#getaccountgroups) | **GET** /accounts/{accountId}/groups | List an account\&#39;s group memberships|
|[**removeAccountGroup**](#removeaccountgroup) | **DELETE** /accounts/{accountId}/groups/{groupId} | Remove an account from a group|

# **addAccountGroup**
> AddAccountGroup200Response addAccountGroup()

Creates a group membership adding the given account to the specified group as a member, requiring update permission on both accounts and groups.

### Example

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

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

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

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

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **accountId** | [**string**] | The account identifier | defaults to undefined|
| **groupId** | [**string**] | The group 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)

# **getAccountGroups**
> GetAccountGroups200Response getAccountGroups()

Returns a paginated list of groups the specified account belongs to, with optional search, and requires permission to read accounts and groups.

### Example

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

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

let accountId: string; //The account 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.getAccountGroups(
    accountId,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **accountId** | [**string**] | The account 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)

# **removeAccountGroup**
> CreateAccountInvitations200Response removeAccountGroup()

Removes the given account\'s membership from the specified group, deleting the group membership record; requires update permission on accounts and groups.

### Example

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

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

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

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

### Parameters

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


### Return type

**CreateAccountInvitations200Response**

### 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)

