> 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 and set default thumbnail

This is is to create a thumbnail of specified dimensions with the frame of video at the given position in sec. Generated thumbnail gets assigned as default thumbnail immediately to the 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>

### Path Parameters

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

<BodyParams contentTypes={["application/json"]} defaultType="application/json">
  <ContentType type="application/json">
<ParamField showLocation="false" body="videoPositionInSec" param-type="integer" required="true">
Provide the exact duration of video in seconds at which you wish to create the thumbnail.
</ParamField>

<ParamField showLocation="false" body="width" param-type="integer" required="true">
Specify the Width of thumbnail in pixels.
</ParamField>

<ParamField showLocation="false" body="height" param-type="integer" required="true">
Specify the Height of thumbnail in pixels.
</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/thumbnails" \
  -H "Content-Type: application/json" \
  -H "Authorization: Basic YOUR_CREDENTIALS" \
  -d '{
  "videoPositionInSec": 123,
  "width": 123,
  "height": 42
}'
```

```python
import requests
import json

url = "https://api.videograph.ai/video/services/api/v1/contents/example_string/thumbnails"
headers = {
  "Content-Type": "application/json",
  "Authorization": "Basic YOUR_CREDENTIALS"
}
data = {
  "videoPositionInSec": 123,
  "width": 123,
  "height": 42
}

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/thumbnails", {
  method: "POST",
  headers: {
  "Content-Type": "application/json",
  "Authorization": "Basic YOUR_CREDENTIALS"
},
  body: JSON.stringify({
  "videoPositionInSec": 123,
  "width": 123,
  "height": 42
})
});

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

```go
package main

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

func main() {
    data := []byte(`{
  "videoPositionInSec": 123,
  "width": 123,
  "height": 42
}`)
    
    req, err := http.NewRequest("POST", "https://api.videograph.ai/video/services/api/v1/contents/example_string/thumbnails", 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/contents/example_string/thumbnails')
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 = '{
  "videoPositionInSec": 123,
  "width": 123,
  "height": 42
}'

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": "Thumbnail created",
  "code": 201
}
```

</Response>

