# SurveysApi

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

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**createSurvey**](#createsurvey) | **POST** /surveys | Create a survey|
|[**deleteSurvey**](#deletesurvey) | **DELETE** /surveys/{surveyId} | Delete a survey|
|[**getSurvey**](#getsurvey) | **GET** /surveys/{surveyId} | Get a survey|
|[**getSurveySessions**](#getsurveysessions) | **GET** /surveys/{surveyId}/sessions | List a survey\&#39;s linked event sessions|
|[**getSurveys**](#getsurveys) | **GET** /surveys | List surveys|
|[**updateSurvey**](#updatesurvey) | **PUT** /surveys/{surveyId} | Update a survey|

# **createSurvey**
> CreateSurvey200Response createSurvey(surveyCreateInputs)

Creates a new survey for the organization, optionally attaching it to an event (and, in turn, an event activation); requires the create surveys permission.

### Example

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

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

let surveyCreateInputs: SurveyCreateInputs; //

const { status, data } = await apiInstance.createSurvey(
    surveyCreateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **surveyCreateInputs** | **SurveyCreateInputs**|  | |


### Return type

**CreateSurvey200Response**

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

# **deleteSurvey**
> CreateAccountInvitations200Response deleteSurvey()

Permanently deletes the survey identified by surveyId, including its sections, questions, and submissions; requires delete permission on surveys.

### Example

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

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

let surveyId: string; //The survey identifier (default to undefined)

const { status, data } = await apiInstance.deleteSurvey(
    surveyId
);
```

### Parameters

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

# **getSurvey**
> CreateSurvey200Response getSurvey()

Retrieves a single survey by ID or slug, including its configuration and metadata, requiring read permission on surveys.

### Example

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

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

let surveyId: string; //The survey identifier (default to undefined)

const { status, data } = await apiInstance.getSurvey(
    surveyId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **surveyId** | [**string**] | The survey identifier | defaults to undefined|


### Return type

**CreateSurvey200Response**

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

# **getSurveySessions**
> GetEventActivationSessions200Response getSurveySessions()

Returns a paginated list of event sessions associated with the given survey, supporting search and ordering; requires read permission on surveys.

### Example

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

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

let surveyId: string; //The survey identifier (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.getSurveySessions(
    surveyId,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **surveyId** | [**string**] | The survey identifier | 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

**GetEventActivationSessions200Response**

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

# **getSurveys**
> GetSurveys200Response getSurveys()

Returns a paginated list of surveys for the organization, optionally filtered by event, session, or status, with search and ordering support, requiring read permission on surveys.

### Example

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

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

let eventId: string; //Filter by eventId (optional) (default to undefined)
let sessionId: string; //Filter by sessionId (optional) (default to undefined)
let status: SurveyStatus; //Filter by status (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.getSurveys(
    eventId,
    sessionId,
    status,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **eventId** | [**string**] | Filter by eventId | (optional) defaults to undefined|
| **sessionId** | [**string**] | Filter by sessionId | (optional) defaults to undefined|
| **status** | **SurveyStatus** | Filter by status | (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

**GetSurveys200Response**

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

# **updateSurvey**
> CreateSurvey200Response updateSurvey(surveyUpdateInputs)

Updates the survey identified by surveyId, including its details and optional event/activation linkage, and returns the updated survey; requires update permission on surveys.

### Example

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

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

let surveyId: string; //The survey identifier (default to undefined)
let surveyUpdateInputs: SurveyUpdateInputs; //

const { status, data } = await apiInstance.updateSurvey(
    surveyId,
    surveyUpdateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **surveyUpdateInputs** | **SurveyUpdateInputs**|  | |
| **surveyId** | [**string**] | The survey identifier | defaults to undefined|


### Return type

**CreateSurvey200Response**

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

