# UnboundCaspApi.AccountsApi

All URIs are relative to *https://localhost*

Method | HTTP request | Description
------------- | ------------- | -------------
[**createAccount**](AccountsApi.md#createAccount) | **POST** /casp/api/v1.0/mng/accounts | Create a new account
[**deleteAccount**](AccountsApi.md#deleteAccount) | **DELETE** /casp/api/v1.0/mng/accounts/{id} | Delete an account
[**getAccount**](AccountsApi.md#getAccount) | **GET** /casp/api/v1.0/mng/accounts/{id} | Get account details
[**listAccounts**](AccountsApi.md#listAccounts) | **GET** /casp/api/v1.0/mng/accounts | List accounts
[**updateAccount**](AccountsApi.md#updateAccount) | **PUT** /casp/api/v1.0/mng/accounts/{id} | Update an existing account


<a name="createAccount"></a>
# **createAccount**
> InlineResponse201 createAccount(body)

Create a new account

Create a new account managed by the CASP service

### Example
```javascript
var UnboundCaspApi = require('unbound_casp_api');
var defaultClient = UnboundCaspApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new UnboundCaspApi.AccountsApi();

var body = new UnboundCaspApi.Body(); // Body | Create accounts request

apiInstance.createAccount(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**Body**](Body.md)| Create accounts request | 

### Return type

[**InlineResponse201**](InlineResponse201.md)

### Authorization

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

### HTTP request headers

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

<a name="deleteAccount"></a>
# **deleteAccount**
> deleteAccount(id)

Delete an account

Delete an existing account. Only accounts with no vaults or participants may be deleted.

### Example
```javascript
var UnboundCaspApi = require('unbound_casp_api');
var defaultClient = UnboundCaspApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new UnboundCaspApi.AccountsApi();

var id = "id_example"; // String | Account ID

apiInstance.deleteAccount(id).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| Account ID | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="getAccount"></a>
# **getAccount**
> [InlineResponse2001] getAccount(id, opts)

Get account details

Get account information about a specific account

### Example
```javascript
var UnboundCaspApi = require('unbound_casp_api');
var defaultClient = UnboundCaspApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new UnboundCaspApi.AccountsApi();

var id = "id_example"; // String | Account ID

var opts = { 
  'withStats': true // Boolean | Return detailed information about the account
};
apiInstance.getAccount(id, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| Account ID | 
 **withStats** | **Boolean**| Return detailed information about the account | [optional] 

### Return type

[**[InlineResponse2001]**](InlineResponse2001.md)

### Authorization

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

### HTTP request headers

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

<a name="listAccounts"></a>
# **listAccounts**
> [InlineResponse200] listAccounts(opts)

List accounts

List all accounts managed by the CASP service

### Example
```javascript
var UnboundCaspApi = require('unbound_casp_api');
var defaultClient = UnboundCaspApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new UnboundCaspApi.AccountsApi();

var opts = { 
  'withStats': true // Boolean | Include additional info per account
};
apiInstance.listAccounts(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **withStats** | **Boolean**| Include additional info per account | [optional] 

### Return type

[**[InlineResponse200]**](InlineResponse200.md)

### Authorization

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

### HTTP request headers

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

<a name="updateAccount"></a>
# **updateAccount**
> updateAccount(id, body)

Update an existing account

Update the parameters for a specific account

### Example
```javascript
var UnboundCaspApi = require('unbound_casp_api');
var defaultClient = UnboundCaspApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new UnboundCaspApi.AccountsApi();

var id = "id_example"; // String | Account ID

var body = new UnboundCaspApi.Body1(); // Body1 | Update account request

apiInstance.updateAccount(id, body).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| Account ID | 
 **body** | [**Body1**](Body1.md)| Update account request | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

