# ThreadsApi

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

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**createThread**](#createthread) | **POST** /threads | Create a new message thread|
|[**deleteThread**](#deletethread) | **DELETE** /threads/{threadId} | Delete a thread|
|[**getThread**](#getthread) | **GET** /threads/{threadId} | Get a thread|
|[**getThreads**](#getthreads) | **GET** /threads | List threads|
|[**updateThread**](#updatethread) | **PUT** /threads/{threadId} | Update a thread\&#39;s details|

# **createThread**
> CreateThread200Response createThread(threadCreateInputs)

Creates a new thread for direct or group messaging between accounts; requires the \"read\" and \"create\" permissions on threads.

### Example

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

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

let threadCreateInputs: ThreadCreateInputs; //

const { status, data } = await apiInstance.createThread(
    threadCreateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **threadCreateInputs** | **ThreadCreateInputs**|  | |


### Return type

**CreateThread200Response**

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

# **deleteThread**
> CreateAccountInvitations200Response deleteThread()

Permanently deletes a thread and its associated data as part of admin moderation; requires the \"read\" and \"del\" permissions on threads.

### Example

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

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

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

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

### Parameters

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

# **getThread**
> CreateThread200Response getThread()

Returns the details of a single thread by id, including its participants and metadata; requires read permission on threads.

### Example

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

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

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

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

### Parameters

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


### Return type

**CreateThread200Response**

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

# **getThreads**
> GetAccountThreads200Response getThreads()

Returns a paginated list of an organization\'s message threads for admin moderation, with optional filtering by thread type and search; requires read permission on threads.

### Example

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

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

let type: ThreadType; //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.getThreads(
    type,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

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

**GetAccountThreads200Response**

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

# **updateThread**
> CreateThread200Response updateThread(threadUpdateInputs)

Updates properties of an existing thread, such as its name or type; requires the \"read\" and \"update\" permissions on threads.

### Example

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

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

let threadId: string; //The thread identifier (default to undefined)
let threadUpdateInputs: ThreadUpdateInputs; //

const { status, data } = await apiInstance.updateThread(
    threadId,
    threadUpdateInputs
);
```

### Parameters

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


### Return type

**CreateThread200Response**

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

