# Create a Video Conference POST https://%7Byour_space_name%7D.signalwire.com/api/video/conferences Content-Type: application/json Create a Video Conference. #### 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/video/conferences/create-video-conference ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: video version: 1.0.0 paths: /conferences: post: operationId: create-video-conference summary: Create a Video Conference description: >- Create a Video Conference. #### 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_conferences parameters: - 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: Conference response wrapper. content: application/json: schema: $ref: '#/components/schemas/Conference' '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' '422': description: The request contains invalid parameters. See errors for details. content: application/json: schema: $ref: '#/components/schemas/VideoStatusCode422' '500': description: An internal server error occurred. content: application/json: schema: $ref: '#/components/schemas/Types.StatusCodes.StatusCode500' requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateConferenceRequest' servers: - url: https://%7Byour_space_name%7D.signalwire.com/api/video components: schemas: VideoQuality: type: string enum: - 720p - 1080p description: Video quality resolution. title: VideoQuality VideoLayout: type: string enum: - grid-responsive - grid-responsive-mobile - highlight-1-responsive - 1x1 - 2x1 - 2x2 - 5up - 3x3 - 4x4 - 5x5 - 6x6 - 8x8 - 10x10 description: Video room layout options. title: VideoLayout ConferenceSize: type: string enum: - small - medium - large description: Conference size options. title: ConferenceSize CreateConferenceRequest: type: object properties: name: type: string description: >- A named unique identifier for the conference. Allowed characters: `A-Za-z0-9_-`. Maximum of 100 characters. display_name: type: string description: Display name of the video conference. Maximum of 200 characters. description: type: string description: Description of the conference. Maximum of 3000 characters. join_from: type: string format: date-time description: >- Conference does not accept new participants before this time. Expects RFC 3339 datetime: `2022-01-01T23:59:60Z`. Date only: `2022-01-01` will be converted to `2022-01-01T00:00:00Z`. join_until: type: string format: date-time description: >- Conference stops accepting new participants at this time, but keeps running until all participants leave. Expects RFC 3339 datetime: `2022-01-01T23:59:60Z`. Date only: `2022-01-01` will be converted to `2022-01-01T00:00:00Z`. quality: $ref: '#/components/schemas/VideoQuality' description: The conference's resolution. layout: $ref: '#/components/schemas/VideoLayout' description: The conference's initial layout. size: $ref: '#/components/schemas/ConferenceSize' description: The size of the video conference. record_on_start: type: boolean description: Whether to start recording when a conference session begins. enable_room_previews: type: boolean description: Whether a preview video of the conference content is generated. enable_chat: type: boolean default: true description: Whether group chat is enabled for conference participants. dark_primary: type: string default: '#044EF4' description: CTA buttons and selected items color (dark theme). dark_background: type: string default: '#FFFFFF' description: Main background color (dark theme). dark_foreground: type: string default: '#1D2127' description: Main foreground color (dark theme). dark_success: type: string default: '#17BB58' description: Success indication color (dark theme). dark_negative: type: string default: '#F42C50' description: Error indication color (dark theme). light_primary: type: string default: '#044EF4' description: CTA buttons and selected items color (light theme). light_background: type: string default: '#FFFFFF' description: Main background color (light theme). light_foreground: type: string default: '#1D2127' description: Main foreground color (light theme). light_success: type: string default: '#17BB58' description: Success indication color (light theme). light_negative: type: string default: '#F42C50' description: Error indication color (light theme). required: - display_name description: Request body for creating a conference. title: CreateConferenceRequest ConferenceMeta: type: object properties: {} description: User-defined metadata for the conference. title: ConferenceMeta VideoFps: type: string enum: - '20' - '30' description: Video frames per second. title: VideoFps RoomSessionStatus: type: string enum: - in-progress - completed description: Status of a room session. title: RoomSessionStatus 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/VideoFps' description: The Room Session's frames per second. quality: $ref: '#/components/schemas/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/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: ActiveSession Conference: type: object properties: id: type: string format: uuid description: Unique ID of the video conference. name: type: string description: >- A named unique identifier for the conference. Allowed characters: `A-Za-z0-9_-`. display_name: type: - string - 'null' description: Display name of the video conference. Maximum of 200 characters. description: type: - string - 'null' description: Description of the conference. Maximum of 3000 characters. join_from: type: - string - 'null' format: date-time description: Conference does not accept new participants before this time. join_until: type: - string - 'null' format: date-time description: >- Conference stops accepting new participants at this time, but keeps running until all participants leave. quality: $ref: '#/components/schemas/VideoQuality' description: The conference's resolution. layout: $ref: '#/components/schemas/VideoLayout' description: The conference's initial layout. size: oneOf: - $ref: '#/components/schemas/ConferenceSize' - type: 'null' description: The size of the video conference. record_on_start: type: boolean description: Whether to start recording when a conference session begins. tone_on_entry_and_exit: type: boolean description: >- Whether a tone is played when a member enters or exits the conference. user_join_video_off: type: boolean description: Whether participants join with video off by user setting. room_join_video_off: type: boolean description: Whether participants join with video off by room setting. enable_chat: type: boolean description: Whether group chat is enabled for conference participants. enable_room_previews: type: - boolean - 'null' description: Whether a preview video of the conference content is generated. dark_primary: type: - string - 'null' description: CTA buttons and selected items color (dark theme). dark_background: type: - string - 'null' description: Main background color (dark theme). dark_foreground: type: - string - 'null' description: Main foreground color (dark theme). dark_success: type: - string - 'null' description: Success indication color (dark theme). dark_negative: type: - string - 'null' description: Error indication color (dark theme). light_primary: type: - string - 'null' description: CTA buttons and selected items color (light theme). light_background: type: - string - 'null' description: Main background color (light theme). light_foreground: type: - string - 'null' description: Main foreground color (light theme). light_success: type: - string - 'null' description: Success indication color (light theme). light_negative: type: - string - 'null' description: Error indication color (light theme). meta: oneOf: - $ref: '#/components/schemas/ConferenceMeta' - type: 'null' description: User-defined metadata for the conference. created_at: type: string format: date-time description: Timestamp when the conference was created. updated_at: type: string format: date-time description: Timestamp when the conference was last updated. active_session: $ref: '#/components/schemas/ActiveSession' description: >- Active session information. Only present when requested via the `include_active_session` query parameter. required: - id - name - display_name - description - join_from - join_until - quality - layout - size - record_on_start - tone_on_entry_and_exit - user_join_video_off - room_join_video_off - enable_chat - enable_room_previews - dark_primary - dark_background - dark_foreground - dark_success - dark_negative - light_primary - light_background - light_foreground - light_success - light_negative - meta - created_at - updated_at description: Video conference response object. title: Conference 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 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 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: 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 url = "https://{your_space_name}.signalwire.com/api/video/conferences" payload = { "display_name": "My Conference's Name" } headers = { "Authorization": "Basic :", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://{your_space_name}.signalwire.com/api/video/conferences'; const options = { method: 'POST', headers: { Authorization: 'Basic :', 'Content-Type': 'application/json' }, body: '{"display_name":"My Conference\'s Name"}' }; 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" "strings" "net/http" "io" ) func main() { url := "https://{your_space_name}.signalwire.com/api/video/conferences" payload := strings.NewReader("{\n \"display_name\": \"My Conference's Name\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Basic :") req.Header.Add("Content-Type", "application/json") 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/conferences") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Basic :' request["Content-Type"] = 'application/json' request.body = "{\n \"display_name\": \"My Conference's Name\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://{your_space_name}.signalwire.com/api/video/conferences") .header("Authorization", "Basic :") .header("Content-Type", "application/json") .body("{\n \"display_name\": \"My Conference's Name\"\n}") .asString(); ``` ```php request('POST', 'https://{your_space_name}.signalwire.com/api/video/conferences', [ 'body' => '{ "display_name": "My Conference\'s Name" }', 'headers' => [ 'Authorization' => 'Basic :', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://{your_space_name}.signalwire.com/api/video/conferences"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Basic :"); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"display_name\": \"My Conference's Name\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Basic :", "Content-Type": "application/json" ] let parameters = ["display_name": "My Conference's Name"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://{your_space_name}.signalwire.com/api/video/conferences")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data 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() ```