# Get room by name

GET https://%7BYour_Space_Name%7D.signalwire.com/api/video/rooms/{name}

Find a room by name.

#### 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/rooms/get-room-by-name

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: signalwire-rest
  version: 1.0.0
paths:
  /api/video/rooms/{name}:
    get:
      operationId: get-room-by-name
      summary: Get room by name
      description: >-
        Find a room by name.


        #### 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).
      tags:
        - subpackage_rooms
      parameters:
        - name: name
          in: path
          description: Unique name of the room.
          required: true
          schema:
            type: string
        - name: include_active_session
          in: query
          description: >-
            Specifies whether or not to include information about the room's
            active session (if any).
          required: false
          schema:
            type: boolean
        - name: Authorization
          in: header
          description: >-
            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)

            ```
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Video.RoomResponse'
        '400':
          description: The request is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode400'
        '401':
          description: Access is unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
        '404':
          description: The server cannot find the requested resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode404'
        '422':
          description: The request contains invalid parameters. See errors for details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Video.VideoStatusCode422'
        '500':
          description: An internal server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Types.StatusCodes.StatusCode500'
servers:
  - url: https://%7BYour_Space_Name%7D.signalwire.com
components:
  schemas:
    Video.VideoQuality:
      type: string
      enum:
        - 720p
        - 1080p
      description: Video quality resolution.
      title: Video.VideoQuality
    Video.RoomLayout:
      type: string
      enum:
        - grid-responsive
        - grid-responsive-mobile
        - highlight-1-responsive
        - 1x1
        - 2x1
        - 2x2
        - 5up
        - 3x3
        - 4x4
        - 5x5
        - 6x6
        - 8x8
        - 10x10
      description: The room's layout.
      title: Video.RoomLayout
    VideoRoomResponseMeta:
      type: object
      properties: {}
      description: User-defined metadata for the room.
      title: VideoRoomResponseMeta
    Video.VideoFps:
      type: string
      enum:
        - '20'
        - '30'
      description: Video frames per second.
      title: Video.VideoFps
    Video.RoomSessionStatus:
      type: string
      enum:
        - in-progress
        - completed
      description: Status of a room session.
      title: Video.RoomSessionStatus
    Video.ActiveSession:
      type: object
      properties:
        id:
          type: string
          description: Unique ID of the session.
        room_id:
          type: string
          description: >-
            Unique ID of the Room if the Session was created from a Room and was
            not an auto-created Session.
        name:
          type: string
          description: The named identifier of room session.
        display_name:
          type: string
          description: >-
            Display name of room, no character limitations. Maximum of 200
            characters. Defaults to the value of name.
        join_from:
          type: string
          format: date-time
          description: Room Session does not accept new Members before this time.
        join_until:
          type: string
          format: date-time
          description: Room Session stops accepting new Members at this time.
        remove_at:
          type: string
          format: date-time
          description: Remove Members from the Room Session at this time.
        remove_after_seconds_elapsed:
          type: integer
          description: Remove Members after they are in the Room Session for N seconds.
        layout:
          type: string
          description: >-
            The Room Session's initial layout. See documentation for a full list
            of supported layouts.
        max_members:
          type: integer
          description: The maximum number of members allowed in the room at a time.
        fps:
          $ref: '#/components/schemas/Video.VideoFps'
          description: The Room Session's frames per second.
        quality:
          $ref: '#/components/schemas/Video.VideoQuality'
          description: The Room Session's resolution.
        start_time:
          type: string
          format: date-time
          description: Start time of the session.
        end_time:
          type: string
          format: date-time
          description: End time of the session.
        duration:
          type: integer
          description: How long, in seconds, the Room Session lasted.
        status:
          $ref: '#/components/schemas/Video.RoomSessionStatus'
          description: Status of the session.
        record_on_start:
          type: boolean
          description: >-
            Whether a recording was automatically started when this Room Session
            began.
        enable_room_previews:
          type: boolean
          description: >-
            Whether a video with a preview of the content of the room is to be
            generated.
        preview_url:
          type: string
          description: >-
            If room previews are enabled and the room session is in progress,
            this is the URL of the preview video.
        audio_video_sync:
          type: boolean
          description: Enable/disable jitter buffer audio-video sync.
      description: Active session information for a room.
      title: Video.ActiveSession
    Video.RoomResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: A unique identifier for the room.
        name:
          type: string
          description: A named unique identifier for the room.
        display_name:
          type:
            - string
            - 'null'
          description: Display name of the room.
        description:
          type:
            - string
            - 'null'
          description: Description of the room.
        max_members:
          type: integer
          description: The maximum number of members in the room at a time.
        quality:
          $ref: '#/components/schemas/Video.VideoQuality'
          description: The room's resolution.
        fps:
          type: integer
          description: Frames per second parameter of room video quality.
        join_from:
          type:
            - string
            - 'null'
          format: date-time
          description: Room does not accept new participants before this time.
        join_until:
          type:
            - string
            - 'null'
          format: date-time
          description: Room stops accepting new participants at this time.
        remove_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Remove users from the room at this time.
        remove_after_seconds_elapsed:
          type:
            - integer
            - 'null'
          description: Remove users after they are in the room for N seconds.
        layout:
          $ref: '#/components/schemas/Video.RoomLayout'
          description: The room's initial layout.
        record_on_start:
          type: boolean
          description: >-
            Specifies whether to start recording a Room Session when one is
            started for this Room.
        tone_on_entry_and_exit:
          type: boolean
          description: Whether a tone is played when participants enter or exit the room.
        room_join_video_off:
          type: boolean
          description: Whether the room's video is turned off when participants join.
        user_join_video_off:
          type: boolean
          description: Whether a user's video is turned off when they join the room.
        enable_room_previews:
          type:
            - boolean
            - 'null'
          description: >-
            Whether a video with a preview of the content of the room is to be
            generated.
        sync_audio_video:
          type:
            - boolean
            - 'null'
          description: Enable/disable jitter buffer audio-video sync.
        meta:
          oneOf:
            - $ref: '#/components/schemas/VideoRoomResponseMeta'
            - type: 'null'
          description: User-defined metadata for the room.
        prioritize_handraise:
          type: boolean
          description: Whether hand raises are prioritized in the room layout.
        active_session:
          $ref: '#/components/schemas/Video.ActiveSession'
          description: Active session information for the room.
        created_at:
          type: string
          format: date-time
          description: Timestamp when the room was created.
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the room was last updated.
      required:
        - id
        - name
        - display_name
        - description
        - max_members
        - quality
        - fps
        - join_from
        - join_until
        - remove_at
        - remove_after_seconds_elapsed
        - layout
        - record_on_start
        - tone_on_entry_and_exit
        - room_join_video_off
        - user_join_video_off
        - enable_room_previews
        - sync_audio_video
        - meta
        - prioritize_handraise
        - created_at
        - updated_at
      description: Room response object.
      title: Video.RoomResponse
    TypesStatusCodesStatusCode400Error:
      type: string
      enum:
        - Bad Request
      title: TypesStatusCodesStatusCode400Error
    Types.StatusCodes.StatusCode400:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode400Error'
      required:
        - error
      description: The request is invalid.
      title: Types.StatusCodes.StatusCode400
    TypesStatusCodesStatusCode401Error:
      type: string
      enum:
        - Unauthorized
      title: TypesStatusCodesStatusCode401Error
    Types.StatusCodes.StatusCode401:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode401Error'
      required:
        - error
      description: Access is unauthorized.
      title: Types.StatusCodes.StatusCode401
    TypesStatusCodesStatusCode404Error:
      type: string
      enum:
        - Not Found
      title: TypesStatusCodesStatusCode404Error
    Types.StatusCodes.StatusCode404:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode404Error'
      required:
        - error
      description: The server cannot find the requested resource.
      title: Types.StatusCodes.StatusCode404
    Types.StatusCodes.RestApiErrorItem:
      type: object
      properties:
        type:
          type: string
          description: The category of error.
        code:
          type: string
          description: A specific error code.
        message:
          type: string
          description: A description of what caused the error.
        attribute:
          type:
            - string
            - 'null'
          description: The request parameter that caused the error, if applicable.
        url:
          type: string
          description: A link to documentation about this error.
      required:
        - type
        - code
        - message
        - url
      description: Details about a specific error.
      title: Types.StatusCodes.RestApiErrorItem
    Video.VideoStatusCode422:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Types.StatusCodes.RestApiErrorItem'
          description: List of validation errors.
      required:
        - errors
      description: The request contains invalid parameters. See errors for details.
      title: Video.VideoStatusCode422
    TypesStatusCodesStatusCode500Error:
      type: string
      enum:
        - Internal Server Error
      title: TypesStatusCodesStatusCode500Error
    Types.StatusCodes.StatusCode500:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/TypesStatusCodesStatusCode500Error'
      required:
        - error
      description: An internal server error occurred.
      title: Types.StatusCodes.StatusCode500
  securitySchemes:
    SignalWireBasicAuth:
      type: http
      scheme: basic
      description: >-
        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)

        ```

```

## SDK Code Examples

```python
import requests
import base64

url = "https://{your_space_name}.signalwire.com/api/video/rooms/name"

credentials = base64.b64encode(f"<project_id>:<api_token>".encode()).decode()

headers = {"Authorization": f"Basic {credentials}"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://{your_space_name}.signalwire.com/api/video/rooms/name';
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/rooms/name"

	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 'base64'
require 'net/http'

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

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Basic #{Base64.strict_encode64("<project_id>:<api_token>")}"

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

```java
import java.util.Base64;
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/rooms/name")
  .header("Authorization", "Basic " + Base64.getEncoder().encodeToString("<project_id>:<api_token>".getBytes()))
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://{your_space_name}.signalwire.com/api/video/rooms/name', [
  'headers' => [
    'Authorization' => 'Basic ' . base64_encode('<project_id>:<api_token>'),
  ],
]);

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

```csharp
using RestSharp;
using System;
using System.Text;

var client = new RestClient("https://{your_space_name}.signalwire.com/api/video/rooms/name");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes("<project_id>:<api_token>")));
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/rooms/name")! 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()
```