# ThreadsMessagesFilesApi

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

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**createThreadMessageFile**](#createthreadmessagefile) | **POST** /threads/{threadId}/messages/{messageId}/files/{fileId} | Attach a file to a thread message|
|[**deleteThreadMessageFile**](#deletethreadmessagefile) | **DELETE** /threads/{threadId}/messages/{messageId}/files/{fileId} | Remove a file from a thread message|
|[**getThreadMessageFiles**](#getthreadmessagefiles) | **GET** /threads/{threadId}/messages/{messageId}/files | List a thread message\&#39;s attached files|

# **createThreadMessageFile**
> CreateThreadMessage200Response createThreadMessageFile()

Connects an existing uploaded file, identified by fileId, to the thread message identified by messageId within the given threadId and returns the updated message; requires update permission on threads and storage.

### Example

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

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

let threadId: string; //The thread identifier (default to undefined)
let messageId: string; //The message identifier (default to undefined)
let fileId: string; //The file identifier (default to undefined)

const { status, data } = await apiInstance.createThreadMessageFile(
    threadId,
    messageId,
    fileId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **threadId** | [**string**] | The thread identifier | defaults to undefined|
| **messageId** | [**string**] | The message identifier | defaults to undefined|
| **fileId** | [**string**] | The file identifier | defaults to undefined|


### Return type

**CreateThreadMessage200Response**

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

# **deleteThreadMessageFile**
> CreateAccountInvitations200Response deleteThreadMessageFile()

Disconnects the file identified by fileId from the thread message identified by messageId within the given threadId, without deleting the underlying file; requires update permission on threads and storage.

### Example

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

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

let threadId: string; //The thread identifier (default to undefined)
let messageId: string; //The message identifier (default to undefined)
let fileId: string; //The file identifier (default to undefined)

const { status, data } = await apiInstance.deleteThreadMessageFile(
    threadId,
    messageId,
    fileId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **threadId** | [**string**] | The thread identifier | defaults to undefined|
| **messageId** | [**string**] | The message identifier | defaults to undefined|
| **fileId** | [**string**] | The file 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)

# **getThreadMessageFiles**
> GetThreadMessageFiles200Response getThreadMessageFiles()

Returns a paginated list of files attached to the given thread message, supporting search and ordering; requires read permission on threads and storage.

### Example

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

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

let threadId: string; //The thread identifier (default to undefined)
let messageId: string; //The message identifier (default to undefined)

const { status, data } = await apiInstance.getThreadMessageFiles(
    threadId,
    messageId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **threadId** | [**string**] | The thread identifier | defaults to undefined|
| **messageId** | [**string**] | The message identifier | defaults to undefined|


### Return type

**GetThreadMessageFiles200Response**

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

