> 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 Content

**Use this endpoint to create a content (video/audio) from the asset url which is publicly accessible**
*   Make sure you have created an API access token. You can create one by Signup/Signin into Videograph.
*   Add subtitles from different languages to your content.
*   Add and control watermarks/image overlays settings on your content.
*   For test purposes, 10 seconds duration of uploaded video will be transcoded for streaming
*   Add tags and meta-data to your content.


<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>

### Headers

<ParamField showLocation="false" header="Accept" param-type="string" required="false">

</ParamField>

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

<ParamField showLocation="false" body="description" param-type="string" required="false">
Describe your content.
</ParamField>

<ParamField showLocation="false" body="content" param-type="array" required="true">
Provide the source url to download the content. If you want to create video clips from the video then pass on the start time and end time of the clip along with source url.

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

  <ParamField showLocation="false" body="url" param-type="string" required="true">
  Provide a source Video/content url.
  </ParamField>

  <ParamField showLocation="false" body="start_offset" param-type="integer" required="false">
  Mention clip start time in seconds from start of source video
  </ParamField>

  <ParamField showLocation="false" body="end_offset" param-type="integer" required="false">
  Mention clip end time in seconds from start of source video
  </ParamField>

</Expandable>
</ParamField>

<ParamField showLocation="false" body="watermark" param-type="array" required="false">
Watermark details on video content

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

  <ParamField showLocation="false" body="url" param-type="string" required="true">
  Provide source url of the image to be used as watermark.
  </ParamField>

  <ParamField showLocation="false" body="x_pos" param-type="string" required="true">
  X-axis position in pixels ex-10px
  </ParamField>

  <ParamField showLocation="false" body="y_pos" param-type="string" required="true">
  Y-axis position in pixels ex-10px
  </ParamField>

  <ParamField showLocation="false" body="x_margin" param-type="string" required="false">
  X-axis margin in pixel or percentage ex-10px/10%
  </ParamField>

  <ParamField showLocation="false" body="y_margin" param-type="string" required="false">
  Y-axis margin in pixel or percentage ex-10px/10%
  </ParamField>

  <ParamField showLocation="false" body="x_align" param-type="string" required="false">
  X-axis alignment, allowed values left/center/right
  </ParamField>

  <ParamField showLocation="false" body="y_align" param-type="string" required="false">
  Y-axis alignment, allowed values top/middle/bottom
  </ParamField>

  <ParamField showLocation="false" body="width" param-type="string" required="false">
  Width of the image in pixel or percentage ex-10px/10%
  </ParamField>

  <ParamField showLocation="false" body="height" param-type="string" required="false">
  height of the image in pixel or percentage ex-10px/10%
  </ParamField>

  <ParamField showLocation="false" body="opacity" param-type="string" required="false">
  Control opacity of the watermark image, mentioned it in percentage ex-90%
  </ParamField>

</Expandable>
</ParamField>

<ParamField showLocation="false" body="subtitle" param-type="array" required="false">
Add Subtitles to video content

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

  <ParamField showLocation="false" body="url" param-type="string" required="true">
  Provide source url of Subtitle file. Supported formats include SRT & VTT.
  </ParamField>

  <ParamField showLocation="false" body="name" param-type="string" required="true">
  Name of subtitle ex-English US
  </ParamField>

  <ParamField showLocation="false" body="language_code" param-type="string" required="true">
  Mention Language code ex-en_US
  </ParamField>

  <ParamField showLocation="false" body="support_closed_captions" param-type="boolean" required="true">
  Does your subtitle support closed captions (CC), allowed values true/false
  </ParamField>

</Expandable>
</ParamField>

<ParamField showLocation="false" body="tags" param-type="array" required="false">
Provide a list of tags that best describe your content.
</ParamField>

<ParamField showLocation="false" body="metadata" param-type="array" required="false">
Provide content metadata as key value pairs.

<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="true">
Playback policies. Allowed are public, signed or both
</ParamField>

<ParamField showLocation="false" body="mp4_support" param-type="boolean" required="false">
Is MP4 generation supported
</ParamField>

<ParamField showLocation="false" body="save_original_copy" param-type="boolean" required="false">
Is original copy to be saved
</ParamField>

<ParamField showLocation="false" body="assetCollectionUUID" param-type="string" required="false">
Asset colleciton under which content should be created. Defaults to environment root collection.
</ParamField>

<ParamField showLocation="false" body="encodingProfileUUID" param-type="string" required="false">
Enconding profile to be used to encode. Defaults to what is mapped to environment.
</ParamField>
  </ContentType>
</BodyParams>

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

```bash
curl -X POST "https://api.videograph.ai/video/services/api/v1/contents" \
  -H "Content-Type: application/json" \
  -H "Accept: example_string" \
  -H "Authorization: Basic YOUR_CREDENTIALS" \
  -d '{
  "title": "Demo Video",
  "description": "This is a demo video",
  "content": [
    {
      "url": "https://d19nx8bm4jzw4h.cloudfront.net/Tears-of-steel.mp4"
    }
  ],
  "watermark": [
    {
      "url": "https://d19nx8bm4jzw4h.cloudfront.net/videograph_logo.png
",
      "x_pos": "1564px",
      "y_pos": "74px",
      "opacity": "70%"
    }
  ],
  "subtitle": [
    {
      "url": "https://d19nx8bm4jzw4h.cloudfront.net/Tears-of-steel.srt
",
      "name": "English US",
      "language_code": "en_US",
      "support_closed_captions": false
    }
  ],
  "tags": [
    "Animation",
    "Video demo"
  ],
  "metadata": [
    {
      "key": "color",
      "value": "blue"
    }
  ],
  "playback_policy": [
    "public"
  ],
  "mp4_support": true,
  "save_original_copy": false,
  "test_video": true
}'
```

