# SearchlistsApi

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

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**createSearchList**](#createsearchlist) | **POST** /searchlists | Create a search list|
|[**deleteSearchList**](#deletesearchlist) | **DELETE** /searchlists/{searchListId} | Delete a search list|
|[**getSearchList**](#getsearchlist) | **GET** /searchlists/{searchListId} | Get a search list|
|[**getSearchLists**](#getsearchlists) | **GET** /searchlists | List an organization\&#39;s search lists|
|[**updateSearchList**](#updatesearchlist) | **PUT** /searchlists/{searchListId} | Update a search list|

# **createSearchList**
> CreateSearchList200Response createSearchList(searchListCreateInputs)

Creates a new organization-scoped search list (a reusable named set of selectable values, e.g. for survey question options); fails if a search list with the same name already exists, and requires the create permission on the org domain.

### Example

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

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

let searchListCreateInputs: SearchListCreateInputs; //

const { status, data } = await apiInstance.createSearchList(
    searchListCreateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **searchListCreateInputs** | **SearchListCreateInputs**|  | |


### Return type

**CreateSearchList200Response**

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

# **deleteSearchList**
> CreateAccountInvitations200Response deleteSearchList()

Permanently deletes a search list by ID; fails if the search list is currently referenced by any questions, sessions, or surveys, and requires the update permission on the org domain.

### Example

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

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

let searchListId: string; //The searchList identifier (default to undefined)

const { status, data } = await apiInstance.deleteSearchList(
    searchListId
);
```

### Parameters

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

# **getSearchList**
> CreateSearchList200Response getSearchList()

Returns a single search list by its ID, including its configuration; requires the `read:org` permission.

### Example

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

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

let searchListId: string; //The searchList identifier (default to undefined)

const { status, data } = await apiInstance.getSearchList(
    searchListId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **searchListId** | [**string**] | The searchList identifier | defaults to undefined|


### Return type

**CreateSearchList200Response**

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

# **getSearchLists**
> GetSearchLists200Response getSearchLists()

Returns a paginated, searchable list of search lists belonging to the organization, with optional page size, ordering, and search term filters; requires the `read:org` permission.

### Example

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

const configuration = new Configuration();
const apiInstance = new SearchlistsApi(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.getSearchLists(
    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

**GetSearchLists200Response**

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

# **updateSearchList**
> CreateSearchList200Response updateSearchList(searchListUpdateInputs)

Updates a search list\'s properties such as its name; fails if renaming would collide with another existing search list\'s name, and requires the update permission on the org domain.

### Example

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

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

let searchListId: string; //The searchList identifier (default to undefined)
let searchListUpdateInputs: SearchListUpdateInputs; //

const { status, data } = await apiInstance.updateSearchList(
    searchListId,
    searchListUpdateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **searchListUpdateInputs** | **SearchListUpdateInputs**|  | |
| **searchListId** | [**string**] | The searchList identifier | defaults to undefined|


### Return type

**CreateSearchList200Response**

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

