Skip to content

Live Streaming API

Overview

The Live Streaming API provides comprehensive functionality for creating and managing live streaming sessions with two main interaction methods:

  • REST APIs: Managing data and long-running operations (create streams, recordings, transcripts)
  • Realtime APIs (WebSocket): Live events during streaming (viewer joins, chat messages, captions)

Base URL: https://prod.altegon.com

Product Packages

Essential: Create/join streams, audio/video streaming, chat/emoticons, basic recording

Professional: Builds on Essential with AI features like noise suppression, live stream summaries, advanced analytics

Key Concepts

  • Streaming: Container where broadcaster and viewers connect for audio/video exchange
  • Viewer: Connected user to the stream
  • Track: Audio or video stream from a broadcaster
  • SDK/Client: JavaScript helper library for REST + realtime APIs
  1. Create stream → get unique streamId
  2. Enable real-time transcription if needed
  3. Generate broadcaster access token
  4. Initialize broadcaster's video/audio
  5. Start MediaRecorder and stream via WebSocket
  6. Connect chat and transcript sockets
  7. Share viewer link with streamId and token
  8. Viewer joins using HLS link
  9. Initialize Video.js player for viewing
  10. Connect viewers to chat and transcript
  11. Toggle features dynamically
  12. Stop and cleanup when done

REST API Endpoints

Authentication & User Management

Register User - POST /auth/register

Creates a new user account.

Field Type Required Description
email String Yes Valid user email which is not already registered
fName String Yes User's first name
lName String Yes User's last name
phoneNumber String Yes User's contact number
country String Yes User's country where he/she lives
password String Yes Password used for login purpose

Example Request:

{
    "email": "haseeb@altegon.com",
    "fName": "Haseeb",
    "lName": "Asif",
    "phoneNumber": "923085000453",
    "country": "Pakistan",
    "password": "AB1239001"
}

Response (201, 409, 401):

{
    "success": true,
    "message": "User created successfully",
    "data": {
        "user": {
            "fName": "Haseeb",
            "lName": "Asif",
            "email": "haseeb@altegon.com",
            "_id": "68afea5f8ed95fae8f7f6d86"
        }
    }
}

User Login - POST /auth/login

Authenticates a user and returns an access token.

Field Type Required Description
userName String Yes Valid user email
password String Yes Password that was entered on registration

Example Request:

{
    "userName": "haseeb@altegon.com",
    "password": "AB1239001"
}

Response (200, 401):

