Skip to content
Start here

Start livestreaming a meeting

client.RealtimeKit.Livestreams.StartLivestreamingAMeeting(ctx, appID, meetingID, params) (*LivestreamStartLivestreamingAMeetingResponse, error)
POST/accounts/{account_id}/realtime/kit/{app_id}/meetings/{meeting_id}/livestreams

Starts livestream of a meeting associated with the given meeting ID. Retreive the meeting ID using the Create a meeting API.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Realtime AdminRealtime
ParametersExpand Collapse
appID string

The app identifier tag.

meetingID string
formatuuid
params LivestreamStartLivestreamingAMeetingParams
AccountID param.Field[string]

Path param: The account identifier tag.

maxLength32
Name param.Field[string]Optional

Body param

Body param

Height int64Optional

Height of the livestreaming video in pixels

Width int64Optional

Width of the livestreaming video in pixels

ReturnsExpand Collapse
type LivestreamStartLivestreamingAMeetingResponse struct{…}
Data LivestreamStartLivestreamingAMeetingResponseData
ID string

ID of the livestream.

formatuuid
IngestServer string

The server URL to which the RTMP encoder sends the video and audio data.

MeetingID string

ID of the meeting being livestreamed, if any.

Name string

Name of the livestream.

PlaybackURL string

The web address that viewers can use to watch the livestream.

Status LivestreamStartLivestreamingAMeetingResponseDataStatus

Status of the livestream.

One of the following:
const LivestreamStartLivestreamingAMeetingResponseDataStatusLive LivestreamStartLivestreamingAMeetingResponseDataStatus = "LIVE"
const LivestreamStartLivestreamingAMeetingResponseDataStatusIdle LivestreamStartLivestreamingAMeetingResponseDataStatus = "IDLE"
const LivestreamStartLivestreamingAMeetingResponseDataStatusErrored LivestreamStartLivestreamingAMeetingResponseDataStatus = "ERRORED"
const LivestreamStartLivestreamingAMeetingResponseDataStatusInvoked LivestreamStartLivestreamingAMeetingResponseDataStatus = "INVOKED"
const LivestreamStartLivestreamingAMeetingResponseDataStatusMetricsReady LivestreamStartLivestreamingAMeetingResponseDataStatus = "METRICS_READY"
StreamKey string

Unique key for accessing each livestream. Empty if the livestream is disabled.

Success bool

Start livestreaming a meeting

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/realtime_kit"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.RealtimeKit.Livestreams.StartLivestreamingAMeeting(
    context.TODO(),
    "14a396e7-ca44-4937-bf1f-050a69118543",
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    realtime_kit.LivestreamStartLivestreamingAMeetingParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
      Name: cloudflare.F("prdmmp-xhycsl"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Data)
}
{
  "data": {
    "id": "b60ef3da-fbbb-441b-9168-8235b0035248",
    "ingest_server": "rtmps://live.cloudflare.com:443/live/",
    "meeting_id": "bbb87945-df1c-49d9-8159-262a7ae6cfde",
    "name": "test",
    "playback_url": "https://customer-s8oj0c1n5ek8ah1e.cloudflarestream.com/7de6a3fec0f9c05bf1df140950d3a237/manifest/video.m3u8",
    "status": "LIVE",
    "stream_key": "f26566285faca6fbe2e79a73a66rsrrsrrsr3cde23a2bb7dbc6c2c1761b98f4e4"
  },
  "success": true
}
Returns Examples
{
  "data": {
    "id": "b60ef3da-fbbb-441b-9168-8235b0035248",
    "ingest_server": "rtmps://live.cloudflare.com:443/live/",
    "meeting_id": "bbb87945-df1c-49d9-8159-262a7ae6cfde",
    "name": "test",
    "playback_url": "https://customer-s8oj0c1n5ek8ah1e.cloudflarestream.com/7de6a3fec0f9c05bf1df140950d3a237/manifest/video.m3u8",
    "status": "LIVE",
    "stream_key": "f26566285faca6fbe2e79a73a66rsrrsrrsr3cde23a2bb7dbc6c2c1761b98f4e4"
  },
  "success": true
}