# StorageImagesApi

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

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**confirmImageUpload**](#confirmimageupload) | **POST** /images/{imageId}/confirm | Confirm a completed direct image upload|
|[**deleteImage**](#deleteimage) | **DELETE** /images/{imageId} | Delete an image|
|[**deleteManyImages**](#deletemanyimages) | **POST** /images/delete | Delete multiple images|
|[**getImage**](#getimage) | **GET** /images/{imageId} | Get an image|
|[**getImageUsage**](#getimageusage) | **GET** /images/{imageId}/usage | Get an image\&#39;s usage|
|[**getImages**](#getimages) | **GET** /images | List stored images|
|[**requestImageDirectUpload**](#requestimagedirectupload) | **POST** /images/direct-upload | Request a direct image upload URL|
|[**switchImage**](#switchimage) | **PUT** /images/{imageId}/switch | Replace an image\&#39;s file contents|
|[**updateImage**](#updateimage) | **PUT** /images/{imageId} | Update an image\&#39;s metadata|

# **confirmImageUpload**
> GetImage200Response confirmImageUpload()

Verifies that a previously requested direct upload has finished landing on storage and finalizes the image record, requiring create permission on storage.

### Example

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

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

let imageId: string; //The image identifier (default to undefined)

const { status, data } = await apiInstance.confirmImageUpload(
    imageId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **imageId** | [**string**] | The image identifier | defaults to undefined|


### Return type

**GetImage200Response**

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

# **deleteImage**
> CreateAccountInvitations200Response deleteImage()

Permanently deletes the specified image from storage and the CDN, requiring delete permission on storage.

### Example

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

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

let imageId: string; //The image identifier (default to undefined)

const { status, data } = await apiInstance.deleteImage(
    imageId
);
```

### Parameters

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

# **deleteManyImages**
> CreateAccountInvitations200Response deleteManyImages(deleteManyImagesInput)

Permanently deletes up to 50 images identified by their IDs from storage and the CDN in a single request, requiring delete permission on storage.

### Example

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

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

let deleteManyImagesInput: DeleteManyImagesInput; //

const { status, data } = await apiInstance.deleteManyImages(
    deleteManyImagesInput
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **deleteManyImagesInput** | **DeleteManyImagesInput**|  | |


### Return type

**CreateAccountInvitations200Response**

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

# **getImage**
> GetImage200Response getImage()

Returns the details of a single stored image by ID; requires \"read\" permission on \"storage\".

### Example

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

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

let imageId: string; //The image identifier (default to undefined)

const { status, data } = await apiInstance.getImage(
    imageId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **imageId** | [**string**] | The image identifier | defaults to undefined|


### Return type

**GetImage200Response**

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

# **getImageUsage**
> GetImageUsage200Response getImageUsage()

Returns the accounts, events, sessions, and other resources that reference the given image, so it can be checked for usage before deletion; requires \"read\" permission on \"storage\".

### Example

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

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

let imageId: string; //The image identifier (default to undefined)

const { status, data } = await apiInstance.getImageUsage(
    imageId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **imageId** | [**string**] | The image identifier | defaults to undefined|


### Return type

**GetImageUsage200Response**

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

# **getImages**
> GetImages200Response getImages()

Returns a paginated list of the organization\'s stored images, optionally filtered by image type and searched/ordered; requires \"read\" permission on \"storage\".

### Example

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

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

let type: ImageType; //Filter by type (optional) (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.getImages(
    type,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **type** | **ImageType** | Filter by type | (optional) 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

**GetImages200Response**

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

# **requestImageDirectUpload**
> RequestImageDirectUpload200Response requestImageDirectUpload(imageDirectUploadInputs)

Creates an unconfirmed image record and returns a one-time Cloudflare upload URL so the client can upload the raw image bytes directly, bypassing the API; requires the create and read permissions on the storage module, and the image must be confirmed afterward before it is finalized.

### Example

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

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

let imageDirectUploadInputs: ImageDirectUploadInputs; //

const { status, data } = await apiInstance.requestImageDirectUpload(
    imageDirectUploadInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **imageDirectUploadInputs** | **ImageDirectUploadInputs**|  | |


### Return type

**RequestImageDirectUpload200Response**

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

# **switchImage**
> GetImage200Response switchImage()

Replaces the underlying file for an existing image record with a newly uploaded image (jpeg, png, heic, or heif), re-deriving its dimensions and moderation level while keeping the same image ID; requires the update and read permissions on the storage module.

### Example

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

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

let imageId: string; //The image identifier (default to undefined)
let image: object; //Filter by image (default to undefined)

const { status, data } = await apiInstance.switchImage(
    imageId,
    image
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **imageId** | [**string**] | The image identifier | defaults to undefined|
| **image** | **object** | Filter by image | defaults to undefined|


### Return type

**GetImage200Response**

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

# **updateImage**
> GetImage200Response updateImage(imageUpdateInputs)

Updates the name, description, and/or type of an existing image record without altering its underlying file; requires the update and read permissions on the storage module.

### Example

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

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

let imageId: string; //The image identifier (default to undefined)
let imageUpdateInputs: ImageUpdateInputs; //

const { status, data } = await apiInstance.updateImage(
    imageId,
    imageUpdateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **imageUpdateInputs** | **ImageUpdateInputs**|  | |
| **imageId** | [**string**] | The image identifier | defaults to undefined|


### Return type

**GetImage200Response**

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