```python
import requests
import json

url = "https://api.videograph.ai/video/services/api/v1/contents"
headers = {
  "Content-Type": "application/json",
  "Accept": "example_string",
  "Authorization": "Basic YOUR_CREDENTIALS"
}
data = {
  "title": "Demo Video",
  "description": "This is a demo video",
  "content": [
    {
      "url": "https://d19nx8bm4jzw4h.cloudfront.net/Tears-of-steel.mp4"
    }
  ],
  "watermark": [
    {
      "url": "https://d19nx8bm4jzw4h.cloudfront.net/videograph_logo.png
",
      "x_pos": "1564px",
      "y_pos": "74px",
      "opacity": "70%"
    }
  ],
  "subtitle": [
    {
      "url": "https://d19nx8bm4jzw4h.cloudfront.net/Tears-of-steel.srt
",
      "name": "English US",
      "language_code": "en_US",
      "support_closed_captions": false
    }
  ],
  "tags": [
    "Animation",
    "Video demo"
  ],
  "metadata": [
    {
      "key": "color",
      "value": "blue"
    }
  ],
  "playback_policy": [
    "public"
  ],
  "mp4_support": true,
  "save_original_copy": false,
  "test_video": true
}

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

```javascript
const response = await fetch("https://api.videograph.ai/video/services/api/v1/contents", {
  method: "POST",
  headers: {
  "Content-Type": "application/json",
  "Accept": "example_string",
  "Authorization": "Basic YOUR_CREDENTIALS"
},
  body: JSON.stringify({
  "title": "Demo Video",
  "description": "This is a demo video",
  "content": [
    {
      "url": "https://d19nx8bm4jzw4h.cloudfront.net/Tears-of-steel.mp4"
    }
  ],
  "watermark": [
    {
      "url": "https://d19nx8bm4jzw4h.cloudfront.net/videograph_logo.png
",
      "x_pos": "1564px",
      "y_pos": "74px",
      "opacity": "70%"
    }
  ],
  "subtitle": [
    {
      "url": "https://d19nx8bm4jzw4h.cloudfront.net/Tears-of-steel.srt
",
      "name": "English US",
      "language_code": "en_US",
      "support_closed_captions": false
    }
  ],
  "tags": [
    "Animation",
    "Video demo"
  ],
  "metadata": [
    {
      "key": "color",
      "value": "blue"
    }
  ],
  "playback_policy": [
    "public"
  ],
  "mp4_support": true,
  "save_original_copy": false,
  "test_video": true
})
});

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

```go
package main

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

func main() {
    data := []byte(`{
  "title": "Demo Video",
  "description": "This is a demo video",
  "content": [
    {
      "url": "https://d19nx8bm4jzw4h.cloudfront.net/Tears-of-steel.mp4"
    }
  ],
  "watermark": [
    {
      "url": "https://d19nx8bm4jzw4h.cloudfront.net/videograph_logo.png
",
      "x_pos": "1564px",
      "y_pos": "74px",
      "opacity": "70%"
    }
  ],
  "subtitle": [
    {
      "url": "https://d19nx8bm4jzw4h.cloudfront.net/Tears-of-steel.srt
",
      "name": "English US",
      "language_code": "en_US",
      "support_closed_captions": false
    }
  ],
  "tags": [
    "Animation",
    "Video demo"
  ],
  "metadata": [
    {
      "key": "color",
      "value": "blue"
    }
  ],
  "playback_policy": [
    "public"
  ],
  "mp4_support": true,
  "save_original_copy": false,
  "test_video": true
}`)
    
    req, err := http.NewRequest("POST", "https://api.videograph.ai/video/services/api/v1/contents", bytes.NewBuffer(data))
    if err != nil {
        panic(err)
    }
    
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Accept", "example_string")
    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/contents')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Accept'] = 'example_string'
request['Authorization'] = 'Basic YOUR_CREDENTIALS'
request.body = '{
  "title": "Demo Video",
  "description": "This is a demo video",
  "content": [
    {
      "url": "https://d19nx8bm4jzw4h.cloudfront.net/Tears-of-steel.mp4"
    }
  ],
  "watermark": [
    {
      "url": "https://d19nx8bm4jzw4h.cloudfront.net/videograph_logo.png
",
      "x_pos": "1564px",
      "y_pos": "74px",
      "opacity": "70%"
    }
  ],
  "subtitle": [
    {
      "url": "https://d19nx8bm4jzw4h.cloudfront.net/Tears-of-steel.srt
",
      "name": "English US",
      "language_code": "en_US",
      "support_closed_captions": false
    }
  ],
  "tags": [
    "Animation",
    "Video demo"
  ],
  "metadata": [
    {
      "key": "color",
      "value": "blue"
    }
  ],
  "playback_policy": [
    "public"
  ],
  "mp4_support": true,
  "save_original_copy": false,
  "test_video": true
}'

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

</Request>

### Responses

<div data-component="ResponsesCollection"><Expandable title="201 - Created" default-open="false">

*Created*

</Expandable>

</div>

<Response tabs="201">

```json
{
  "status": "Success",
  "message": "Triggered processing of videos.",
  "code": 201,
  "data": {
    "title": "Video title",
    "description": "Video description",
    "contentId": "",
    "tags": [
      "tag1",
      "tag2"
    ],
    "metadata": [
      {
        "key": "abc",
        "value": "pqr"
      }
    ],
    "playback_policy": [
      "public",
      "signed"
    ],
    "mp4_support": true,
    "save_original_copy": true,
    "statusId": 1,
    "status": "Processing",
    "duration": 100,
    "thumbnails": [],
    "created_at": 1673347977713
  }
}
```

</Response>

