# Rooms

You can use the **CloudService.Rooms** API to create new Rooms or delete and fetch existing ones.

After [logging in to coherence Cloud](/hosting/coherence-cloud/authentication-service-player-accounts.md) and fetching an existing Room, you can join it via the CoherenceBridge.JoinRoom method:

```csharp
using Coherence.Cloud;
using Coherence.Toolkit;
using UnityEngine;

class CreateRoomExample : MonoBehaviour
{
    async void Start()
    {
        // Wait until a player account has logged in to coherence Cloud.
        // The CoherenceCloudLogin component can be used for this.
        PlayerAccount playerAccount = await PlayerAccount.GetMainAsync();

        // Fetch information about regions available in our Project.
        var regionsService = playerAccount.Services.Regions;
        var regions = await regionsService.FetchRegionsAsync();

        // Create a new room in the first available region
        var rooms = playerAccount.Services.Rooms;
        var roomsService = rooms.GetRoomServiceForRegion(regions[0]);
        var newRoom = await roomsService.CreateRoomAsync(RoomCreationOptions.Default);

        // Join the room using the CoherenceBridge for this scene
        if (CoherenceBridgeStore.TryGetBridge(gameObject.scene, out var bridge))
        {
            bridge.JoinRoom(newRoom);
        }
    }
}
```

You can set **FindOrCreate** on **RoomCreationOptions** to **true** to first try finding an existing room with the specified tags, before creating a new one if none were found:

```csharp
// Try finding an existing room with the "Capture The Flag"
// and "Ranked" tags, or create a new one if none exist.
var creationOptions = new RoomCreationOptions
{
    FindOrCreate = true,
    Tags = new[] { "Capture The Flag", "Ranked" }
};

var room = await roomsService.CreateRoomAsync(creationOptions);
```


---

# 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://docs.coherence.io/hosting/coherence-cloud/coherence-cloud-apis/rooms.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.
