> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SuperOffice.WebApi.Agents.IChatAgent

# \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent">\</a> Interface IChatAgent

Namespace: [SuperOffice.WebApi.Agents](SuperOffice.WebApi.Agents.md)\
Assembly: SuperOffice.WebApi.dll

Chat functions. Manage chat channels, sessions and messages.

```csharp theme={null}
public interface IChatAgent : IAgentBase, IDisposable
```

#### Implements

[IAgentBase](SuperOffice.WebApi.Agents.IAgentBase.md),
[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

## Methods

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_AcceptChatSessionTransferAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> AcceptChatSessionTransferAsync(int, RequestOptions)

Accept the transfer: assign the session to the user. If the session is not being transferred, nothing happens.

```csharp theme={null}
Task<ChatSessionEntity> AcceptChatSessionTransferAsync(int chatSessionId, RequestOptions requestOptions = null)
```

#### Parameters

`chatSessionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

id of the chat session to send

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatSessionEntity](SuperOffice.WebApi.Data.ChatSessionEntity.md)\&gt;

The updated chat session

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_AddChatMessageAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_ChatMessage\_SuperOffice\_WebApi\_RequestOptions\_">\</a> AddChatMessageAsync(int, ChatMessage, RequestOptions)

Add a new message to a chat session

```csharp theme={null}
Task<ChatMessage> AddChatMessageAsync(int chatSessionId, ChatMessage message, RequestOptions requestOptions = null)
```

#### Parameters

`chatSessionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

id of the chat session to add message to

`message` [ChatMessage](SuperOffice.WebApi.Data.ChatMessage.md)

Message to add

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatMessage](SuperOffice.WebApi.Data.ChatMessage.md)\&gt;

The chat message added to the session

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_AddChatTopicUserAgentAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_ChatTopicAgent\_SuperOffice\_WebApi\_RequestOptions\_">\</a> AddChatTopicUserAgentAsync(int, ChatTopicAgent, RequestOptions)

Add a user to a chat topic

```csharp theme={null}
Task<ChatTopicAgent> AddChatTopicUserAgentAsync(int chatTopicId, ChatTopicAgent useragent, RequestOptions requestOptions = null)
```

#### Parameters

`chatTopicId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Id of the chat topic

`useragent` [ChatTopicAgent](SuperOffice.WebApi.Data.ChatTopicAgent.md)

User's role within the chat topic to add to topic.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatTopicAgent](SuperOffice.WebApi.Data.ChatTopicAgent.md)\&gt;

The user's role within the chat topic.

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_ChatSessionsForUserAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ChatSessionsForUserAsync(RequestOptions)

Get all chat sessions which this user is a member of. Members means that you have at least one of: Can Respond, Notifications, Listen or Manager

```csharp theme={null}
Task<ChatSessionEntity[]> ChatSessionsForUserAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatSessionEntity](SuperOffice.WebApi.Data.ChatSessionEntity.md)\[]\&gt;

Array of chat sessions the current user can access

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_ChatTopicsForUserAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ChatTopicsForUserAsync(RequestOptions)

Get all chat topics which this user is a member of. Members means that you have at least one of: Can Respond, Notifications, Listen or Manager

```csharp theme={null}
Task<ChatTopicEntity[]> ChatTopicsForUserAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatTopicEntity](SuperOffice.WebApi.Data.ChatTopicEntity.md)\[]\&gt;

Array of chat topics the current user can access

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_CreateChatSessionForTopicAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateChatSessionForTopicAsync(int, RequestOptions)

Create a new session on a chat topic

```csharp theme={null}
Task<ChatSessionEntity> CreateChatSessionForTopicAsync(int chatTopicId, RequestOptions requestOptions = null)
```

#### Parameters

`chatTopicId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Id of the chat topic

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatSessionEntity](SuperOffice.WebApi.Data.ChatSessionEntity.md)\&gt;

The new chat session.

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_CreateDefaultChatSessionEntityAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultChatSessionEntityAsync(RequestOptions)

Set default values into a new ChatSessionEntity.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<ChatSessionEntity> CreateDefaultChatSessionEntityAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatSessionEntity](SuperOffice.WebApi.Data.ChatSessionEntity.md)\&gt;

A blank ChatSessionEntity

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_CreateDefaultChatTopicAgentAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultChatTopicAgentAsync(RequestOptions)

