> For the complete documentation index, see [llms.txt](https://docs.videograph.ai/llms.txt).
> Use it to discover all available pages before exploring further.

# Create Livestream/Recording


<PlaygroundComponent />

<AuthParams schemes={["basicAuth"]}>
<AuthType scheme="basicAuth">
<ParamField header="Authorization" param-type="string" required="true">
Basic authentication credentials. Provide username and password encoded in Base64 format: Basic base64(username:password)
</ParamField>
</AuthType>
</AuthParams>

<BodyParams contentTypes={["application/json"]} defaultType="application/json">
  <ContentType type="application/json">
<ParamField showLocation="false" body="title" param-type="string" required="true">
Provide a name for your livestream.
</ParamField>

<ParamField showLocation="false" body="description" param-type="string" required="false">
Livestream description
</ParamField>

<ParamField showLocation="false" body="region" param-type="string" required="true">
Region for creation ex - us-east-1
</ParamField>

<ParamField showLocation="false" body="record" param-type="boolean" required="true">
Indicates if its liverecording (true) or streaming (false)
</ParamField>

<ParamField showLocation="false" body="dvrDurationInMins" param-type="integer" required="false">
Indicates the dvr duration to be availbale during playback
</ParamField>

<ParamField showLocation="false" body="tags" param-type="array" required="false">
Livestream tags
</ParamField>

<ParamField showLocation="false" body="metadata" param-type="array" required="false">
Livestream metadata as keyvalue pair

<Expandable title="Array Items" default-open="false">

  <ParamField showLocation="false" body="key" param-type="string" required="true">
  The constant that defines the data set ex-color
  </ParamField>

  <ParamField showLocation="false" body="value" param-type="string" required="true">
  A variable whihc belongs to the data set ex-blue
  </ParamField>

</Expandable>
</ParamField>

<ParamField showLocation="false" body="playback_policy" param-type="array" required="false">
Playback policies. Allowed are public, signed or both
</ParamField>

<ParamField showLocation="false" body="recordings_playback_policy" param-type="array" required="false">
Playback policies for generated recordings. Allowed are public, signed or both
</ParamField>
  </ContentType>
</BodyParams>

<Request tabs="curl,python,javascript,go,ruby">

```bash
curl -X POST "https://api.videograph.ai/video/services/api/v1/livestreams" \
  -H "Content-Type: application/json" \
  -H "Authorization: Basic YOUR_CREDENTIALS" \
  -d '{
  "title": "example_string",
  "description": "example_string",
  "region": "example_string",
  "record": true,
  "dvrDurationInMins": 42,
  "tags": [
    "example_string"
  ],
  "metadata": [
    {
      "key": "example_string",
      "value": "example_string"
    }
  ],
  "playback_policy": [
    "public"
  ],
  "recordings_playback_policy": [
    "public"
  ]
}'
```

```python
import requests
import json

url = "https://api.videograph.ai/video/services/api/v1/livestreams"
headers = {
  "Content-Type": "application/json",
  "Authorization": "Basic YOUR_CREDENTIALS"
}
data = {
  "title": "example_string",
  "description": "example_string",
  "region": "example_string",
  "record": true,
  "dvrDurationInMins": 42,
  "tags": [
    "example_string"
  ],
  "metadata": [
    {
      "key": "example_string",
      "value": "example_string"
    }
  ],
  "playback_policy": [
    "public"
  ],
  "recordings_playback_policy": [
    "public"
  ]
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
```

```javascript
const response = await fetch("https://api.videograph.ai/video/services/api/v1/livestreams", {
  method: "POST",
  headers: {
  "Content-Type": "application/json",
  "Authorization": "Basic YOUR_CREDENTIALS"
},
  body: JSON.stringify({
  "title": "example_string",
  "description": "example_string",
  "region": "example_string",
  "record": true,
  "dvrDurationInMins": 42,
  "tags": [
    "example_string"
  ],
  "metadata": [
    {
      "key": "example_string",
      "value": "example_string"
    }
  ],
  "playback_policy": [
    "public"
  ],
  "recordings_playback_policy": [
    "public"
  ]
})
});

const data = await response.json();
console.log(data);
```

```go
package main

import (
    "fmt"
    "net/http"
    "bytes"
    "encoding/json"
)

func main() {
    data := []byte(`{
  "title": "example_string",
  "description": "example_string",
  "region": "example_string",
  "record": true,
  "dvrDurationInMins": 42,
  "tags": [
    "example_string"
  ],
  "metadata": [
    {
      "key": "example_string",
      "value": "example_string"
    }
  ],
  "playback_policy": [
    "public"
  ],
  "recordings_playback_policy": [
    "public"
  ]
}`)
    
    req, err := http.NewRequest("POST", "https://api.videograph.ai/video/services/api/v1/livestreams", bytes.NewBuffer(data))
    if err != nil {
        panic(err)
    }
    
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Authorization", "Basic YOUR_CREDENTIALS")

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()
    
    fmt.Println("Response Status:", resp.Status)
}
```

```ruby
require 'net/http'
require 'json'

uri = URI('https://api.videograph.ai/video/services/api/v1/livestreams')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Basic YOUR_CREDENTIALS'
request.body = '{
  "title": "example_string",
  "description": "example_string",
  "region": "example_string",
  "record": true,
  "dvrDurationInMins": 42,
  "tags": [
    "example_string"
  ],
  "metadata": [
    {
      "key": "example_string",
      "value": "example_string"
    }
  ],
  "playback_policy": [
    "public"
  ],
  "recordings_playback_policy": [
    "public"
  ]
}'

response = http.request(request)
puts response.body
```

</Request>

### Responses

<div data-component="ResponsesCollection"><Expandable title="200 - Successful response" default-open="true">

*Successful response*

</Expandable>

</div>

<Response tabs="200">

```json
{}
```

</Response>

