Searching...

Live Streams

get /live-streams

List all live streams

Get the list of livestreams on the workspace.

streamKey string

The unique stream key that allows you to stream videos.

name string

You can filter live streams by their name or a part of their name.

sortBy string

Enables you to sort live stream results. Allowed attributes: name , createdAt , updatedAt . name - the name of the live stream. createdAt - the time a live stream was created. updatedAt - the time a live stream was last updated.

When using createdAt or updatedAt , the API sorts the results based on the ATOM UTC time format.

Enum
  • name
  • createdAt
  • updatedAt
sortOrder string

Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending.

Enum
  • asc
  • desc
currentPage int

Choose the number of search results to return per page. Minimum value: 1

Default
1
pageSize int

Results per page. Allowed values 1-100, default is 25.

Default
25

Responses

Success

Response body Headers
data array required
pagination object (Pagination) required
Example
{ "itemsTotal": 123, "pagesTotal": 7, "pageSize": 20, "currentPage": 3, "currentPageItems": 20, "links": { "first": { "rel": "first", "uri": "/videos/search?currentPage=1&pageSize=20" }, "previous": { "rel": "previous", "uri": "/videos/search?currentPage=2&pageSize=20" }, "next": { "rel": "next", "uri": "/videos/search?currentPage=4&pageSize=20" }, "last": { "rel": "last", "uri": "/videos/search?currentPage=6&pageSize=20" } } }
itemsTotal int

Total number of items that exist.

pagesTotal int

Number of items listed in the current page.

pageSize int

Maximum number of item per page.

currentPage int

The current page index.

currentPageItems int

The number of items on the current page.

links array required
X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Too Many Requests

Response body Headers
type string

A link to the error documentation.

title string

A description of the error that occurred.

status int

The HTTP status code.

X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Request examples

// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/LiveStreamsApi.md#list

