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

Associates the provided subtitle for the content with the mentioned `language_code`

If a new subtitle is uploaded with the same `language_code`, existing one is replaced with the new one


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

### Path Parameters

<ParamField showLocation="false" path="CONTENT_ID" param-type="string" required="true">
Content UUID
</ParamField>

### 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="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>
  </ContentType>
</BodyParams>

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

```bash
curl -X POST "https://api.videograph.ai/video/services/api/v1/contents/example_string/subtitles" \
  -H "Content-Type: application/json" \
  -H "Accept: example_string" \
  -H "Authorization: Basic YOUR_CREDENTIALS" \
  -d '{
  "url": "example_string",
  "name": "John Doe",
  "language_code": "example_string",
  "support_closed_captions": true
}'
```

```python
import requests
import json

url = "https://api.videograph.ai/video/services/api/v1/contents/example_string/subtitles"
headers = {
  "Content-Type": "application/json",
  "Accept": "example_string",
  "Authorization": "Basic YOUR_CREDENTIALS"
}
data = {
  "url": "example_string",
  "name": "John Doe",
  "language_code": "example_string",
  "support_closed_captions": 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/example_string/subtitles", {
  method: "POST",
  headers: {
  "Content-Type": "application/json",
  "Accept": "example_string",
  "Authorization": "Basic YOUR_CREDENTIALS"
},
  body: JSON.stringify({
  "url": "example_string",
  "name": "John Doe",
  "language_code": "example_string",
  "support_closed_captions": true
})
});

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

```go
package main

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

func main() {
    data := []byte(`{
  "url": "example_string",
  "name": "John Doe",
  "language_code": "example_string",
  "support_closed_captions": true
}`)
    
    req, err := http.NewRequest("POST", "https://api.videograph.ai/video/services/api/v1/contents/example_string/subtitles", 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/example_string/subtitles')
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 = '{
  "url": "example_string",
  "name": "John Doe",
  "language_code": "example_string",
  "support_closed_captions": 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": "Updated video details",
  "code": 200,
  "data": {
    "url": "https://d133d5ts749j6w.cloudfront.net/ane/HSHM2586532201040000_ACTA_HD.scc",
    "name": "English US",
    "language_code": "en_US",
    "support_closed_captions": false,
    "uuid": "subtitleid"
  }
}
```

</Response>

