> ## Documentation Index
> Fetch the complete documentation index at: https://superofficeas-bugfix-ty-screen-designer-paradox.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# NSChatSession

> Use the ChatSessionEntity on the Chat agent instead. Chat sessions belong to a chat topic, and contain messages to/from users. Carrier object for ChatSession.

Use the ChatSessionEntity on the Chat agent instead. Chat sessions belong to a chat topic, and contain messages to/from users. Carrier object for ChatSession.

## Constructors

### NSChatSession()

```crmscript theme={null}
NSChatSession
```

Initializes a new instance of the NSChatSession class.

## Methods

## GetChatSessionId()

```crmscript theme={null}
Integer GetChatSessionId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The primary key (auto-incremented).

**Example:**

```crmscript theme={null}
NSChatSession thing;
Integer chatSessionId = thing.GetChatSessionId();
```

## SetChatSessionId(Integer)

```crmscript theme={null}
Void SetChatSessionId(Integer chatSessionId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSChatSession thing;
Integer chatSessionId;
thing.SetChatSessionId(chatSessionId);
```
