# LoginsAccountsApi

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

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**addLoginAccount**](#addloginaccount) | **POST** /logins/{username}/accounts/{accountId} | Link an account to a login|
|[**getLoginAccounts**](#getloginaccounts) | **GET** /logins/{username}/accounts | List a login\&#39;s linked accounts|
|[**removeLoginAccount**](#removeloginaccount) | **DELETE** /logins/{username}/accounts/{accountId} | Unlink an account from a login|

# **addLoginAccount**
> GetLogin200Response addLoginAccount()

Connects the specified account to the given login username so the login can access that account, and requires the \"update\" permission on accounts.

### Example

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

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

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

const { status, data } = await apiInstance.addLoginAccount(
    username,
    accountId
);
```

### Parameters

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


### Return type

**GetLogin200Response**

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

# **getLoginAccounts**
> GetAccounts200Response getLoginAccounts()

Returns a paginated list of accounts associated with the given login username, with optional search and ordering; requires the read permission on accounts.

### Example

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

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

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

### Parameters

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

**GetAccounts200Response**

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

# **removeLoginAccount**
> GetLogin200Response removeLoginAccount()

Disconnects the specified account from the given login username, revoking that login\'s access to the account, and requires the \"update\" permission on accounts.

### Example

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

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

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

const { status, data } = await apiInstance.removeLoginAccount(
    username,
    accountId
);
```

### Parameters

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


### Return type

**GetLogin200Response**

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

