# SelfApikeysApi

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

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**createSelfApiKey**](#createselfapikey) | **POST** /self/api-keys | Create an API key for the current user|
|[**deleteSelfApiKey**](#deleteselfapikey) | **DELETE** /self/api-keys/{apiKeyId} | Delete an API key for the current user|
|[**getSelfApiKey**](#getselfapikey) | **GET** /self/api-keys/{apiKeyId} | Get one of the current user\&#39;s API keys|
|[**getSelfApiKeys**](#getselfapikeys) | **GET** /self/api-keys | List the current user\&#39;s API keys|

# **createSelfApiKey**
> CreateSelfApiKey200Response createSelfApiKey(userApiKeyCreateInputs)

Generates a new personal API key for the authenticated user with the given name, description, scope, and validity window, returning the full key value only once at creation time.

### Example

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

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

let userApiKeyCreateInputs: UserApiKeyCreateInputs; //

const { status, data } = await apiInstance.createSelfApiKey(
    userApiKeyCreateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **userApiKeyCreateInputs** | **UserApiKeyCreateInputs**|  | |


### Return type

**CreateSelfApiKey200Response**

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/json
 - **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)

# **deleteSelfApiKey**
> CreateAccountInvitations200Response deleteSelfApiKey()

Permanently revokes and removes the specified personal API key belonging to the authenticated user.

### Example

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

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

let apiKeyId: string; //The apiKey identifier (default to undefined)

const { status, data } = await apiInstance.deleteSelfApiKey(
    apiKeyId
);
```

### Parameters

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

# **getSelfApiKey**
> CreateSelfApiKey200Response getSelfApiKey()

Returns a single API key belonging to the authenticated user, identified by its API key ID; users can only access their own API keys.

### Example

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

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

let apiKeyId: string; //The apiKey identifier (default to undefined)

const { status, data } = await apiInstance.getSelfApiKey(
    apiKeyId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **apiKeyId** | [**string**] | The apiKey identifier | defaults to undefined|


### Return type

**CreateSelfApiKey200Response**

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

# **getSelfApiKeys**
> GetSelfApiKeys200Response getSelfApiKeys()

Returns a paginated, searchable list of API keys belonging to the authenticated user, with optional page size, ordering, and search term filters.

### Example

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

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

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.getSelfApiKeys(
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **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

**GetSelfApiKeys200Response**

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

