> This page is for APIs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# Get room session

GET https://%7BYour_Space_Name%7D.signalwire.com/api/video/room_sessions/{id}

Retrieves one past or in-progress Room Session by ID. Use it to inspect the session associated with an event, member, or recording; use [Get room](/docs/apis/rest/video/rooms/get-room) when you need the reusable room configuration rather than an occurrence of activity.

#### Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: _Video_.

[Learn more about API scopes](/docs/platform/your-signalwire-api-space).

Reference: https://signalwire.com/docs/apis/rest/video/room-sessions/get-room-session

## Authentication

- `Authorization` header (basic auth, required) — SignalWire Basic Authentication using Project ID and API Token. The client sends HTTP requests with the Authorization header containing the word Basic followed by a space and a base64-encoded string of project_id:token. The project ID will be used as the username and the API token as the password. Example: ``` Authorization: Basic base64(project_id:token) ```

## Request

### Path parameters

- `id` (string, required) — Unique ID of the Room Session.

## Response

### 200

Room session response.

- `id` (string, required) — Unique ID of the session.
- `room_id` (string, required, nullable) — Unique ID of the Room if the Session was created from a Room and was not an auto-created Session. Null if the room was set to delete on end.
- `name` (string, required, nullable) — The named identifier of the room session.
- `display_name` (string, required, nullable) — Display name of the room. Maximum of 200 characters. Defaults to the value of name.
- `max_members` (integer, required, nullable) — The maximum number of members allowed in the room at a time.
- `quality` (enum, required, nullable) — The room session's resolution.
  - Allowed values: `720p`, `1080p`
- `fps` (enum, required, nullable) — The room session's frames per second.
  - Allowed values: `20`, `30`
- `join_from` (datetime, required, nullable) — Room Session does not accept new Members before this time.
- `join_until` (datetime, required, nullable) — Room Session stops accepting new Members at this time.
- `remove_at` (datetime, required, nullable) — Remove Members from the Room Session at this time.
- `remove_after_seconds_elapsed` (integer, required, nullable) — Remove Members after they are in the Room Session for N seconds.
- `layout` (string, required, nullable) — The room session's initial layout.
- `record_on_start` (boolean, required) — Whether a recording was automatically started when this Room Session began.
- `tone_on_entry_and_exit` (boolean, required) — Whether a tone is played when a member enters or exits the room session.
- `room_join_video_off` (boolean, required) — Whether participants join with video off by room setting.
- `user_join_video_off` (boolean, required) — Whether participants join with video off by user setting.
- `locked` (boolean, required) — Whether the room session is locked.
- `start_time` (datetime, required, nullable) — Start time of the session.
- `end_time` (datetime, required, nullable) — End time of the session.
- `duration` (integer, required, nullable) — How long, in seconds, the Room Session lasted.
- `status` (enum, required, nullable) — Status of the session.
  - Allowed values: `in-progress`, `completed`
- `created_at` (datetime, required) — Timestamp when the room session was created.
- `updated_at` (datetime, required) — Timestamp when the room session was last updated.
- `preview_url` (string, required, nullable) — If room previews are enabled and the room session is in progress, this is the URL of the preview video.
- `prioritize_handraise` (boolean, required, nullable) — Whether raised hands are prioritized in the layout.
- `sync_audio_video` (boolean, required, nullable) — Enable/disable jitter buffer audio-video sync.

## Errors

### 400 Bad Request Error

The request is invalid.

- `error` (enum, required)
  - Allowed values: `Bad Request`

### 401 Unauthorized Error

Access is unauthorized.

- `error` (enum, required)
  - Allowed values: `Unauthorized`

### 404 Not Found Error

The server cannot find the requested resource.

- `error` (enum, required)
  - Allowed values: `Not Found`

### 500 Internal Server Error

An internal server error occurred.

- `error` (enum, required)
  - Allowed values: `Internal Server Error`

## Examples

**Response**

```json
{
  "id": "c22d24f6-5a47-4597-9a23-c7d01e696b92",
  "room_id": "a1b2c3d4-5e6f-7890-abcd-ef1234567890",
  "name": "my_example_room",
  "display_name": "My Room's Name",
  "max_members": 20,
  "quality": "720p",
  "fps": 20,
  "join_from": "2022-01-01T00:00:00Z",
  "join_until": "2022-12-31T23:59:59Z",
  "remove_at": "2022-12-31T23:59:59Z",
  "remove_after_seconds_elapsed": 120,
  "layout": "grid-responsive",
  "record_on_start": false,
  "tone_on_entry_and_exit": true,
  "room_join_video_off": false,
  "user_join_video_off": false,
  "locked": false,
  "start_time": "2022-01-01T10:00:00Z",
  "end_time": "2022-01-01T11:00:00Z",
  "duration": 120,
  "status": "completed",
  "created_at": "2022-01-01T10:00:00Z",
  "updated_at": "2022-01-01T11:00:00Z",
  "preview_url": "https://example.signalwire.com/preview/abc123",
  "prioritize_handraise": false,
  "sync_audio_video": true
}
```

**SDK Code**

```python
import requests

url = "https://{your_space_name}.signalwire.com/api/video/room_sessions/id"

response = requests.get(url, auth=("<project_id>", "<api_token>"))

print(response.json())
```

```javascript
const url = 'https://{your_space_name}.signalwire.com/api/video/room_sessions/id';
const credentials = btoa("<project_id>:<api_token>");

const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://{your_space_name}.signalwire.com/api/video/room_sessions/id"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<project_id>", "<api_token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://{your_space_name}.signalwire.com/api/video/room_sessions/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<project_id>", "<api_token>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://{your_space_name}.signalwire.com/api/video/room_sessions/id")
  .basicAuth("<project_id>", "<api_token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://{your_space_name}.signalwire.com/api/video/room_sessions/id', [
  'headers' => [
  ],
    'auth' => ['<project_id>', '<api_token>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://{your_space_name}.signalwire.com/api/video/room_sessions/id");
client.Authenticator = new HttpBasicAuthenticator("<project_id>", "<api_token>");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<project_id>:<api_token>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://{your_space_name}.signalwire.com/api/video/room_sessions/id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```