Set default values into a new ChatTopicAgent.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<ChatTopicAgent> CreateDefaultChatTopicAgentAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatTopicAgent](SuperOffice.WebApi.Data.ChatTopicAgent.md)\&gt;

A blank ChatTopicAgent

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_CreateDefaultChatTopicEntityAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultChatTopicEntityAsync(RequestOptions)

Set default values into a new ChatTopicEntity.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<ChatTopicEntity> CreateDefaultChatTopicEntityAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatTopicEntity](SuperOffice.WebApi.Data.ChatTopicEntity.md)\&gt;

A blank ChatTopicEntity

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_DeleteChatSessionEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteChatSessionEntityAsync(int, RequestOptions)

Deletes the ChatSessionEntity

```csharp theme={null}
Task DeleteChatSessionEntityAsync(int chatSessionEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`chatSessionEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identity of the ChatSessionEntity

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_DeleteChatTopicEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteChatTopicEntityAsync(int, RequestOptions)

Deletes the ChatTopicEntity

```csharp theme={null}
Task DeleteChatTopicEntityAsync(int chatTopicEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`chatTopicEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identity of the ChatTopicEntity

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_DeleteChatTopicUserAgentAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteChatTopicUserAgentAsync(int, string, RequestOptions)

Remove a user from a topic

```csharp theme={null}
Task DeleteChatTopicUserAgentAsync(int chatTopicId, string username, RequestOptions requestOptions = null)
```

#### Parameters

`chatTopicId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Id of the chat topic

`username` [string](https://learn.microsoft.com/dotnet/api/system.string)

Associate username or associate id to delete.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_GetChatMessagesAsync\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetChatMessagesAsync(int, int, RequestOptions)

Get all or some of the messages in a chat session

```csharp theme={null}
Task<ChatMessage[]> GetChatMessagesAsync(int chatSessionId, int after, RequestOptions requestOptions = null)
```

#### Parameters

`chatSessionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

id of the chat session to reset

`after` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Return messages after this message id

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatMessage](SuperOffice.WebApi.Data.ChatMessage.md)\[]\&gt;

Array of chat messages in the session

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_GetChatPresenceAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetChatPresenceAsync(RequestOptions)

Get the chat presence status for all chat users

