Skip to content

MiroTalk BRO REST API

MiroTalk BRO REST API documentation

The deployed BRO Swagger specification identifies itself as MiroTalk BRO API 1.0.0 using OAS 2.0. A self-hosted instance exposes the same interface at https://YOUR-DOMAIN-NAME/api/v1/docs.

Method Path Authentication Purpose
POST /join Authorization: YOUR_API_KEY_SECRET Create a direct broadcast join URL.

Protect the API secret

Replace YOUR_API_KEY_SECRET with the value configured in .env. Keep it on a trusted backend and never ship it in public browser code.


POST /join

Upon a successful request, the API response will provide a Meeting Entry Point for the direct join to the room. The authorization for this request is determined by the API_KEY_SECRET configuration specified in your .env file.

JavaScript Join example

JavaScript
"use strict";

// npm i node-fetch

try {
  // Use dynamic import with await
  const { default: fetch } = await import("node-fetch");

  const API_KEY = "YOUR_API_KEY_SECRET";
  const MIROTALK_URL = "https://bro.mirotalk.com/api/v1/join";

  const response = await fetch(MIROTALK_URL, {
    method: "POST",
    headers: {
      authorization: API_KEY,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      room: "test",
    }),
  });
  const data = await response.json();
  if (data.error) {
    console.log("Error:", data.error);
  } else {
    console.log("join:", data.join);
  }
} catch (error) {
  console.error("Error fetching data:", error);
}

PHP Join example

PHP
<?php

$API_KEY_SECRET = "YOUR_API_KEY_SECRET";
$MIROTALK_URL = "https://bro.mirotalk.com/api/v1/join";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $MIROTALK_URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);

$headers = [
    'authorization:' . $API_KEY_SECRET,
    'Content-Type: application/json'
];

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$data = array(
    "room"  => "test"
);
$data_string = json_encode($data);

curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
$response = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

echo "Status code: $httpcode \n";
$data = json_decode($response);
print_r($data);

Python Join example

Python
# pip3 install requests

import requests
import json

API_KEY_SECRET = "YOUR_API_KEY_SECRET"
MIROTALK_URL = "https://bro.mirotalk.com/api/v1/join"

headers = {
    "authorization": API_KEY_SECRET,
    "Content-Type": "application/json",
}

data = {
    "room": "test"
}

response = requests.post(
    MIROTALK_URL,
    headers=headers,
    json=data,
)

print("Status code:", response.status_code)
data = json.loads(response.text)
print("join:", data["join"])

Bash Join example

Bash
#!/bin/bash

API_KEY_SECRET="YOUR_API_KEY_SECRET"
MIROTALK_URL="https://bro.mirotalk.com/api/v1/join"

curl $MIROTALK_URL \
    --header "authorization: $API_KEY_SECRET" \
    --header "Content-Type: application/json" \
    --data '{"room":"test"}' \
    --request POST

Note

Replace bro.mirotalk.com in the code snippets with YOUR-DOMAIN-NAME.