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

# Creating a Pipe Room

> Creating a Pipe Room through the Hop API. Rooms are Pipe's abstraction of streams.

You should create a new Room for each new live broadcast. If marked with
`ephemeral`, Rooms will automatically delete after 10 minutes of no input
stream. You can also delete them programatically through our API or SDK.

## Room Object

The full Room object returned by our API

| field | type | description |
| - | - | - |
| id | string | hop-generated room ID |
| name | ?string | optional room name |
| ephemeral | boolean | is this room temporary? |
| ingest\_protocol | string | one of: rtp, rtmp, srtp |
| delivery\_protocols | string\[] | an array of supported delivery protocols (llhls, webrtc) |
| join\_token | string | room join token |
| state | string | "live" or "offline" |
| ingest\_endpoint | string | room ingest endpoint (stream to this!) |
| ingest\_region | [region](https://docs.hop.io/reference/regions.md) (string) | the region where the primary ingest is hosted |
| llhls\_config | ?[llhls\_config](https://docs.hop.io/pipe/protocols/llhls#llhls-configuration-object) | custom LLHLS configuration options |
| webrtc\_config | // TODO: @alii ping me once finished with rtc config in sdk | custom WebRTC configuration options |

## Creating a Room

You can create a Pipe Room through our server-side
[SDK](https://www.npmjs.com/package/@onehop/client) or our REST API.

```ts theme={null}
const room = await hop.pipe.rooms.create({
  name: "My Stream", // optional room name
  ingestProtocol: "rtmp", // rtmp or rtp
  deliveryProtocols: ["llhls"], // llhls and webrtc are permitted,
  ephemeral: true, // set your rooms to ephemeral if they're single-use
});
```

## Deleting a Room

Please note that this will cause the ingest server to terminate your connection.
This will also trigger the "CLOSED\_REMOTELY" connection state on the frontend
clients.

```ts theme={null}
// delete by ID const id = "pipe_room_xxx"; const room =
await hop.pipe.rooms.delete(id);
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.