```csharp theme={null}
Task<ChatPresence[]> GetChatPresenceAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatPresence](SuperOffice.WebApi.Data.ChatPresence.md)\[]\&gt;

An array with ChatPresence objects for each user

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_GetChatSessionEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetChatSessionEntityAsync(int, RequestOptions)

Gets a specific ChatSessionEntity object.

```csharp theme={null}
Task<ChatSessionEntity> GetChatSessionEntityAsync(int chatSessionEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`chatSessionEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the ChatSessionEntity object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatSessionEntity](SuperOffice.WebApi.Data.ChatSessionEntity.md)\&gt;

ChatSessionEntity

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_GetChatTopicEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetChatTopicEntityAsync(int, RequestOptions)

Gets a specific ChatTopicEntity object.

```csharp theme={null}
Task<ChatTopicEntity> GetChatTopicEntityAsync(int chatTopicEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`chatTopicEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the ChatTopicEntity object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatTopicEntity](SuperOffice.WebApi.Data.ChatTopicEntity.md)\&gt;

ChatTopicEntity

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_GetChatTopicUserAgentAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetChatTopicUserAgentAsync(int, string, RequestOptions)

Get a user assigned to a topic

```csharp theme={null}
Task<ChatTopicAgent> GetChatTopicUserAgentAsync(int chatTopicId, string username, RequestOptions requestOptions = null)
```

#### Parameters

`chatTopicId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Id of the chat topic

`username` [string](https://learn.microsoft.com/dotnet/api/system.string)

Associate username or associate id to get.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatTopicAgent](SuperOffice.WebApi.Data.ChatTopicAgent.md)\&gt;

The user's role within the chat topic.

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_GetChatTopicUserAgentListAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetChatTopicUserAgentListAsync(int, RequestOptions)

Get list of users assigned to a chat topic

```csharp theme={null}
Task<ChatTopicAgent[]> GetChatTopicUserAgentListAsync(int chatTopicId, RequestOptions requestOptions = null)
```

#### Parameters

`chatTopicId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Id of the chat topic

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatTopicAgent](SuperOffice.WebApi.Data.ChatTopicAgent.md)\[]\&gt;

List of user agents assigned to chat topic.

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_GetChatTranscriptAsync\_System\_Int32\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetChatTranscriptAsync(int, bool, RequestOptions)

Get the chat transcript, formatted as plain text or html

```csharp theme={null}
Task<string> GetChatTranscriptAsync(int chatSessionId, bool html, RequestOptions requestOptions = null)
```

#### Parameters

`chatSessionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

id of the chat session to get the transcript for

`html` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Get transcript as HTML

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\&gt;

The transcript in text or HTML

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_GetUserAgentListAsync\_System\_Boolean\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetUserAgentListAsync(bool, bool, RequestOptions)

Get list of users that can be assigned to chat topics. Users with Chat-CALs from the MDO list 'chatuser'

```csharp theme={null}
Task<MDOListItem[]> GetUserAgentListAsync(bool flat, bool onlyPresent, RequestOptions requestOptions = null)
```

#### Parameters

`flat` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Return flat list instead of grouping by usergroup.

`onlyPresent` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Only show users who are present

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[MDOListItem](SuperOffice.WebApi.Data.MDOListItem.md)\[]\&gt;

List of user agents that can be assigned to chat topics, possibly grouped by usergroup.

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_IsWithinOpeningHoursAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> IsWithinOpeningHoursAsync(int, RequestOptions)

Check if we are right now within the opening hours of the given topic. Will use timezones to calculate if configured.

```csharp theme={null}
Task<bool> IsWithinOpeningHoursAsync(int chatTopicId, RequestOptions requestOptions = null)
```

#### Parameters

`chatTopicId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the topic to check

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

True if we are within opening hours, or if the topic does not use opening hours

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_PickUpChatSessionAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> PickUpChatSessionAsync(int, RequestOptions)

'answer' the session: assign the session to the user. The welcome message is sent to the customer. Returns NULL if session was not in queue.

```csharp theme={null}
Task<ChatSessionEntity> PickUpChatSessionAsync(int chatSessionId, RequestOptions requestOptions = null)
```

#### Parameters

`chatSessionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

id of the chat session to answer

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatSessionEntity](SuperOffice.WebApi.Data.ChatSessionEntity.md)\&gt;

The chat session

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_PickUpFirstChatSessionAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> PickUpFirstChatSessionAsync(RequestOptions)

'answer' the first available session from the queue: assign the session to the user. The welcome message is sent to the customer.

```csharp theme={null}
Task<ChatSessionEntity> PickUpFirstChatSessionAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatSessionEntity](SuperOffice.WebApi.Data.ChatSessionEntity.md)\&gt;

The picked-up chat session

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_RejectChatSessionTransferAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RejectChatSessionTransferAsync(int, RequestOptions)

Do not want. Deny the transfer to the user. If the session is not being transferred, nothing happens.

```csharp theme={null}
Task<ChatSessionEntity> RejectChatSessionTransferAsync(int chatSessionId, RequestOptions requestOptions = null)
```

#### Parameters

`chatSessionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

id of the chat session to send back

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatSessionEntity](SuperOffice.WebApi.Data.ChatSessionEntity.md)\&gt;

The updated chat session

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_ResetChatSessionAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ResetChatSessionAsync(int, RequestOptions)

Reset chat session, put it back on the queue for pickup. Used by bots to hand off a session to human

```csharp theme={null}
Task<ChatSessionEntity> ResetChatSessionAsync(int chatSessionId, RequestOptions requestOptions = null)
```

#### Parameters

`chatSessionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

id of the chat session to reset

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatSessionEntity](SuperOffice.WebApi.Data.ChatSessionEntity.md)\&gt;

The updated chat session

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_SaveChatPresenceAsync\_SuperOffice\_WebApi\_Data\_ChatPresence\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveChatPresenceAsync(ChatPresence\[], RequestOptions)

Save the chat presence for specified users

```csharp theme={null}
Task SaveChatPresenceAsync(ChatPresence[] chatPresence, RequestOptions requestOptions = null)
```

#### Parameters

`chatPresence` [ChatPresence](SuperOffice.WebApi.Data.ChatPresence.md)\[]

An array with ChatPresence objects. Only the UserId and Present information is used while saving

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

void

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_SaveChatSessionEntityAsync\_SuperOffice\_WebApi\_Data\_ChatSessionEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveChatSessionEntityAsync(ChatSessionEntity, RequestOptions)

Updates the existing ChatSessionEntity or creates a new ChatSessionEntity if the id parameter is 0.

```csharp theme={null}
Task<ChatSessionEntity> SaveChatSessionEntityAsync(ChatSessionEntity chatSessionEntity, RequestOptions requestOptions = null)
```

#### Parameters

`chatSessionEntity` [ChatSessionEntity](SuperOffice.WebApi.Data.ChatSessionEntity.md)

The ChatSessionEntity that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatSessionEntity](SuperOffice.WebApi.Data.ChatSessionEntity.md)\&gt;

New or updated ChatSessionEntity

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_SaveChatTopicEntityAsync\_SuperOffice\_WebApi\_Data\_ChatTopicEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveChatTopicEntityAsync(ChatTopicEntity, RequestOptions)

Updates the existing ChatTopicEntity or creates a new ChatTopicEntity if the id parameter is 0.

```csharp theme={null}
Task<ChatTopicEntity> SaveChatTopicEntityAsync(ChatTopicEntity chatTopicEntity, RequestOptions requestOptions = null)
```

#### Parameters

`chatTopicEntity` [ChatTopicEntity](SuperOffice.WebApi.Data.ChatTopicEntity.md)

The ChatTopicEntity that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatTopicEntity](SuperOffice.WebApi.Data.ChatTopicEntity.md)\&gt;

New or updated ChatTopicEntity

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_TransferChatSessionAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> TransferChatSessionAsync(int, string, RequestOptions)

Request to send the session to another user. If the session does not belong to the user, nothing happens.

```csharp theme={null}
Task<ChatSessionEntity> TransferChatSessionAsync(int chatSessionId, string toAssociate, RequestOptions requestOptions = null)
```

#### Parameters

`chatSessionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

id of the chat session to send

`toAssociate` [string](https://learn.microsoft.com/dotnet/api/system.string)

Associate username or associate id to send session to.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatSessionEntity](SuperOffice.WebApi.Data.ChatSessionEntity.md)\&gt;

The updated chat session

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_UpdateChatTopicUserAgentAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_Data\_ChatTopicAgent\_SuperOffice\_WebApi\_RequestOptions\_">\</a> UpdateChatTopicUserAgentAsync(int, string, ChatTopicAgent, RequestOptions)

Update a user's role in a chat topic

```csharp theme={null}
Task<ChatTopicAgent> UpdateChatTopicUserAgentAsync(int chatTopicId, string username, ChatTopicAgent useragent, RequestOptions requestOptions = null)
```

#### Parameters

`chatTopicId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Id of the chat topic

`username` [string](https://learn.microsoft.com/dotnet/api/system.string)

Associate username or associate id to get.

`useragent` [ChatTopicAgent](SuperOffice.WebApi.Data.ChatTopicAgent.md)

User's updated role within the chat topic.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatTopicAgent](SuperOffice.WebApi.Data.ChatTopicAgent.md)\&gt;

The user's role within the chat topic.

### \<a id="SuperOffice\_WebApi\_Agents\_IChatAgent\_UpdateChatTopicUserAgentsAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_ChatTopicAgent\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> UpdateChatTopicUserAgentsAsync(int, ChatTopicAgent\[], RequestOptions)

Update users roles in a chat topic

```csharp theme={null}
Task<ChatTopicAgent[]> UpdateChatTopicUserAgentsAsync(int chatTopicId, ChatTopicAgent[] useragents, RequestOptions requestOptions = null)
```

#### Parameters

`chatTopicId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Id of the chat topic

`useragents` [ChatTopicAgent](SuperOffice.WebApi.Data.ChatTopicAgent.md)\[]

Users new/updated roles within the chat topic. Replaces existing roles

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ChatTopicAgent](SuperOffice.WebApi.Data.ChatTopicAgent.md)\[]\&gt;

The updated agents within the chat topic.


## Related topics

- [SuperOffice.WebApi.Agents.ChatAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.ChatAgent.md)
- [SuperOffice.WebApi.Agents.AIAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.AIAgent.md)
- [SuperOffice.WebApi.Agents.IAIAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IAIAgent.md)
- [Get Chat Messages](/en/api/reference/restful/agent/chat_agent/get-chat-messages.md)
- [Get Chat Presence](/en/api/reference/restful/agent/chat_agent/get-chat-presence.md)
- [Save Chat Presence](/en/api/reference/restful/agent/chat_agent/save-chat-presence.md)
