# APIKeysRotationApi

All URIs are relative to *http://localhost:8889/api*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**rotateKey**](#rotatekey) | **POST** /apikey/rotation | Rotate API key|

# **rotateKey**
> ApiKeyRotationResult rotateKey()


### Example

```typescript
import {
    APIKeysRotationApi,
    Configuration,
    ApiKey
} from './api';

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

let secretkey: string; //Secret key used to authenticate to this endpoint in order to perform a rotate key operation. (default to undefined)
let apiKey: ApiKey; //Represents the action of rotating an existing API key, by providing the API key to be rotated and the time to live (TTL) of the newly created API key. If a TTL is set in preferences, it will have priority over the one provided in the API. If no TTL is set in preferences and none is provided in the API, the generated key will have unlimited TTL by default. (optional)

const { status, data } = await apiInstance.rotateKey(
    secretkey,
    apiKey
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **apiKey** | **ApiKey**| Represents the action of rotating an existing API key, by providing the API key to be rotated and the time to live (TTL) of the newly created API key. If a TTL is set in preferences, it will have priority over the one provided in the API. If no TTL is set in preferences and none is provided in the API, the generated key will have unlimited TTL by default. | |
| **secretkey** | [**string**] | Secret key used to authenticate to this endpoint in order to perform a rotate key operation. | defaults to undefined|


### Return type

**ApiKeyRotationResult**

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | API key rotated successfully. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |

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