{
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Room Management

Create Room - POST /room/create

Creates a new virtual room for hosting meetings or conferences.

Field Type Required Description
name String Yes Room name
type String Yes Room type (e.g., "meeting", "conference")
maxParticipants Number No Maximum number of participants
isPrivate Boolean No Whether the room is private

Example Request:

{
  "name": "Haseeb Asif",
  "p2p": true,
  "type": "conference"
}

Response

{
  "success": true,
  "data": {
    "id": "68aff60d0d7bbb02c917906d",
    "name": "Haseeb Asif",
    "type": "conference",
    "p2p": true
  },
  "msg": "Room created Successfully!"
}

Meeting Management

Create Meeting - POST /meetings/create

Creates a new meeting with a title, host, and transcript settings.

Field Type Required Description
title String Yes Meeting title
hostId String Yes User ID
transcriptEnabled Boolean Yes Transcript enabled or not

Example Request:

{ 
    "title": "My Meeting", 
    "hostId": "67da6b256a7ab89c58666496", 
    "transcriptEnabled": false 
} 

Response (201, 500):

{ 
"meetingId": "68aff60da51d6c83a24245a2" 
} 

Update Meeting - POST /meetings/update/:meetingId

Updates meeting details such as title, transcript, summary generation, and recording information.

Field Type Required Description
userId String Yes User unqiue ID
roomId String No Room ID of meeting room
recordingId String No Recording ID
title String No Title of meeting
summaryGenerated Boolean No Summary generation enabled
transcriptEnabled Boolean No Transcription enabled

Example Request:

{ 
    "title": "Test Meeting", 
    "transcriptEnabled": false, 
    "summaryGenerated": false, 
    "roomId": "68aff60da51d6c83a24245a2", 
    "recordingId": "1737978989992_59591", 
}

Response (204, 404, 500)

Get Meeting - GET /meetings/list/:userId

Retrieves the list of meetings created by a specific user.

Field Type Required Description
userId String Yes User unqiue ID

Response (200, 500):

{
    "data" : {
        "createdAt" : "2025-10-14T13:08:09.559Z",
        "hostId" : "68de7a9d8f40ff41c940c7fb",
        "recordingIds" : [],
        "summaryGenerated" : false,
        "title" : "dsa",
        "transcriptEnabled" : false,
        "_id": "68ee4b39b22d6134386fc5dc"
    }
}

Recording Controls

Start Recording - POST /recording/start

Initiates recording for a specific room and stream with defined recording details.

Field Name Type Mandatory Description
roomId String Yes Room ID where recording.
userName String Yes Username who requested recording.
streamId String Yes Stream ID.
recordingId String Yes Recording ID.
startTime Date Yes Recording start time.
videoType String Yes Video type.
status String Yes Recording status.

Example Request:

{ 
    "roomId": "68affe24fabc0702c5d30c29", 
    "userName": "Haseeb Asif", 
    "streamId": 755961800257348400, 
    "recordingId": "1756364334628_738386", 
    "startTime": 1756364334634, 
    "videoType": "video", 
    "status": "pending" 
}

Response (201, 500)

Stop Recording - POST /recording/stop

Stops the ongoing recording and saves the recording end time.

Field Name Type Mandatory Description
recordingId String Yes Recording ID to be stopped.
streamId String Yes Stream ID.
endTime Date Yes End time when you ended the recording.

Example Request:

{ 
    " endTime": 1756364334634 
} 

Response (204, 404, 500)

Get Recordings - GET /recordings/list

Retrieves a list of all recorded sessions with their details.

Example Request:

GET /recordings/list

Response (200, 500):

    [
        {
            "_id": "670bc2ab12f5b0e6f7a4e9d4",
            "roomId": "68affe24fabc0702c5d30c29",
            "recordingId": "1756364334628_738386",
            "hostName": "Haseeb Asif",
            "status": true,
            "createdAt": "2025-10-13T10:15:30.000Z",
            "updatedAt": "2025-10-13T10:20:00.000Z"
        }
    ]

Transcription

Get Speech Token - GET /api/get-speech-token

Generates speech token for transcripiton using Azure AI foundry model.

Response:

{ 
    "token": 
"eyJhbGciOiJFUzI1NiIsImtpZCI6ImtleTEiLCJ0eXAiOiJKV1QifQ.eyJyZWdpb24iOiJlYXN0dXMyIiwic3Vic2NyaXB0aW9uL
 WlkIjoiZGQzMzZkZTFjN2M4NDk3MTgyZjQ4MTQ1YzZkYzM3MTciLCJwcm9kdWN0LWlkIjoiQUlTZXJ2aWNlcy5TMCIsI
 mNvZ25pdGl2ZS1zZXJ2aWNlcy1lbmRwb2ludCI6Imh0dHBzOi8vYXBpLmNvZ25pdGl2ZS5taWNyb3NvZnQuY29tL2lu
 dGVybmFsL3YxLjAvIiwiYXp1cmUtcmVzb3VyY2UtaWQiOiIvc3Vic2NyaXB0aW9ucy8wYzUxMWU0My0xNWNmLTRj
 ODMtOWE1ZS05MTY3NmE0NjFmMGUvcmVzb3VyY2VHcm91cHMvcmctc2hhaG5hd2F6LTI1NTVfYWkvcHJvdmlkZ
 XJzL01pY3Jvc29mdC5Db2duaXRpdmVTZXJ2aWNlcy9hY2NvdW50cy9haS1zaGFobmF3YXo4NzI5YWk1NTU2NDUw
 OTQ4NzEiLCJzY29wZSI6WyJzcGVlY2hzZXJ2aWNlcyIsInZpc2lvbiIsImh0dHBzOi8vYXBpLm1pY3Jvc29mdHRyYW5zbGF
 0b3IuY29tLyJdLCJhdWQiOlsidXJuOm1zLnNwZWVjaCIsInVybjptcy5zcGVlY2hzZXJ2aWNlcy5lYXN0dXMyIiwidXJuOm1
 zLnZpc2lvbi5lYXN0dXMyIiwidXJuOm1zLm1pY3Jvc29mdHRyYW5zbGF0b3IiXSwiZXhwIjoxNzU4MjgyNjM5LCJpc3Mi
 OiJ1cm46bXMuY29nbml0aXZlc2VydmljZXMifQ.byrrHOyz6gvykiqylXh2A7A79rlmmQBrgpnGZSsJZR9qJjRgLfFO1QzR
 MTyMOz3pwXyAMk0D682SPS3_gdL8PA", 
    "region": "eastus2" 
}

Send Transcript - POST /send-transcript

Stores a transcript message for a specific meeting.

Field Type Required Description
meetingId String Yes ID of the meeting
userName String Yes Name of the user sending the message
message String Yes Transcript message

Example Request:

{
    "meetingId": "68cd413466eab302c9f078cd",
    "userName": "Haseeb Stats",
    "message": "Hello."
}

Response (201, 500)

View Transcript - GET /view-transcript/:meetingId

Retrieves the entire transcript history for a specific meeting.

Parameter Type Required Description
meetingId String Yes ID of the meeting

Response:

{
    "data": [
        {
            "_id": "670b88775cba2f7de6f739d0",
            "meetingId": "68cd413466eab302c9f078cd",
            "userName": "Haseeb Stats",
            "message": "Hello.",
            "createdAt": "2025-10-13T12:20:30.000Z"
        }
    ]
}

Generate Transcript Summary - POST /transcription/generate-summary/:meetingId

Generates a summary of the transcript for a specific meeting.

Parameter Type Required Description
meetingId String Yes ID of the meeting

Response (200, 404, 500):

{
    "msg": "Summary Generated Successfully."
}

Get Transcript Summary - GET /meeting/:meetingId/summary

Retrieves the generated summary of a meeting.

Parameter Type Required Description
meetingId String Yes ID of the meeting

Response (200, 404, 500):

{
    "summary": "The participants discussed the upcoming product release, assigned tasks, and confirmed the timeline for testing."
}

Dashboard Analytics

Get Total Sessions - GET /reporting/total-sessions-for-user

Returns the total number of completed sessions based on filters.

Query Parameter Type Required Description
domain String No Domain name to filter sessions
sessionType String No Type of session
countryCode String No Country code
countryName String No Country name
cityName String No City name
startDateRange Date No Start date for filtering sessions
endDateRange Date No End date for filtering sessions
userID String No User ID of the host

Example Response:

GET /reporting/total-sessions-for-user?startDateRange=2025-10-01T00:00:00.000Z&endDateRange=2025-10-31T23:59:59.999Z&sessionType=&userID=68de7a9d8f40ff41c940c7fb

Response:

{
  "success": true,
  "data": 35
}

Get Total Sessions Aggregation - GET /reporting/total-sessions-aggregation-for-user

Returns total session counts grouped by domain and date.

Query Parameter Type Required Description
domain String No Domain name to filter sessions
sessionType String No Type of session
countryCode String No Country code
countryName String No Country name
cityName String No City name
startDateRange Date No Start date for filtering sessions
endDateRange Date No End date for filtering sessions
userID String No User ID of the host

Example Request:

GET /reporting/total-sessions-aggregation-for-user?sessionType=&userID=68de7a9d8f40ff41c940c7fb&startDateRange=2025-10-12T00%3A00%3A00.000Z&endDateRange=2025-10-18T23%3A59%3A59.999Z

Response:

{
  "success": true,
  "data": [
    {
      "domainCounts": [
        {
          "domain": "altegon.com",
          "count": 5
        }
      ],
      "date": "2025-10-12T00:00:00.000Z",
    }
  ]
}

Get Total Sessions Statistics - GET /reporting/total-sessions-statistics-for-user

Provides total number of sessions and sessions grouped by session type.

Query Parameter Type Required Description
domain String No Domain name to filter sessions
sessionType String No Type of session
countryCode String No Country code
countryName String No Country name
cityName String No City name
startDateRange Date No Start date for filtering sessions
endDateRange Date No End date for filtering sessions
userID String No User ID of the host

Example Request:

GET /reporting/total-sessions-statistics-for-user?startDateRange=2025-10-01T00:00:00.000Z&endDateRange=2025-10-31T23:59:59.999Z&sessionType=&userID=68de7a9d8f40ff41c940c7fb

Response:

{
  "success": true,
  "data": {
    "totalSessions": 35,
    "totalSessionsByType": [
      {
        "sessionType": "live",
        "totalSessions": 15
      }
      {
        "sessionType": "webinar",
        "totalSessions": 20
      },
      {
        "sessionType": "conference",
        "totalSessions": 15
      }
    ]
  }
}

Get Total Sessions By Location - GET /reporting/total-sessions-by-location-for-user

Returns total number of sessions grouped by city, region, and country.

Query Parameter Type Required Description
domain String No Domain name to filter sessions
sessionType String No Type of session
countryCode String No Country code
countryName String No Country name
cityName String No City name
startDateRange Date No Start date for filtering sessions
endDateRange Date No End date for filtering sessions
userID String No User ID of the host

Example Request:

GET /reporting/total-sessions-by-location-for-user?startDateRange=2025-10-01T00:00:00.000Z&endDateRange=2025-10-31T23:59:59.999Z&sessionType=&userID=68de7a9d8f40ff41c940c7fb

Response:

{
  "success": true,
  "data": [
    {
      "_id": {
        "city": "Lahore",
        "region": "Punjab",
        "country": "PK",
        "country_name": "Pakistan"
      },
      "count": 12
    },
    {
      "_id": {
        "city": "Karachi",
        "region": "Sindh",
        "country": "PK",
        "country_name": "Pakistan"
      },
      "count": 8
    }
  ]
}

Get Total Sessions and Participants Count By Location - GET /reporting/total-sessions-and-participants-count-by-location-for-user

Returns total sessions and total participants count grouped by city.

Query Parameter Type Required Description
domain String No Domain name to filter sessions
sessionType String No Type of session
countryCode String No Country code
countryName String No Country name
cityName String No City name
startDateRange Date No Start date for filtering sessions
endDateRange Date No End date for filtering sessions
userID String No User ID of the host

Example Request:

GET /reporting/total-sessions-and-participants-count-by-location-for-user?startDateRange=2025-10-01T00:00:00.000Z&endDateRange=2025-10-31T23:59:59.999Z&sessionType=&userID=68de7a9d8f40ff41c940c7fb

Response:

{
  "success": true,
  "data": [
    {
      "_id": "Lahore",
      "totalSessions": 10,
      "totalParticipants": 125
    },
    {
      "_id": "Karachi",
      "totalSessions": 6,
      "totalParticipants": 89
    }
  ]
}

Authentication Headers

All protected endpoints require:

Content-Type: application/json
Authorization: Bearer <your-access-token>

Error Handling

The API uses standard HTTP status codes:

200 - Success | 201 - Created | 204 - No Content | 400 - Bad Request | 401 - Unauthorized | 403 - Forbidden | 404 - Not Found | 409 - Conflict | 500 - Internal Server Error

WebSocket Events

Overview

This section describes all the WebSocket events exchanged between Client ↔ Server,and their expected payloads.

HLS Server socket:

Base URL: wss://stream.altegon.com/socket.io

Events

startStream

Description: Initializes a new stream. The server generates a streamId, creates the HLS directory, and starts an FFmpeg process to handle the stream.

Request Payload:

{
  "title": "My Live Stream",
  "mimeType": "video/webm;codecs=vp8"
}

Response Payload (Callback):
```json
{
  "streamId": "550e8400-e29b-41d4-a716-446655440000"
}
videoBlob

Description: Sends live video data chunks (blobs) from the client to the server for the specified stream. These are piped into FFmpeg’s stdin for processing.

Payload:

{
  "streamId": "550e8400-e29b-41d4-a716-446655440000",
  "data": "<binary array buffer>"
}
endStream

Description: Ends the stream gracefully, stops FFmpeg, deletes temporary files, and notifies all clients.

Request Payload:

{
  "streamId": "550e8400-e29b-41d4-a716-446655440000"
}

Broadcast Payload (Server → All):

{
  "streamId": "550e8400-e29b-41d4-a716-446655440000"
}
getStreams

Description: Returns the list of currently available streams with their titles and active status.

Response Payload (Callback):

[
  {
    "streamId": "550e8400-e29b-41d4-a716-446655440000",
    "title": "My Live Stream",
    "active": true
  },
  {
    "streamId": "330e8400-e29b-41d4-a716-446655440099",
    "title": "Second Stream",
    "active": false
  }
]

Altegon Meet APIs socket:

Base URL: wss://prod.altegon.com/socket.io

Events

room.join

Description: Joins a user to a session room (v1.0 logic).

Payload

{
  "roomId": "abc123",
  "sessionType": "viewer",
  "ip": "192.168.0.100"
}
room.join.new

Description: Joins a user to a meeting (v2 logic). Handles host/viewer identification and emits updated viewer list.

Payload

{
  "meetingID": "meeting-123",
  "deviceID": "device-456",
  "isHost": false
}

Server Broadcast

{
  "event": "viewerList",
  "data": ["device-456", "device-789"]
}
chat.send-message

Description: Sends a chat message to everyone in the meeting.

Payload

{
  "message": "Hello everyone!"
}

Server Broadcast (chat.new-message)

{
  "sender": "device-456",
  "meetingID": "meeting-123",
  "message": "Hello everyone!",
  "isHost": false
}
transcript.send

Description: Sends transcript message.

Payload

{
  "message": "This is transcript text.",
  "username": "John",
  "timestamp": 1692345678,
  "streamstart": 1692345600
}

Server Broadcast (transcript.new)

{
  "sender": "device-456",
  "meetingID": "meeting-123",
  "username": "John",
  "message": "This is transcript text.",
  "isHost": false,
  "timestamp": 1692345678,
  "streamstart": 1692345600
}

Recording Server Socket:

Base URL: wss://prod.altegon.com:3304/socket.io

Events

create-file

Description: Starts creating a recording file on server for a specific video track.

Payload

{
  "roomId": "room-1",
  "recordingId": "rec-101",
  "videoId": "cam-1"
}
stream

Description: Streams binary video chunks to the server.

Payload:

{
"data":{Binary video chunk},
"videoId":"VideoId"
}
process-recording

Description: Trigger final recording processing (scale + concat video).

Payload

{
  "roomId": "room-1",
  "recordingId": "rec-101"
}
stop-writing

Description: Stop writing stream for a specific video ID and finalize file.

Payload

{
"cam-1"
}

Support & Contact

For technical implementation assistance, troubleshooting, or additional architecture details, please contact our support team.