Create a Broadcaster via API
This guide walks you through the process of setting up a broadcaster using the Palabra API.
By setting up a broadcaster, you can programmatically stream live audio or video to Palabra and enable real-time translation and multilingual broadcasting for your events.
Step 1: Get API Credentials
To authenticate your API requests, you need a Client ID and Client Secret.
Visit the Palabra API Keys page to generate your credentials.
Step 2: Prepare Your Configuration
Create a JSON payload that defines your broadcast configuration.
Below is an example payload:
{
"title": "My broadcast",
"translation_settings": {}, // follow the recommended settings section
"original_delay_seconds": 3,
"original_volume": 0.2,
"inputs": [
{
"protocol": "rtmp_push"
}
],
"outputs": [
{
"protocol": "rtmp_push",
"url": "rtmp://ny.castr.io/static",
"stream_key": "live_be5e5710dff511ef98df6fdds2sx33?password=50assdkf3",
"lang_code": ["es"]
}
]
}
Step 3: Send a Request to the API
Make a POST request to https://api.palabra.ai/broadcast/live
with your configuration and credentials:
const data = { /* your broadcast config as shown in the Step 2 */ };
fetch("https://api.palabra.ai/broadcast/live", {
method: "POST",
headers: {
"Content-Type": "application/json",
"ClientId": "<YOUR_CLIENT_ID>",
"ClientSecret": "<YOUR_CLIENT_SECRET>"
},
body: JSON.stringify(data)
})
.then(response => {
if (!response.ok) {
throw new Error(`Server responded with ${response.status}`);
}
return response.json();
})
.then(result => {
console.log("Broadcast created successfully:", result);
})
.catch(error => {
console.error("Failed to create broadcast:", error);
});
Response example:
{
"ok": true,
"data": [
{
"title": "My broadcast ",
"id": "a554841e-4e71-441c-bd79-5232f0a6e534",
"instance_id": "f79976cb-d3c7-46f4-8709-41bd69d2dc04",
"utc_created_at": "2025-07-11 11:42:46.079753627 +0000 UTC",
"status": "paused",
"error_code": null,
"error_desc": null,
"input_bitrate": 0,
"user": {
"id": "a0e5263c-4782-4155-b3ae-ea0a1e694dd7"
},
"translation_settings": {}, // follow the recommended settings section
"original_delay_seconds": 3,
"original_volume": 0.2,
"fade_factor": 0.07,
"disable_synchronization": false,
"enable_echo": false,
"inputs": [
{
"protocol": "rtmp_push",
"endpoint": "rtmp://rtmp.palabra.ai:1935/live/6232ceec166cc888",
"url": "rtmp://rtmp.palabra.ai:1935/live",
"stream_key": "6232ceec166cc888"
}
],
"outputs": [
{
"protocol": "rtmp_push",
"url": "rtmp://ny.castr.io/static",
"stream_key": "live_be5e5710dff511ef98df6fdds2sx33?password=50assdkf3",
"lang_code": [
"es"
]
}
]
}
]
}
Step 4: Manage your broadcasts
After the broadcast is created, you can use the id
returned in the response to manage it further via the API.
Check ongoing broadcasts
fetch('https://api.palabra.ai/live/ongoing', {
headers: {
"ClientId": "<YOUR_CLIENT_ID>",
"ClientSecret": "<YOUR_CLIENT_SECRET>"
}
})
.then(response => response.json())
.then(result => {
console.log("Ongoing broadcasts:", result);
})
.catch(error => {
console.error("Failed to get ongoing broadcasts:", error);
});
Delete a broadcast
fetch(`https://api.palabra.ai/broadcast/live/${id}/terminate`, {
method: 'DELETE',
headers: {
"ClientId": "<YOUR_CLIENT_ID>",
"ClientSecret": "<YOUR_CLIENT_SECRET>"
}
})
.then(response => {
if (!response.ok) {
throw new Error(`Server responded with ${response.status}`);
}
console.log("Broadcast deleted successfully");
})
.catch(error => {
console.error("Failed to delete broadcast:", error);
});
Update a broadcast
const data = { /* your full broadcast config as shown in the Step 2 */ };
fetch(`https://api.palabra.ai/broadcast/live/${id}`, {
method: 'PUT',
headers: {
"Content-Type": "application/json",
"ClientId": "<YOUR_CLIENT_ID>",
"ClientSecret": "<YOUR_CLIENT_SECRET>"
},
body: JSON.stringify(data)
})
.then(response => {
if (!response.ok) {
throw new Error(`Server responded with ${response.status}`);
}
return response.json();
})
.then(result => {
console.log("Broadcast updated successfully:", result);
})
.catch(error => {
console.error("Failed to update broadcast:", error);
});