using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
    public class getExample
    {
        public static void Main()
        {
            var basePath = ApiVideoClient.Client.Environment.SANDBOX;
            var apiKey = "YOUR_API_KEY";

            var apiInstance = new ApiVideoClient(apiKey,basePath);

            var liveStreamId = li400mYKSgQ6xs7taUeSaEKr;  // string | The unique ID for the live stream you want to watch.
            var apiLiveStreamsInstance = apiInstance.LiveStreams();
            try
            {
                // Show live stream
                LiveStream result = apiLiveStreamsInstance.get(liveStreamId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiveStreamsApi.get: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/LiveStreamsApi.md#list

package main
  
  import (
      "context"
      "fmt"
      "os"
      apivideosdk "github.com/apivideo/api.video-go-client"
  )
  
  func main() {
      client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
      // if you rather like to use the sandbox environment:
      // client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
      req := apivideosdk.LiveStreamsApiListRequest{}
      
      req.StreamKey("30087931-229e-42cf-b5f9-e91bcc1f7332") // string | The unique stream key that allows you to stream videos.
      req.Name("My Video") // string | You can filter live streams by their name or a part of their name.
      req.SortBy("createdAt") // string | Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`.
      req.SortOrder("desc") // string | Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending.
      req.CurrentPage(int32(2)) // int32 | Choose the number of search results to return per page. Minimum value: 1 (default to 1)
      req.PageSize(int32(30)) // int32 | Results per page. Allowed values 1-100, default is 25. (default to 25)
  
      res, err := client.LiveStreams.List(req)
      
  
      if err != nil {
          fmt.Fprintf(os.Stderr, "Error when calling `LiveStreams.List``: %v\
", err)
      }
      // response from `List`: LiveStreamListResponse
      fmt.Fprintf(os.Stdout, "Response from `LiveStreams.List`: %v\
", res)
  }
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/LiveStreamsApi.md#list

import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.LiveStreamsApi;
import java.util.*;

public class Example {
  public static void main(String[] args) {
    ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
    // if you rather like to use the sandbox environment:
    // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", ApiVideoClient.Environment.SANDBOX);

    LiveStreamsApi apiInstance = client.liveStreams();
    
    String streamKey = "30087931-229e-42cf-b5f9-e91bcc1f7332"; // The unique stream key that allows you to stream videos.
    String name = "My Video"; // You can filter live streams by their name or a part of their name.
    String sortBy = "createdAt"; // Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`.
    String sortOrder = "desc"; // Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending.
    Integer currentPage = 1; // Choose the number of search results to return per page. Minimum value: 1
    Integer pageSize = 25; // Results per page. Allowed values 1-100, default is 25.

    try {
      Page<LiveStream> result = apiInstance.list()
            .streamKey(streamKey)
            .name(name)
            .sortBy(sortBy)
            .sortOrder(sortOrder)
            .currentPage(currentPage)
            .pageSize(pageSize)
            .execute();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling LiveStreamsApi#list");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getMessage());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/LiveStreamsApi.md#list

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

// retrieve the first page of all livestreams
const liveStreams = await client.liveStreams.list({ });

// retrieve the livestreams having a given name
const liveStreams2 = await client.liveStreams.list({
  name: 'My livestream'
});

// retrieve the livestreams having a given stream key
const liveStreams2 = await client.liveStreams.list({
  streamKey:'30087931-229e-42cf-b5f9-e91bcc1f7332'
});

// retrieve the second page of 30 items sorted by name desc
const liveStreams3 = await client.liveStreams.list({
  sortBy: 'name',
  sortOrder: 'desc',
  currentPage: 2,
  pageSize: 30
});
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/LiveStreamsApi.md#list

require __DIR__ . '/vendor/autoload.php';

$client = new \ApiVideo\Client\Client(
    'https://ws.api.video',
    'YOUR_API_KEY',
    new \Symfony\Component\HttpClient\Psr18Client()
); 

// retrieve the first page of all livestreams
$liveStreams = $client->liveStreams()->list();

// retrieve the livestreams having a given name
$liveStreams2 = $client->liveStreams()->list(array(
    'name' => 'My livestream'
));

// retrieve the livestreams having a given stream key
$liveStreams2 = $client->liveStreams()->list(array(
  'streamKey' => '30087931-229e-42cf-b5f9-e91bcc1f7332'
));

// retrieve the second page of 30 items sorted by name desc
$liveStreams3 = $client->liveStreams()->list(array(
    'sortBy' => 'name',
    'sortOrder' => 'desc',
    'currentPage' => 2,
    'pageSize' => 30
)); 
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamsApi.md#list

import apivideo
from apivideo.api import live_streams_api
from apivideo.model.live_stream import LiveStream
from pprint import pprint

# Enter a context with an instance of the API client
with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
    # Create an instance of the API class
    api_instance = live_streams_api.LiveStreamsApi(api_client)
    live_stream_id = "li400mYKSgQ6xs7taUeSaEKr" # str | The unique ID for the live stream you want to watch.

    # example passing only required values which don't have defaults set
    try:
        # Show live stream
        api_response = api_instance.get(live_stream_id)
        pprint(api_response)
    except apivideo.ApiException as e:
        print("Exception when calling LiveStreamsApi->get: %s\n" % e)
// First install the api client: https://github.com/apivideo/api.video-swift-client#getting-started
// Documentation: https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#list

Response examples

Success

{
  "data": [
    {
      "liveStreamId": "li400mYKSgQ6xs7taUeSaEKr",
      "createdAt": "2020-01-31T10:17:47+00:00",
      "updatedAt": "2020-03-09T13:19:43+00:00",
      "streamKey": "30087931-229e-42cf-b5f9-e91bcc1f7332",
      "restreams": [
        {
          "name": "YouTube",
          "serverUrl": "rtmp://youtube.broadcast.example.com",
          "streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385188"
        },
        {
          "name": "Twitch",
          "serverUrl": "rtmp://twitch.broadcast.example.com",
          "streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385188"
        }
      ],
      "name": "Live Stream From the browser",
      "public": true,
      "broadcasting": false,
      "assets": {
        "iframe": "<iframe src=\"https://embed.api.video/live/li400mYKSgQ6xs7taUeSaEKr\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>",
        "player": "https://embed.api.video/live/li400mYKSgQ6xs7taUeSaEKr",
        "hls": "https://live.api.video/li400mYKSgQ6xs7taUeSaEKr.m3u8",
        "thumbnail": "https://live.api.video/li400mYKSgQ6xs7taUeSaEKr/thumbnail.jpg"
      }
    },
    {
      "liveStreamId": "li4pqNqGUkhKfWcBGpZVLRY5",
      "createdAt": "2020-07-29T10:45:35+00:00",
      "updatedAt": "2020-07-29T10:45:35+00:00",
      "streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135",
      "restreams": [
        {
          "name": "YouTube",
          "serverUrl": "rtmp://youtube.broadcast.example.com",
          "streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135"
        },
        {
          "name": "Twitch",
          "serverUrl": "rtmp://twitch.broadcast.example.com",
          "streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135"
        }
      ],
      "name": "Live From New York",
      "public": true,
      "broadcasting": false,
      "assets": {
        "iframe": "<iframe src=\"https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>",
        "player": "https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5",
        "hls": "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5.m3u8",
        "thumbnail": "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5/thumbnail.jpg"
      }
    }
  ],
  "pagination": {
    "currentPage": 1,
    "currentPageItems": 19,
    "pageSize": 25,
    "pagesTotal": 1,
    "itemsTotal": 19,
    "links": [
      {
        "rel": "self",
        "uri": "/live-streams?currentPage=1&pageSize=25"
      },
      {
        "rel": "first",
        "uri": "/live-streams?currentPage=1&pageSize=25"
      },
      {
        "rel": "last",
        "uri": "/live-streams?currentPage=1&pageSize=25"
      }
    ]
  }
}

Too Many Requests

{
  "type": "https://docs.api.video/reference/too-many-requests",
  "title": "Too many requests.",
  "status": 429
}
post /live-streams

Create live stream

Creates a livestream object.

name string required

Add a name for your live stream here.

Example
"My Live Stream Video"
public boolean

Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature here .

playerId string

The unique identifier for the player.

Example
"pl4f4ferf5erfr5zed4fsdd"
restreams array

Use this parameter to add, edit, or remove RTMPS or RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations.

Responses

Success

Response body Headers
liveStreamId string required

The unique identifier for the live stream. Live stream IDs begin with "li."

Example
"li400mYKSgQ6xs7taUeSaEKr"
name string

The name of your live stream.

Example
"My Live Stream"
streamKey string

The unique, private stream key that you use to begin streaming.

Example
"dw-dew8-q6w9-k67w-1ws8"
public boolean

Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature here .

Example
true
assets object (LiveStreamAssets)
hls string

The http live streaming (HLS) link for your live video stream.

Format
uri
Example
"https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5.m3u8"
iframe string

The embed code for the iframe containing your live video stream.

Example
"<iframe src=\\\"https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5\\\" width=\\\"100%\\\" height=\\\"100%\\\" frameborder=\\\"0\\\" scrolling=\\\"no\\\" allowfullscreen=\\\"\\\"></iframe>"
player string

A link to the video player that is playing your live stream.

Format
uri
Example
"https://embed.api.video/live/li400mYKSgQ6xs7taUeSaEKr"
thumbnail string

A link to the thumbnail for your video.

Format
uri
Example
"https://live.api.video/li400mYKSgQ6xs7taUeSaEKr/thumbnail.jpg"
playerId string

The unique identifier for the player.

Example
"pl45d5vFFGrfdsdsd156dGhh"
broadcasting boolean

Whether or not you are broadcasting the live video you recorded for others to see. True means you are broadcasting to viewers, false means you are not.

Example
true
restreams array required

Returns the list of restream destinations.

createdAt string

When the player was created, presented in ATOM UTC format.

Format
date-time
Example
"2020-01-31T10:17:47+00:00"
updatedAt string

When the player was last updated, presented in ATOM UTC format.

Format
date-time
Example
"2020-01-31T10:18:47+00:00"
X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Bad Request

Response body Headers
type string

A link to the error documentation.

title string

A description of the error that occurred.

name string

The name of the parameter that caused the error.

status int

The HTTP status code.

problems array

Returns any additional problems in the request in an array of objects.

X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Too Many Requests

Response body Headers
type string

A link to the error documentation.

title string

A description of the error that occurred.

status int

The HTTP status code.

X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Request examples

{
  "name": "Test live",
  "playerId": "pl4f4ferf5erfr5zed4fsdd",
  "restreams": [
    {
      "name": "YouTube",
      "serverUrl": "rtmp://youtube.broadcast.example.com",
      "streamKey": "dw-dew8-q6w9-k67w-1ws8"
    },
    {
      "name": "Twitch",
      "serverUrl": "rtmp://twitch.broadcast.example.com",
      "streamKey": "dw-dew8-q6w9-k67w-1ws8"
    }
  ]
}
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/LiveStreamsApi.md#create

                  
var apiVideoClient = new ApiVideoClient("YOUR_API_KEY");

var liveStreamCreationPayload = new LiveStreamCreationPayload()
{
    name = "My Live Stream Video",
    _public = true,
    playerid = "pl4f4ferf5erfr5zed4fsdd",
    restreams = new List<RestreamsRequestObject>(){
        new RestreamsRequestObject(){name="My RTMP server", streamKey="dw-dew8-q6w9-k67w-1ws8", serverUrl="rtmp://my.broadcast.example.com/app" }
    }
};

try
{
    var liveStream = apiVideoClient.LiveStreams().create(liveStreamCreationPayload);
}
catch (ApiException e)
{
    // Manage create error here
}
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/LiveStreamsApi.md#create

                  
// instantiate the client 
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()

liveStreamCreationPayload := apivideosdk.LiveStreamCreationPayload{}
liveStreamCreationPayload.SetName("My Live Stream Video") // Add a name for your live stream here.
liveStreamCreationPayload.SetPublic(true) // Whether your video can be viewed by everyone, or requires authentication to see it.
liveStreamCreationPayload.SetPlayerId("pl4f4ferf5erfr5zed4fsdd") // The unique identifier for the player.
liveStreamCreatePayload.SetRestreams([]RestreamsRequestObject{{Name: "My RTMP server", ServerUrl: "rtmp://my.broadcast.example.com/app", StreamKey: "dw-dew8-q6w9-k67w-1ws8"}}) // Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations.

res, err := client.LiveStreams.Create(liveStreamCreationPayload)

if err != nil {
    fmt.Fprintf(os.Stderr, "Error when calling `LiveStreams.Create``: %v", err)
}

fmt.Fprintf(os.Stdout, "Response from `LiveStreams.Create`: %v", res)
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/LiveStreamsApi.md#create

                  
// instantiate the client 
ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");

LiveStreamCreationPayload liveStreamCreationPayload = new LiveStreamCreationPayload(); 
liveStreamCreationPayload.setName("My Live Stream Video"); // Add a name for your live stream here.
liveStreamCreationPayload.setPublic(); // Whether your video can be viewed by everyone, or requires authentication to see it.
liveStreamCreationPayload.setPlayerId("pl4f4ferf5erfr5zed4fsdd"); // The unique identifier for the player.
liveStreamCreationPayload.setRestreams(Collections.singletonList(new RestreamsRequestObject() // Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations.
      .name("My RTMP server")
      .serverUrl("rtmp://my.broadcast.example.com/app")
      .streamKey("dw-dew8-q6w9-k67w-1ws8")));


try {
    LiveStream liveStream = client.liveStreams().create(liveStreamCreationPayload);
    System.out.println(liveStream);
} catch (ApiException e) {
    e.printStackTrace();
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/LiveStreamsApi.md#create

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const liveStreamCreationPayload = {
    name: "My Live Stream", // Add a name for your live stream here.
    _public: true, // Whether your video can be viewed by everyone, or requires authentication to see it. 
    playerId: "pl4f4ferf5erfr5zed4fsdd", // The unique identifier for the player.
    restreams: [ // Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations.
      {
        streamKey: "dw-dew8-q6w9-k67w-1ws8",
        serverUrl: "rtmp://my.broadcast.example.com/app",
        name: "My RTMP server",
      },
    ],
}; 

const liveStream = await client.liveStreams.create(liveStreamCreationPayload);
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/LiveStreamsApi.md#create

require __DIR__ . '/vendor/autoload.php';

$client = new \ApiVideo\Client\Client(
    'https://ws.api.video',
    'YOUR_API_KEY',
    new \Symfony\Component\HttpClient\Psr18Client()
);

$liveStream = $client->liveStreams()->create((new \ApiVideo\Client\Model\LiveStreamCreationPayload())
    ->setName("My Live Stream Video") // Add a name for your live stream here.
    ->setPublic(true) // Whether your video can be viewed by everyone, or requires authentication to see it. 
    ->setPlayerId("pl4f4ferf5erfr5zed4fsdd")); // The unique identifier for the player.
    ->setRestreams(array(  // Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations.
        new RestreamsRequestObject(['name' => 'My RTMP server', 'serverUrl' => 'rtmp://my.broadcast.example.com/app', 'streamKey' => 'dw-dew8-q6w9-k67w-1ws8'])));
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamsApi.md#create

from apivideo.api.live_streams_api import LiveStreamsApi
from apivideo.model.live_stream_creation_payload import LiveStreamCreationPayload
from apivideo import AuthenticatedApiClient, ApiException

with AuthenticatedApiClient("YOUR_API_KEY") as api_client:
    live_stream_creation_payload = LiveStreamCreationPayload(
        name="My Live Stream Video",
        public=True,
        player_id="pl4f4ferf5erfr5zed4fsdd",
        restreams=[
            RestreamsRequestObject(
                name="My RTMP server",
                server_url="rtmp://my.broadcast.example.com/app",
                stream_key="dw-dew8-q6w9-k67w-1ws8",
            ),
        ],
    ) # LiveStreamCreationPayload | 

    try:
        live_stream = LiveStreamsApi(api_client).create(live_stream_creation_payload)
        print(live_stream)
    except ApiException as e:
        print("Exception when calling LiveStreamsApi->create: %s" % e)
// First install the api client: https://github.com/apivideo/api.video-swift-client#getting-started
// Documentation: https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#create

ApiVideoClient.apiKey = "YOUR_API_KEY"

let liveStreamCreationPayload = LiveStreamCreationPayload(
    name: "My Live Stream Video",
    _public: true,
    playerId: "pl4f4ferf5erfr5zed4fsdd",
    restreams: [RestreamsRequestObject(
        name: "My RTMP server",
        serverUrl: "rtmp://my.broadcast.example.com/app",
        streamKey: "dw-dew8-q6w9-k67w-1ws8"
    )]
)

LiveStreamsAPI.create(liveStreamCreationPayload: liveStreamCreationPayload) { liveStream, error in
   if let liveStream = liveStream  {
       // Do something with the livestream
   }
   if let error = error {
      // Manage create error here
   }
}

Response examples

Success

{
  "liveStreamId": "li4pqNqGUkhKfWcBGpZVLRY5",
  "createdAt": "2020-07-29T10:45:35+00:00",
  "updatedAt": "2020-07-29T10:45:35+00:00",
  "streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135",
  "restreams": [
    {
      "name": "YouTube",
      "serverUrl": "rtmp://youtube.broadcast.example.com",
      "streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135"
    },
    {
      "name": "Twitch",
      "serverUrl": "rtmp://twitch.broadcast.example.com",
      "streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135"
    }
  ],
  "name": "Live From New York",
  "public": true,
  "broadcasting": false,
  "assets": {
    "iframe": "<iframe src=\"https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>",
    "player": "https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5",
    "hls": "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5.m3u8",
    "thumbnail": "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5/thumbnail.jpg"
  }
}

Bad Request

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "This value should not be blank.",
  "name": "restreams[0][name]"
}

This error occurs when a field is empty in the restreams array in your request.

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "Missing app name: [rtmp|rtmps]://[host]/[app name].",
  "name": "restreams[0][serverUrl]"
}

This error occurs when the app name is missing from serverURL in the restreams array.

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "RTMP URL should have the following format: [rtmp|rtmps]://[host]/[app name].",
  "name": "restreams[0][serverUrl]"
}

This error occurs when the URL you set in serverURL is not rtmps or rtmp .

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "This collection should contain 5 elements or less.",
  "name": "restreams"
}

This error occurs when you set more than 5 restream destinations.

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "This value should not be null.",
  "name": "restreams[0][name]"
}

This error occurs when a field is sent as null in the restreams array in your request.

Too Many Requests

{
  "type": "https://docs.api.video/reference/too-many-requests",
  "title": "Too many requests.",
  "status": 429
}
get /live-streams/{liveStreamId}

Retrieve live stream

Get a livestream by id.

liveStreamId string required

The unique ID for the live stream you want to watch.

Responses

Success

Response body Headers
liveStreamId string required

The unique identifier for the live stream. Live stream IDs begin with "li."

Example
"li400mYKSgQ6xs7taUeSaEKr"
name string

The name of your live stream.

Example
"My Live Stream"
streamKey string

The unique, private stream key that you use to begin streaming.

Example
"dw-dew8-q6w9-k67w-1ws8"
public boolean

Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature here .

Example
true
assets object (LiveStreamAssets)
hls string

The http live streaming (HLS) link for your live video stream.

Format
uri
Example
"https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5.m3u8"
iframe string

The embed code for the iframe containing your live video stream.

Example
"<iframe src=\\\"https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5\\\" width=\\\"100%\\\" height=\\\"100%\\\" frameborder=\\\"0\\\" scrolling=\\\"no\\\" allowfullscreen=\\\"\\\"></iframe>"
player string

A link to the video player that is playing your live stream.

Format
uri
Example
"https://embed.api.video/live/li400mYKSgQ6xs7taUeSaEKr"
thumbnail string

A link to the thumbnail for your video.

Format
uri
Example
"https://live.api.video/li400mYKSgQ6xs7taUeSaEKr/thumbnail.jpg"
playerId string

The unique identifier for the player.

Example
"pl45d5vFFGrfdsdsd156dGhh"
broadcasting boolean

Whether or not you are broadcasting the live video you recorded for others to see. True means you are broadcasting to viewers, false means you are not.

Example
true
restreams array required

Returns the list of restream destinations.

createdAt string

When the player was created, presented in ATOM UTC format.

Format
date-time
Example
"2020-01-31T10:17:47+00:00"
updatedAt string

When the player was last updated, presented in ATOM UTC format.

Format
date-time
Example
"2020-01-31T10:18:47+00:00"
X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Too Many Requests

Response body Headers
type string

A link to the error documentation.

title string

A description of the error that occurred.

status int

The HTTP status code.

X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Request examples

// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/LiveStreamsApi.md#get

import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.LiveStreamsApi;
import java.util.*;

public class Example {
  public static void main(String[] args) {
    ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
    // if you rather like to use the sandbox environment:
    // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", ApiVideoClient.Environment.SANDBOX);

    LiveStreamsApi apiInstance = client.liveStreams();
    
    String liveStreamId = "li400mYKSgQ6xs7taUeSaEKr"; // The unique ID for the live stream you want to watch.

    try {
      LiveStream result = apiInstance.get(liveStreamId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling LiveStreamsApi#get");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getMessage());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/LiveStreamsApi.md#get

using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
    public class getExample
    {
        public static void Main()
        {
            var basePath = ApiVideoClient.Client.Environment.SANDBOX;
            var apiKey = "YOUR_API_KEY";

            var apiInstance = new ApiVideoClient(apiKey,basePath);

            var liveStreamId = li400mYKSgQ6xs7taUeSaEKr;  // string | The unique ID for the live stream you want to watch.
            var apiLiveStreamsInstance = apiInstance.LiveStreams();
            try
            {
                // Show live stream
                LiveStream result = apiLiveStreamsInstance.get(liveStreamId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiveStreamsApi.get: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/LiveStreamsApi.md#get

package main

import (
    "context"
    "fmt"
    "os"
    apivideosdk "github.com/apivideo/api.video-go-client"
)

func main() {
    client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
    // if you rather like to use the sandbox environment:
    // client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
        
    liveStreamId := "li400mYKSgQ6xs7taUeSaEKr" // string | The unique ID for the live stream you want to watch.

    
    res, err := client.LiveStreams.Get(liveStreamId)

    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `LiveStreams.Get``: %v\
", err)
    }
    // response from `Get`: LiveStream
    fmt.Fprintf(os.Stdout, "Response from `LiveStreams.Get`: %v\
", res)
}
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/LiveStreamsApi.md#get

import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.LiveStreamsApi;
import java.util.*;

public class Example {
  public static void main(String[] args) {
    ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
    // if you rather like to use the sandbox environment:
    // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", ApiVideoClient.Environment.SANDBOX);

    LiveStreamsApi apiInstance = client.liveStreams();
    
    String liveStreamId = "li400mYKSgQ6xs7taUeSaEKr"; // The unique ID for the live stream you want to watch.

    try {
      LiveStream result = apiInstance.get(liveStreamId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling LiveStreamsApi#get");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getMessage());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/LiveStreamsApi.md#get

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const liveStreamId = 'li400mYKSgQ6xs7taUeSaEKr'; // The unique ID for the live stream you want to retrieve.

const liveStream = await client.liveStreams.get(liveStreamId);
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/LiveStreamsApi.md#get

require __DIR__ . '/vendor/autoload.php';

$client = new \ApiVideo\Client\Client(
    'https://ws.api.video',
    'YOUR_API_KEY',
    new \Symfony\Component\HttpClient\Psr18Client()
); 

$liveStreamId = 'li400mYKSgQ6xs7taUeSaEKr'; // The unique ID for the live stream you want to retrieve.
$liveStream = $client->liveStreams()->get($liveStreamId);
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamsApi.md#get

import apivideo
from apivideo.api import live_streams_api
from apivideo.model.live_stream import LiveStream
from pprint import pprint

# Enter a context with an instance of the API client
with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
    # Create an instance of the API class
    api_instance = live_streams_api.LiveStreamsApi(api_client)
    live_stream_id = "li400mYKSgQ6xs7taUeSaEKr" # str | The unique ID for the live stream you want to watch.

    # example passing only required values which don't have defaults set
    try:
        # Show live stream
        api_response = api_instance.get(live_stream_id)
        pprint(api_response)
    except apivideo.ApiException as e:
        print("Exception when calling LiveStreamsApi->get: %s\n" % e)
// First install the api client: https://github.com/apivideo/api.video-swift-client#getting-started
// Documentation: https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#get

Response examples

Success

{
  "liveStreamId": "li4pqNqGUkhKfWcBGpZVLRY5",
  "createdAt": "2020-07-29T10:45:35+00:00",
  "updatedAt": "2020-07-29T10:45:35+00:00",
  "streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135",
  "restreams": [
    {
      "name": "YouTube",
      "serverUrl": "rtmp://youtube.broadcast.example.com",
      "streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135"
    },
    {
      "name": "Twitch",
      "serverUrl": "rtmp://twitch.broadcast.example.com",
      "streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135"
    }
  ],
  "name": "Live From New York",
  "public": true,
  "broadcasting": false,
  "assets": {
    "iframe": "<iframe src=\"https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>",
    "player": "https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5",
    "hls": "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5.m3u8",
    "thumbnail": "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5/thumbnail.jpg"
  }
}

Too Many Requests

{
  "type": "https://docs.api.video/reference/too-many-requests",
  "title": "Too many requests.",
  "status": 429
}
delete /live-streams/{liveStreamId}

Delete a live stream

If you do not need a live stream any longer, you can send a request to delete it. All you need is the liveStreamId.

liveStreamId string required

The unique ID for the live stream that you want to remove.

Responses

No Content

Response body Headers

This response is empty

X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Too Many Requests

Response body Headers
type string

A link to the error documentation.

title string

A description of the error that occurred.

status int

The HTTP status code.

X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Request examples

// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/LiveStreamsApi.md#delete

using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
    public class deleteExample
    {
        public static void Main()
        {
            var basePath = ApiVideoClient.Client.Environment.SANDBOX;
            var apiKey = "YOUR_API_KEY";

            var apiInstance = new ApiVideoClient(apiKey,basePath);

            var liveStreamId = li400mYKSgQ6xs7taUeSaEKr;  // string | The unique ID for the live stream that you want to remove.
            var apiLiveStreamsInstance = apiInstance.LiveStreams();
            try
            {
                // Delete a live stream
                apiLiveStreamsInstance.delete(liveStreamId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiveStreamsApi.delete: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/LiveStreamsApi.md#delete

package main

import (
    "context"
    "fmt"
    "os"
    apivideosdk "github.com/apivideo/api.video-go-client"
)

func main() {
    client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
    // if you rather like to use the sandbox environment:
    // client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
        
    liveStreamId := "li400mYKSgQ6xs7taUeSaEKr" // string | The unique ID for the live stream that you want to remove.

    
    err := client.LiveStreams.Delete(liveStreamId)

    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `LiveStreams.Delete``: %v\
", err)
    }
}
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/LiveStreamsApi.md#delete

  import video.api.client.ApiVideoClient;
  import video.api.client.api.ApiException;
  import video.api.client.api.models.*;
  import video.api.client.api.clients.LiveStreamsApi;
  import java.util.*;
  
  public class Example {
    public static void main(String[] args) {
      ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
      // if you rather like to use the sandbox environment:
      // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", ApiVideoClient.Environment.SANDBOX);
  
      LiveStreamsApi apiInstance = client.liveStreams();
      
      String liveStreamId = "li400mYKSgQ6xs7taUeSaEKr"; // The unique ID for the live stream that you want to remove.
  
      try {
        apiInstance.delete(liveStreamId);
      } catch (ApiException e) {
        System.err.println("Exception when calling LiveStreamsApi#delete");
        System.err.println("Status code: " + e.getCode());
        System.err.println("Reason: " + e.getMessage());
        System.err.println("Response headers: " + e.getResponseHeaders());
        e.printStackTrace();
      }
    }
  }
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/LiveStreamsApi.md#delete

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const liveStreamId = 'li400mYKSgQ6xs7taUeSaEKr'; // The unique identifier of the live stream whose thumbnail you want to delete.

const liveStream = await client.liveStreams.deleteThumbnail(liveStreamId);
    
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/LiveStreamsApi.md#delete

require __DIR__ . '/vendor/autoload.php';

$client = new \ApiVideo\Client\Client(
    'https://ws.api.video',
    'YOUR_API_KEY',
    new \Symfony\Component\HttpClient\Psr18Client()
); 

$liveStreamId = 'li400mYKSgQ6xs7taUeSaEKr'; // The unique identifier of the live stream whose thumbnail you want to delete.
$liveStream = $client->liveStreams()->deleteThumbnail($liveStreamId); 
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamsApi.md#delete

import apivideo
from apivideo.api import live_streams_api
from pprint import pprint

# Enter a context with an instance of the API client
with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
    # Create an instance of the API class
    api_instance = live_streams_api.LiveStreamsApi(api_client)
    live_stream_id = "li400mYKSgQ6xs7taUeSaEKr" # str | The unique ID for the live stream that you want to remove.

    # example passing only required values which don't have defaults set
    try:
        # Delete a live stream
        api_instance.delete(live_stream_id)
    except apivideo.ApiException as e:
        print("Exception when calling LiveStreamsApi->delete: %s\n" % e)
// First install the api client: https://github.com/apivideo/api.video-swift-client#getting-started
// Documentation: https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#delete

Response examples

Too Many Requests

{
  "type": "https://docs.api.video/reference/too-many-requests",
  "title": "Too many requests.",
  "status": 429
}
patch /live-streams/{liveStreamId}

Update a live stream

Updates the livestream object.

name string

The name you want to use for your live stream.

Example
"My Live Stream Video"
public boolean

Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature here .

playerId string

The unique ID for the player associated with a live stream that you want to update.

Example
"pl45KFKdlddgk654dspkze"
restreams array

Use this parameter to add, edit, or remove RTMPS or RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations. This operation updates all restream destinations in the same request. If you do not want to modify an existing restream destination, you need to include it in your request, otherwise it is removed.

liveStreamId string required

The unique ID for the live stream that you want to update information for such as player details.

Responses

Success

Response body Headers
liveStreamId string required

The unique identifier for the live stream. Live stream IDs begin with "li."

Example
"li400mYKSgQ6xs7taUeSaEKr"
name string

The name of your live stream.

Example
"My Live Stream"
streamKey string

The unique, private stream key that you use to begin streaming.

Example
"dw-dew8-q6w9-k67w-1ws8"
public boolean

Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature here .

Example
true
assets object (LiveStreamAssets)
hls string

The http live streaming (HLS) link for your live video stream.

Format
uri
Example
"https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5.m3u8"
iframe string

The embed code for the iframe containing your live video stream.

Example
"<iframe src=\\\"https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5\\\" width=\\\"100%\\\" height=\\\"100%\\\" frameborder=\\\"0\\\" scrolling=\\\"no\\\" allowfullscreen=\\\"\\\"></iframe>"
player string

A link to the video player that is playing your live stream.

Format
uri
Example
"https://embed.api.video/live/li400mYKSgQ6xs7taUeSaEKr"
thumbnail string

A link to the thumbnail for your video.

Format
uri
Example
"https://live.api.video/li400mYKSgQ6xs7taUeSaEKr/thumbnail.jpg"
playerId string

The unique identifier for the player.

Example
"pl45d5vFFGrfdsdsd156dGhh"
broadcasting boolean

Whether or not you are broadcasting the live video you recorded for others to see. True means you are broadcasting to viewers, false means you are not.

Example
true
restreams array required

Returns the list of restream destinations.

createdAt string

When the player was created, presented in ATOM UTC format.

Format
date-time
Example
"2020-01-31T10:17:47+00:00"
updatedAt string

When the player was last updated, presented in ATOM UTC format.

Format
date-time
Example
"2020-01-31T10:18:47+00:00"
X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Bad Request

Response body Headers
type string

A link to the error documentation.

title string

A description of the error that occurred.

name string

The name of the parameter that caused the error.

status int

The HTTP status code.

problems array

Returns any additional problems in the request in an array of objects.

X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Too Many Requests

Response body Headers
type string

A link to the error documentation.

title string

A description of the error that occurred.

status int

The HTTP status code.

X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Request examples

{
  "name": "My Live Stream Video",
  "public": true,
  "playerId": "pl45KFKdlddgk654dspkze",
  "restreams": [
    {
      "name": "My restream server",
      "serverUrl": "rtmp://my.broadcast.example.com/app",
      "streamKey": "dw-dew8-q6w9-k67w-1ws8"
    }
  ]
}
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/LiveStreamsApi.md#update

using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
    public class updateExample
    {
        public static void Main()
        {
            var basePath = ApiVideoClient.Client.Environment.SANDBOX;
            var apiKey = "YOUR_API_KEY";

            var apiInstance = new ApiVideoClient(apiKey,basePath);

            var liveStreamId = li400mYKSgQ6xs7taUeSaEKr;  // string | The unique ID for the live stream that you want to update information for such as player details.
            var liveStreamUpdatePayload = new LiveStreamUpdatePayload(); // LiveStreamUpdatePayload | 
            var apiLiveStreamsInstance = apiInstance.LiveStreams();
            try
            {
                // Update a live stream
                LiveStream result = apiLiveStreamsInstance.update(liveStreamId, liveStreamUpdatePayload);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiveStreamsApi.update: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/LiveStreamsApi.md#update

package main

import (
    "context"
    "fmt"
    "os"
    apivideosdk "github.com/apivideo/api.video-go-client"
)

func main() {
    client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
    // if you rather like to use the sandbox environment:
    // client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
        
    liveStreamId := "li400mYKSgQ6xs7taUeSaEKr" // string | The unique ID for the live stream that you want to update information for such as player details.
    liveStreamUpdatePayload := apivideosdk.LiveStreamUpdatePayload{}
    liveStreamUpdatePayload.SetName("My Live Stream Video") // The name you want to use for your live stream.
    liveStreamUpdatePayload.SetPublic(true) // Whether your video can be viewed by everyone, or requires authentication to see it.
    liveStreamUpdatePayload.SetPlayerId("pl4f4ferf5erfr5zed4fsdd") // The unique ID for the player associated with a live stream that you want to update.
    liveStreamUpdatePayload.SetRestreams([]RestreamsRequestObject{{Name: "My RTMP server", ServerUrl: "rtmp://my.broadcast.example.com/app", StreamKey: "dw-dew8-q6w9-k67w-1ws8"}}) // Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations. This operation updates all restream destinations in the same request. If you do not want to modify an existing restream destination, you need to include it in your request, otherwise it is removed.

    res, err := client.LiveStreams.Update(liveStreamId, liveStreamUpdatePayload)

    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `LiveStreams.Update``: %v\
", err)
    }
    // response from `Update`: LiveStream
    fmt.Fprintf(os.Stdout, "Response from `LiveStreams.Update`: %v\
", res)
}
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/LiveStreamsApi.md#update

import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.LiveStreamsApi;
import java.util.*;

public class Example {
  public static void main(String[] args) {
    ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
    // if you rather like to use the sandbox environment:
    // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", ApiVideoClient.Environment.SANDBOX);

    LiveStreamsApi apiInstance = client.liveStreams();
    
    String liveStreamId = "li400mYKSgQ6xs7taUeSaEKr"; // The unique ID for the live stream that you want to update information for such as player details.
    LiveStreamUpdatePayload liveStreamUpdatePayload = new LiveStreamUpdatePayload(); // 
    liveStreamUpdatePayload.setName("My Live Stream Video"); // The name you want to use for your live stream.
    liveStreamUpdatePayload.setPublic(); // Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view.
    liveStreamUpdatePayload.setPlayerId("pl45KFKdlddgk654dspkze"); // The unique ID for the player associated with a live stream that you want to update.
    liveStreamUpdatePayload.setRestreams(Collections.singletonList(new RestreamsRequestObject() // Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations. This operation updates all restream destinations in the same request. If you do not want to modify an existing restream destination, you need to include it in your request, otherwise it is removed.
          .name("My RTMP server")
          .serverUrl("rtmp://my.broadcast.example.com/app")
          .streamKey("dw-dew8-q6w9-k67w-1ws8")));


    try {
      LiveStream result = apiInstance.update(liveStreamId, liveStreamUpdatePayload);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling LiveStreamsApi#update");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getMessage());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/LiveStreamsApi.md#update

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const liveStreamId = 'li400mYKSgQ6xs7taUeSaEKr'; // The unique ID for the live stream that you want to update information for such as player details.
const liveStreamUpdatePayload = {
  name: "My Live Stream Video", // The name you want to use for your live stream.
  _public: true, // Whether your video can be viewed by everyone, or requires authentication to see it. 
  playerId: "pl45KFKdlddgk654dspkze", // The unique ID for the player associated with a live stream that you want to update.
  restreams: [ // Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations.
    {
      streamKey: "dw-dew8-q6w9-k67w-1ws8",
      serverUrl: "rtmp://my.broadcast.example.com/app",
      name: "My RTMP server",
    },
  ],
};

const liveStream = await client.liveStreams.update(liveStreamId, liveStreamUpdatePayload); 
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/LiveStreamsApi.md#update

require __DIR__ . '/vendor/autoload.php';

$client = new \ApiVideo\Client\Client(
    'https://ws.api.video',
    'YOUR_API_KEY',
    new \Symfony\Component\HttpClient\Psr18Client()
); 

$liveStreamId = 'li400mYKSgQ6xs7taUeSaEKr'; // The unique ID for the live stream that you want to update information for such as player details.

$liveStreamUpdatePayload = (new \ApiVideo\Client\Model\LiveStreamUpdatePayload())
    ->setName("My Live Stream Video") // The name you want to use for your live stream.)
    ->setPublic(true) // Whether your video can be viewed by everyone, or requires authentication to see it. )
    ->setPlayerId("pl45KFKdlddgk654dspkze") // The unique ID for the player associated with a live stream that you want to update.)
    ->setRestreams(array(
      new RestreamsRequestObject(['name' => 'My RTMP server', 'serverUrl' => 'rtmp://my.broadcast.example.com/app', 'streamKey' => 'dw-dew8-q6w9-k67w-1ws8'])));


$liveStream = $client->liveStreams()->update($liveStreamId, $liveStreamUpdatePayload); 
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamsApi.md#update

import apivideo
from apivideo.api import live_streams_api
from apivideo.model.bad_request import BadRequest
from apivideo.model.live_stream_update_payload import LiveStreamUpdatePayload
from apivideo.model.live_stream import LiveStream
from pprint import pprint

# Enter a context with an instance of the API client
with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
    # Create an instance of the API class
    api_instance = live_streams_api.LiveStreamsApi(api_client)
    live_stream_id = "li400mYKSgQ6xs7taUeSaEKr" # str | The unique ID for the live stream that you want to update information for such as player details.
    live_stream_update_payload = LiveStreamUpdatePayload(
        name="My Live Stream Video",
        public=True,
        player_id="pl45KFKdlddgk654dspkze",
        restreams=[
            RestreamsRequestObject(
                name="My RTMP server",
                server_url="rtmp://my.broadcast.example.com",
                stream_key="dw-dew8-q6w9-k67w-1ws8",
            ),
        ],
    ) # LiveStreamUpdatePayload | 

    # example passing only required values which don't have defaults set
    try:
        # Update a live stream
        api_response = api_instance.update(live_stream_id, live_stream_update_payload)
        pprint(api_response)
    except apivideo.ApiException as e:
        print("Exception when calling LiveStreamsApi->update: %s\
" % e)
// First install the api client: https://github.com/apivideo/api.video-swift-client#getting-started
// Documentation: https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#update

ApiVideoClient.apiKey = "YOUR_API_KEY"

let liveStreamId = "li400mYKSgQ6xs7taUeSaEKr" // String | The unique ID for the live stream that you want to update information for such as player details.
let liveStreamUpdatePayload = LiveStreamUpdatePayload(
    name: "My Live Stream Video",
    _public: true,
    playerId: "pl4f4ferf5erfr5zed4fsdd",
    restreams: [RestreamsRequestObject(
        name: "My RTMP server",
        serverUrl: "rtmp://my.broadcast.example.com/app",
        streamKey: "dw-dew8-q6w9-k67w-1ws8"
    )]
)

LiveStreamsAPI.update(liveStreamId: liveStreamId, liveStreamUpdatePayload: liveStreamUpdatePayload) { liveStream, error in
   if let liveStream = liveStream  {
       // Do something with the livestream
   }
   if let error = error {
      // Manage update error here
   }
}

Response examples

Success

{
  "liveStreamId": "li4pqNqGUkhKfWcBGpZVLRY5",
  "createdAt": "2020-07-29T10:45:35+00:00",
  "updatedAt": "2020-07-29T10:45:35+00:00",
  "streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135",
  "restreams": [
    {
      "name": "YouTube",
      "serverUrl": "rtmp://youtube.broadcast.example.com",
      "streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135"
    },
    {
      "name": "Twitch",
      "serverUrl": "rtmp://twitch.broadcast.example.com",
      "streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135"
    }
  ],
  "name": "Live From New York",
  "public": true,
  "broadcasting": false,
  "assets": {
    "iframe": "<iframe src=\"https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>",
    "player": "https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5",
    "hls": "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5.m3u8",
    "thumbnail": "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5/thumbnail.jpg"
  }
}

Bad Request

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "This value should not be blank.",
  "name": "restreams[0][name]"
}

This error occurs when a field is empty in the restreams array in your request.

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "Missing app name: [rtmp|rtmps]://[host]/[app name].",
  "name": "restreams[0][serverUrl]"
}

This error occurs when the app name is missing from serverURL in the restreams array.

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "RTMP URL should have the following format: [rtmp|rtmps]://[host]/[app name].",
  "name": "restreams[0][serverUrl]"
}

This error occurs when the URL you set in serverURL is not rtmps or rtmp .

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "This collection should contain 5 elements or less.",
  "name": "restreams"
}

This error occurs when you set more than 5 restream destinations.

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "This value should not be null.",
  "name": "restreams[0][name]"
}

This error occurs when a field is sent as null in the restreams array in your request.

Too Many Requests

{
  "type": "https://docs.api.video/reference/too-many-requests",
  "title": "Too many requests.",
  "status": 429
}
post /live-streams/{liveStreamId}/thumbnail

Upload a thumbnail

Upload the thumbnail for the livestream.

file file required

The image to be added as a thumbnail. The mime type should be image/jpeg, image/png or image/webp. The max allowed size is 8 MiB.

liveStreamId string required

The unique ID for the live stream you want to upload.

Responses

Created

Response body Headers
liveStreamId string required

The unique identifier for the live stream. Live stream IDs begin with "li."

Example
"li400mYKSgQ6xs7taUeSaEKr"
name string

The name of your live stream.

Example
"My Live Stream"
streamKey string

The unique, private stream key that you use to begin streaming.

Example
"dw-dew8-q6w9-k67w-1ws8"
public boolean

Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature here .

Example
true
assets object (LiveStreamAssets)
hls string

The http live streaming (HLS) link for your live video stream.

Format
uri
Example
"https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5.m3u8"
iframe string

The embed code for the iframe containing your live video stream.

Example
"<iframe src=\\\"https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5\\\" width=\\\"100%\\\" height=\\\"100%\\\" frameborder=\\\"0\\\" scrolling=\\\"no\\\" allowfullscreen=\\\"\\\"></iframe>"
player string

A link to the video player that is playing your live stream.

Format
uri
Example
"https://embed.api.video/live/li400mYKSgQ6xs7taUeSaEKr"
thumbnail string

A link to the thumbnail for your video.

Format
uri
Example
"https://live.api.video/li400mYKSgQ6xs7taUeSaEKr/thumbnail.jpg"
playerId string

The unique identifier for the player.

Example
"pl45d5vFFGrfdsdsd156dGhh"
broadcasting boolean

Whether or not you are broadcasting the live video you recorded for others to see. True means you are broadcasting to viewers, false means you are not.

Example
true
restreams array required

Returns the list of restream destinations.

createdAt string

When the player was created, presented in ATOM UTC format.

Format
date-time
Example
"2020-01-31T10:17:47+00:00"
updatedAt string

When the player was last updated, presented in ATOM UTC format.

Format
date-time
Example
"2020-01-31T10:18:47+00:00"
X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Bad Request

Response body Headers
type string

A link to the error documentation.

title string

A description of the error that occurred.

name string

The name of the parameter that caused the error.

status int

The HTTP status code.

problems array

Returns any additional problems in the request in an array of objects.

X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Not Found

Response body Headers
type string

A link to the error documentation.

title string

A description of the error that occurred.

name string

The name of the parameter that caused the error.

status int

The HTTP status code.

X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Too Many Requests

Response body Headers
type string

A link to the error documentation.

title string

A description of the error that occurred.

status int

The HTTP status code.

X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Request examples

// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/LiveStreamsApi.md#uploadThumbnail

using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
    public class uploadThumbnailExample
    {
        public static void Main()
        {
            var basePath = ApiVideoClient.Client.Environment.SANDBOX;
            var apiKey = "YOUR_API_KEY";

            var apiInstance = new ApiVideoClient(apiKey,basePath);

            var liveStreamId = vi4k0jvEUuaTdRAEjQ4Jfrgz;  // string | The unique ID for the live stream you want to upload.
            var file = BINARY_DATA_HERE;  // System.IO.Stream | The image to be added as a thumbnail.
            var apiLiveStreamsInstance = apiInstance.LiveStreams();
            try
            {
                // Upload a thumbnail
                LiveStream result = apiLiveStreamsInstance.uploadThumbnail(liveStreamId, file);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiveStreamsApi.uploadThumbnail: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/LiveStreamsApi.md#uploadThumbnail

package main

import (
    "context"
    "fmt"
    "os"
    apivideosdk "github.com/apivideo/api.video-go-client"
)

func main() {
    client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
    // if you rather like to use the sandbox environment:
    // client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
        
    liveStreamId := "vi4k0jvEUuaTdRAEjQ4Jfrgz" // string | The unique ID for the live stream you want to upload.
    file := os.NewFile(1234, "some_file") // *os.File | The image to be added as a thumbnail.

    
    res, err := client.LiveStreams.UploadThumbnailFile(liveStreamId, file)

    // you can also use a Reader instead of a File:
    // client.LiveStreams.UploadThumbnail(liveStreamId, fileName, fileReader)

    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `LiveStreams.UploadThumbnail``: %v\
", err)
    }
    // response from `UploadThumbnail`: LiveStream
    fmt.Fprintf(os.Stdout, "Response from `LiveStreams.UploadThumbnail`: %v\
", res)
}
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/LiveStreamsApi.md#uploadThumbnail

import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.LiveStreamsApi;
import java.util.*;

public class Example {
  public static void main(String[] args) {
    ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
    // if you rather like to use the sandbox environment:
    // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", ApiVideoClient.Environment.SANDBOX);

    LiveStreamsApi apiInstance = client.liveStreams();
    
    String liveStreamId = "vi4k0jvEUuaTdRAEjQ4Jfrgz"; // The unique ID for the live stream you want to upload.
    File file = new File("/path/to/file"); // The image to be added as a thumbnail.

    try {
      LiveStream result = apiInstance.uploadThumbnail(liveStreamId, file);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling LiveStreamsApi#uploadThumbnail");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getMessage());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/LiveStreamsApi.md#uploadThumbnail

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const liveStreamId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // The unique ID for the live stream you want to upload.
const file = './thumbnail.jpg'; // The image to be added as a thumbnail.

const livestream = await client.liveStreams.uploadThumbnail(liveStreamId, file);
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/LiveStreamsApi.md#uploadThumbnail

require __DIR__ . '/vendor/autoload.php';

$client = new \ApiVideo\Client\Client(
    'https://ws.api.video',
    'YOUR_API_KEY',
    new \Symfony\Component\HttpClient\Psr18Client()
); 

$liveStreamId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // The unique ID for the live stream you want to upload.
$file = new SplFileObject(__DIR__ . './thumbnail.jpg'); // The image to be added as a thumbnail.

$livestream = $client->liveStreams()->uploadThumbnail($liveStreamId, $file); 
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamsApi.md#uploadThumbnail

import apivideo
from apivideo.api import live_streams_api
from apivideo.model.bad_request import BadRequest
from apivideo.model.not_found import NotFound
from apivideo.model.live_stream import LiveStream
from pprint import pprint

# Enter a context with an instance of the API client
with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
    # Create an instance of the API class
    api_instance = live_streams_api.LiveStreamsApi(api_client)
    live_stream_id = "vi4k0jvEUuaTdRAEjQ4Jfrgz" # str | The unique ID for the live stream you want to upload.
    file = open('/path/to/file', 'rb') # file_type | The image to be added as a thumbnail.

    # example passing only required values which don't have defaults set
    try:
        # Upload a thumbnail
        api_response = api_instance.upload_thumbnail(live_stream_id, file)
        pprint(api_response)
    except apivideo.ApiException as e:
        print("Exception when calling LiveStreamsApi->upload_thumbnail: %s\n" % e)
// First install the api client: https://github.com/apivideo/api.video-swift-client#getting-started
// Documentation: https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#uploadThumbnail

Response examples

Created

{
  "liveStreamId": "li400mYKSgQ6xs7taUeSaEKr",
  "name": "My Live Stream",
  "streamKey": "dw-dew8-q6w9-k67w-1ws8",
  "public": true,
  "assets": {
    "hls": "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5.m3u8",
    "iframe": "<iframe src=\\\"https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5\\\" width=\\\"100%\\\" height=\\\"100%\\\" frameborder=\\\"0\\\" scrolling=\\\"no\\\" allowfullscreen=\\\"\\\"></iframe>",
    "player": "https://embed.api.video/live/li400mYKSgQ6xs7taUeSaEKr",
    "thumbnail": "https://live.api.video/li400mYKSgQ6xs7taUeSaEKr/thumbnail.jpg"
  },
  "playerId": "pl45d5vFFGrfdsdsd156dGhh",
  "broadcasting": true,
  "restreams": [
    {
      "name": "My restream server",
      "serverUrl": "rtmp://my.broadcast.example.com/app",
      "streamKey": "dw-dew8-q6w9-k67w-1ws8"
    }
  ],
  "createdAt": "2020-01-31T10:17:47+00:00",
  "updatedAt": "2020-01-31T10:18:47+00:00"
}

Bad Request

{
  "status": 400,
  "type": "https://docs.api.video/reference/uploaded-file-extension-invalid",
  "title": "Only [jpeg, jpg, JPG, JPEG] extensions are supported.",
  "name": "file"
}

Not Found

{
  "type": "https://docs.api.video/reference/resource-not-found",
  "title": "The requested resource was not found.",
  "name": "liveStreamId",
  "status": 404
}

Too Many Requests

{
  "type": "https://docs.api.video/reference/too-many-requests",
  "title": "Too many requests.",
  "status": 429
}
delete /live-streams/{liveStreamId}/thumbnail

Delete a thumbnail

Send the unique identifier for a live stream to delete its thumbnail.

liveStreamId string required

The unique identifier of the live stream whose thumbnail you want to delete.

Responses

Success

Response body Headers
liveStreamId string required

The unique identifier for the live stream. Live stream IDs begin with "li."

Example
"li400mYKSgQ6xs7taUeSaEKr"
name string

The name of your live stream.

Example
"My Live Stream"
streamKey string

The unique, private stream key that you use to begin streaming.

Example
"dw-dew8-q6w9-k67w-1ws8"
public boolean

Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature here .

Example
true
assets object (LiveStreamAssets)
hls string

The http live streaming (HLS) link for your live video stream.

Format
uri
Example
"https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5.m3u8"
iframe string

The embed code for the iframe containing your live video stream.

Example
"<iframe src=\\\"https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5\\\" width=\\\"100%\\\" height=\\\"100%\\\" frameborder=\\\"0\\\" scrolling=\\\"no\\\" allowfullscreen=\\\"\\\"></iframe>"
player string

A link to the video player that is playing your live stream.

Format
uri
Example
"https://embed.api.video/live/li400mYKSgQ6xs7taUeSaEKr"
thumbnail string

A link to the thumbnail for your video.

Format
uri
Example
"https://live.api.video/li400mYKSgQ6xs7taUeSaEKr/thumbnail.jpg"
playerId string

The unique identifier for the player.

Example
"pl45d5vFFGrfdsdsd156dGhh"
broadcasting boolean

Whether or not you are broadcasting the live video you recorded for others to see. True means you are broadcasting to viewers, false means you are not.

Example
true
restreams array required

Returns the list of restream destinations.

createdAt string

When the player was created, presented in ATOM UTC format.

Format
date-time
Example
"2020-01-31T10:17:47+00:00"
updatedAt string

When the player was last updated, presented in ATOM UTC format.

Format
date-time
Example
"2020-01-31T10:18:47+00:00"
X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Not Found

Response body Headers
type string

A link to the error documentation.

title string

A description of the error that occurred.

name string

The name of the parameter that caused the error.

status int

The HTTP status code.

X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Too Many Requests

Response body Headers
type string

A link to the error documentation.

title string

A description of the error that occurred.

status int

The HTTP status code.

X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Request examples

// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/LiveStreamsApi.md#deleteThumbnail

using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
    public class deleteThumbnailExample
    {
        public static void Main()
        {
            var basePath = ApiVideoClient.Client.Environment.SANDBOX;
            var apiKey = "YOUR_API_KEY";

            var apiInstance = new ApiVideoClient(apiKey,basePath);

            var liveStreamId = li400mYKSgQ6xs7taUeSaEKr;  // string | The unique identifier for the live stream you want to delete. 
            var apiLiveStreamsInstance = apiInstance.LiveStreams();
            try
            {
                // Delete a thumbnail
                LiveStream result = apiLiveStreamsInstance.deleteThumbnail(liveStreamId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiveStreamsApi.deleteThumbnail: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/LiveStreamsApi.md#deleteThumbnail

package main

import (
    "context"
    "fmt"
    "os"
    apivideosdk "github.com/apivideo/api.video-go-client"
)

func main() {
    client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
    // if you rather like to use the sandbox environment:
    // client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
        
    liveStreamId := "li400mYKSgQ6xs7taUeSaEKr" // string | The unique identifier for the live stream you want to delete. 

    
    res, err := client.LiveStreams.DeleteThumbnail(liveStreamId)

    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `LiveStreams.DeleteThumbnail``: %v\
", err)
    }
    // response from `DeleteThumbnail`: LiveStream
    fmt.Fprintf(os.Stdout, "Response from `LiveStreams.DeleteThumbnail`: %v\
", res)
}
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/LiveStreamsApi.md#deleteThumbnail

import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.LiveStreamsApi;
import java.util.*;

public class Example {
  public static void main(String[] args) {
    ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
    // if you rather like to use the sandbox environment:
    // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", ApiVideoClient.Environment.SANDBOX);

    LiveStreamsApi apiInstance = client.liveStreams();
    
    String liveStreamId = "li400mYKSgQ6xs7taUeSaEKr"; // The unique identifier for the live stream you want to delete. 

    try {
      LiveStream result = apiInstance.deleteThumbnail(liveStreamId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling LiveStreamsApi#deleteThumbnail");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getMessage());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/LiveStreamsApi.md#deleteThumbnail

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const liveStreamId = 'li400mYKSgQ6xs7taUeSaEKr'; // The unique ID for the live stream whose thumbnail you want to delete.

const liveStream = await client.liveStreams.deleteThumbnail(liveStreamId); 
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/LiveStreamsApi.md#get

require __DIR__ . '/vendor/autoload.php';

$client = new \ApiVideo\Client\Client(
    'https://ws.api.video',
    'YOUR_API_KEY',
    new \Symfony\Component\HttpClient\Psr18Client()
); 

$liveStreamId = 'li400mYKSgQ6xs7taUeSaEKr'; // The unique ID for the live stream you want to watch.
$liveStream = $client->liveStreams()->get(liveStreamId); 
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamsApi.md#deleteThumbnail

import apivideo
from apivideo.api import live_streams_api
from apivideo.model.not_found import NotFound
from apivideo.model.live_stream import LiveStream
from pprint import pprint

# Enter a context with an instance of the API client
with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
    # Create an instance of the API class
    api_instance = live_streams_api.LiveStreamsApi(api_client)
    live_stream_id = "li400mYKSgQ6xs7taUeSaEKr" # str | The unique identifier for the live stream you want to delete. 

    # example passing only required values which don't have defaults set
    try:
        # Delete a thumbnail
        api_response = api_instance.delete_thumbnail(live_stream_id)
        pprint(api_response)
    except apivideo.ApiException as e:
        print("Exception when calling LiveStreamsApi->delete_thumbnail: %s\
" % e)
// First install the api client: https://github.com/apivideo/api.video-swift-client#getting-started
// Documentation: https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#deleteThumbnail

Response examples

Success

{
  "liveStreamId": "li400mYKSgQ6xs7taUeSaEKr",
  "name": "My Live Stream",
  "streamKey": "dw-dew8-q6w9-k67w-1ws8",
  "public": true,
  "assets": {
    "hls": "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5.m3u8",
    "iframe": "<iframe src=\\\"https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5\\\" width=\\\"100%\\\" height=\\\"100%\\\" frameborder=\\\"0\\\" scrolling=\\\"no\\\" allowfullscreen=\\\"\\\"></iframe>",
    "player": "https://embed.api.video/live/li400mYKSgQ6xs7taUeSaEKr",
    "thumbnail": "https://live.api.video/li400mYKSgQ6xs7taUeSaEKr/thumbnail.jpg"
  },
  "playerId": "pl45d5vFFGrfdsdsd156dGhh",
  "broadcasting": true,
  "restreams": [
    {
      "name": "My restream server",
      "serverUrl": "rtmp://my.broadcast.example.com/app",
      "streamKey": "dw-dew8-q6w9-k67w-1ws8"
    }
  ],
  "createdAt": "2020-01-31T10:17:47+00:00",
  "updatedAt": "2020-01-31T10:18:47+00:00"
}

Not Found

{
  "type": "https://docs.api.video/reference/resource-not-found",
  "title": "The requested resource was not found.",
  "name": "liveStreamId",
  "status": 404
}

Too Many Requests

{
  "type": "https://docs.api.video/reference/too-many-requests",
  "title": "Too many requests.",
  "status": 429
}
put /live-streams/{liveStreamId}/complete

Complete a live stream

Request the completion of a live stream that is currently running. This operation is asynchronous and the live stream will stop after a few seconds.

The API adds the EXT-X-ENDLIST tag to the live stream's HLS manifest. This stops the live stream on the player and also stops the recording of the live stream. The API keeps the incoming connection from the streamer open for at most 1 minute, which can be used to terminate the stream.

liveStreamId string required

The unique ID for the live stream you want to complete.

Responses

Accepted

Response body Headers

This response is empty

X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Not Found

Response body Headers
type string

A link to the error documentation.

title string

A description of the error that occurred.

name string

The name of the parameter that caused the error.

status int

The HTTP status code.

X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Too Many Requests

Response body Headers
type string

A link to the error documentation.

title string

A description of the error that occurred.

status int

The HTTP status code.

X-RateLimit-Limit int

The request limit per minute.

X-RateLimit-Remaining int

The number of available requests left for the current time window.

X-RateLimit-Retry-After int

The number of seconds left until the current rate limit window resets.

Response examples

Not Found

{
  "type": "https://docs.api.video/reference/resource-not-found",
  "title": "The requested resource was not found.",
  "name": "liveStreamId",
  "status": 404
}

Too Many Requests

{
  "type": "https://docs.api.video/reference/too-many-requests",
  "title": "Too many requests.",
  "status": 429
}