# Room

## Create Room

```csharp
Task<CreateRoomResponse> CreateRoomAsync(string name, string[]? invitedUserIds)
```

Input params：`RoomCreateOptions`

| Name           | Type         | Description                 | Required |
| -------------- | ------------ | --------------------------- | -------- |
| name           | string       | room name                   | true     |
| invitedUserIds | string array | array of user ids to invite | false    |

Output params:

| Name                      | Type   | Description        | Required |
| ------------------------- | ------ | ------------------ | -------- |
| CreateRoomResponse.RoomId | string | id of the new room | true     |

## Invite User

```csharp
Task InviteUserAsync(string roomId, string userId)
```

Input params：

| Name   | Type   | Description | Required |
| ------ | ------ | ----------- | -------- |
| roomId | string | room id     | true     |
| userId | string | user id     | true     |

Output params: none

## Kick User

```csharp
Task KickUserAsync(string roomId, string userId)
```

Input params：

| Name   | Type   | Description | Required |
| ------ | ------ | ----------- | -------- |
| roomId | string | room id     | true     |
| userId | string | user id     | true     |

Return values: none

## Join Room

```csharp
Task<JoinRoomResponse> JoinRoomAsync(string roomId)
```

Input params：

| Name   | Type   | Description | Required |
| ------ | ------ | ----------- | -------- |
| roomId | string | room id     | true     |

Output params:

| Name                    | Type   | Description | Required |
| ----------------------- | ------ | ----------- | -------- |
| JoinRoomResponse.RoomId | string | room id     | true     |

## Leave Room

```csharp
Task LeaveRoomAsync(string roomId)
```

Input params：

| Name   | Type   | Description | Required |
| ------ | ------ | ----------- | -------- |
| roomId | string | room id     | true     |

Output params: none

## Get Room Memebers

```csharp
Task<RoomMembersResponse> GetRoomMembersAsync(string roomId)
```

Input params：

| Name   | Type   | Description | Required |
| ------ | ------ | ----------- | -------- |
| roomId | string | room id     | true     |

Output params:

| Name                       | Type                | Description  | Required |
| -------------------------- | ------------------- | ------------ | -------- |
| RoomMembersResponse.joined | array of MemberInfo | room members | true     |

MemberInfo:

| Name                   | Type   | Description         | Required |
| ---------------------- | ------ | ------------------- | -------- |
| MemberInfo.DisplayName | string | member display name | true     |
| MemberInfo.AvatarUrl   | string | member avatar url   | true     |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sending-network.gitbook.io/sending.network/sdk-documentation/unity-sdk/room.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
