> For the complete documentation index, see [llms.txt](https://developer.perculus.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.perculus.com/services/session-management/session-create.md).

# Creating a Session

{% hint style="danger" %}
**Important Note!**\
\
Constructor Groups’ V1 API has been retired and is no longer available to new customers. Please use the Groups V2 API going forward.\
\
Link to V2 API documentation: <https://developer.perculus.com/v2-en>
{% endhint %}

The list below explains all the parameters available when creating a session.

<table data-full-width="true"><thead><tr><th width="209">Parameter</th><th width="155">Type</th><th width="128">Required</th><th width="102">Default</th><th>Description</th></tr></thead><tbody><tr><td>name</td><td>string</td><td>Yes</td><td>n/a</td><td>Session's name</td></tr><tr><td>description</td><td>string</td><td>Yes</td><td><em>n/a</em></td><td>Session's description</td></tr><tr><td>tags</td><td>string</td><td>No</td><td>null</td><td>A comma separated list of tags</td></tr><tr><td>start_date</td><td>string</td><td>Yes</td><td>n/a</td><td>Date which the session will start(<a href="/pages/lLpdFu4z4JIivcKEy2nr">see</a>)</td></tr><tr><td>duration</td><td>integer</td><td>Yes</td><td>n/a</td><td>Session duration in minutes. It can be between 5 and 360 minutes.</td></tr><tr><td>lang</td><td>string</td><td>No</td><td>tr-TR</td><td>Language code(<a href="/pages/g1PtbMSKQwBvj8rlAjqB">see</a>)</td></tr><tr><td>timezone</td><td>string</td><td>No</td><td>Europe/Istanbul</td><td>TZ identifier (<a href="/pages/QQkLKY0zSq1aG5jrSdPH">see</a>)</td></tr><tr><td>options</td><td><a href="/pages/cQpTnQcpJmixOvnTB4vP">Session Options Object</a></td><td>No</td><td><em>See object</em></td><td>Contains various session options(<a href="#options-object">see</a>)</td></tr><tr><td>allow_recording</td><td>bool</td><td>No</td><td>true</td><td>Flag to determine if the session will be recorded</td></tr><tr><td>inaccessible_replay</td><td>bool</td><td>No</td><td>false</td><td>Flag to determine if the session's replay should be inaccessible</td></tr></tbody></table>

**Example below shows how to create a new session with a specified set of parameters.**

{% tabs %}
{% tab title="CURL" %}

```bash
curl --location --request POST 'https://<DOMAIN>/xapi/session' \
--header 'Authorization: Bearer <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
    "name": "test session ",
    "start_date": "2024-09-27T14:00:25.699Z",
    "duration": "6",
    "options": {
        "allow_rating": false,
        "chat": {
            "offMessageModule": true,
            "offGeneralMsging": false
        },
        "duration": {
            "allowExtendTime": false,
            "useRemainingTime": true
        },
        "allow_users_stream_self_cam_mic": false,
    }
}'
```

{% endtab %}

{% tab title="Python" %}

```python
from perculus_sdk.client import APIClient

# API client
client = APIClient()
...

# Create session 
session = client.sessions.create_session({
    "name": "test session",
    "start_date": "2024-09-27T14:00:25.699Z",
    "duration": "6",
    "options": {
        "allow_rating": false,
        "chat": {
            "offMessageModule": true,
            "offGeneralMsging": false
        },
        "duration": {
            "allowExtendTime": false,
            "useRemainingTime": true
        },
        "allow_users_stream_self_cam_mic": false,
    }
})
print(session)
```

{% endtab %}

{% tab title="C#" %}

```
// ASAP :)
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
import APIClient from "perculus-sdk"

// API client
const client = new APIClient()
...

// Create session 
const session = client.sessions.createSession({
    name: "test session",
    start_date: "2024-09-27T14:00:25.699Z",
    duration: "6",
    options: {
        allow_rating: false,
        chat: {
            offMessageModule: true,
            offGeneralMsging: false
        },
        duration: {
            allowExtendTime: false,
            useRemainingTime: true
        },
        allow_users_stream_self_cam_mic: false,
    }
})
console.log(session)
```

{% endtab %}

{% tab title="Go" %}

```
// ASAP :)
```

{% endtab %}
{% endtabs %}

Below is an example response from the service:

```json
{
    "session_id": "<SESSION_ID>",
    "name": "test session",
    "description": "",
    "tags": "",
    "start_date": "2024-09-27T14:00:25.699+03:00",
    "timezone": "Europe/Istanbul",
    "duration": 6,
    "lang": "tr-TR",
    "status": 1, 
    "replay_status": 0,
    "options": {
        "allow_rating": false,
        "preparation_time": 15,
        "session_duration": 60,
        "chat": {
            "offMessageModule": true,
            "offGeneralMsging": false,
            "offGeneralMsgLimitForUser": false,
            "offSpecialMsging": false,
            "offSpecialMsgToAdmin": false,
            "offSpecialMsgToUser": false,
            "offNewMsgSound": false,
            "offClearForReplay": false,
            "onNewMsgSoundInAll": false,
            "onNewMsgNotifyInAll": false
        },
        "duration": {
            "allowExtendTime": false,
            "useRemainingTime": true
        },
        "allow_users_stream_self_cam_mic": false,
        "hide_user_streams": false,
        "enable_attendance_check": false,
        "enable_simultaneous_interpretation": false,
        "enable_simultaneous_interpretation_for_users": false,
        "start_active": false,
        "return_url": ""
    },
    "creation_date": "2024-08-01T22:53:46.5570837+00:00",
    "updating_date": null
}
```
