# StreamsSessionsApi

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

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**closeStreamSession**](#closestreamsession) | **PUT** /streams/{streamId}/sessions/{sessionId}/close | Close an active stream session|
|[**exportStreamSession**](#exportstreamsession) | **POST** /streams/{streamId}/sessions/{sessionId}/export | Request an export of a stream session|
|[**getStreamSession**](#getstreamsession) | **GET** /streams/{streamId}/sessions/{sessionId} | Get a single stream session|
|[**getStreamSessionChat**](#getstreamsessionchat) | **GET** /streams/{streamId}/sessions/{sessionId}/chat | List a stream session\&#39;s chat messages|
|[**getStreamSessionSubscriptions**](#getstreamsessionsubscriptions) | **GET** /streams/{streamId}/sessions/{sessionId}/subscriptions | List a stream session\&#39;s viewer connections|
|[**getStreamSessions**](#getstreamsessions) | **GET** /streams/{streamId}/sessions | List a stream\&#39;s broadcast sessions|

# **closeStreamSession**
> CreateAccountInvitations200Response closeStreamSession()

Ends the specified live session (sessionId) on a stream input, disconnecting all viewer subscriptions and marking the session as ended; requires the read and update permissions on streams.

### Example

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

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

let streamId: string; //The stream identifier (default to undefined)
let sessionId: string; //The session identifier (default to undefined)

const { status, data } = await apiInstance.closeStreamSession(
    streamId,
    sessionId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **streamId** | [**string**] | The stream identifier | defaults to undefined|
| **sessionId** | [**string**] | The session 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)

# **exportStreamSession**
> CreateAccountInvitations200Response exportStreamSession()

Queues an asynchronous export job for the given stream session (sessionId), emailing the requesting user a download when the export completes; requires the read permission on streams.

### Example

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

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

let streamId: string; //The stream identifier (default to undefined)
let sessionId: string; //The session identifier (default to undefined)

const { status, data } = await apiInstance.exportStreamSession(
    streamId,
    sessionId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **streamId** | [**string**] | The stream identifier | defaults to undefined|
| **sessionId** | [**string**] | The session 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)

# **getStreamSession**
> GetStreamSession200Response getStreamSession()

Returns details for one broadcast session of the given stream input, such as its status and timing information; requires read permission on streams.

### Example

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

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

let streamId: string; //The stream identifier (default to undefined)
let sessionId: string; //The session identifier (default to undefined)

const { status, data } = await apiInstance.getStreamSession(
    streamId,
    sessionId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **streamId** | [**string**] | The stream identifier | defaults to undefined|
| **sessionId** | [**string**] | The session identifier | defaults to undefined|


### Return type

**GetStreamSession200Response**

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

# **getStreamSessionChat**
> GetStreamSessionChat200Response getStreamSessionChat()

Returns a cursor-paginated list of the most recent chat messages sent during the given stream session, ordered for chronological display; requires read permission on streams.

### Example

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

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

let streamId: string; //The stream identifier (default to undefined)
let sessionId: string; //The session identifier (default to undefined)

const { status, data } = await apiInstance.getStreamSessionChat(
    streamId,
    sessionId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **streamId** | [**string**] | The stream identifier | defaults to undefined|
| **sessionId** | [**string**] | The session identifier | defaults to undefined|


### Return type

**GetStreamSessionChat200Response**

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

# **getStreamSessionSubscriptions**
> GetStreamSessionSubscriptions200Response getStreamSessionSubscriptions()

Returns a paginated list of viewer WebSocket subscriptions for the given stream session, each with its connection details, optionally filtered to only active (not yet disconnected) subscriptions; requires read permission on streams.

### Example

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

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

let streamId: string; //The stream identifier (default to undefined)
let sessionId: string; //The session identifier (default to undefined)
let active: boolean; //Filter by active (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.getStreamSessionSubscriptions(
    streamId,
    sessionId,
    active,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **streamId** | [**string**] | The stream identifier | defaults to undefined|
| **sessionId** | [**string**] | The session identifier | defaults to undefined|
| **active** | [**boolean**] | Filter by active | (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

**GetStreamSessionSubscriptions200Response**

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

# **getStreamSessions**
> GetStreamSessions200Response getStreamSessions()

Returns a paginated list of broadcast sessions for the given stream input, filterable by session status; requires read permission on streams.

### Example

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

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

let streamId: string; //The stream identifier (default to undefined)
let status: string; //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.getStreamSessions(
    streamId,
    status,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **streamId** | [**string**] | The stream identifier | defaults to undefined|
| **status** | [**string**] | 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

**GetStreamSessions200Response**

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

