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


<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="Content-Type" param-type="string" required="false">

</ParamField>

<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="file_name" param-type="string" required="true">
Name of the file
</ParamField>

<ParamField showLocation="false" body="timeout" param-type="integer" required="false">
Timeout of the file in seconds
</ParamField>

<ParamField showLocation="false" body="cors_origin" param-type="string" required="false">
Cors origin ex - Allowed domain
</ParamField>

<ParamField showLocation="false" body="content" param-type="object" required="false">
Content description

<Expandable title="Object Properties" default-open="false">

  <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="watermark" param-type="array" required="false">
  Add watermark image 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">
  Content tags
  </ParamField>

  <ParamField showLocation="false" body="metadata" param-type="array" required="false">
  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>

</Expandable>
</ParamField>
  </ContentType>
</BodyParams>

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

```bash
curl -X POST "https://api.videograph.ai/video/services/api/v1/uploads" \
  -H "Content-Type: application/json" \
  -H "Content-Type: example_string" \
  -H "Accept: example_string" \
  -H "Authorization: Basic YOUR_CREDENTIALS" \
  -d '{
  "file_name": "John Doe",
  "timeout": 42,
  "cors_origin": "example_string",
  "content": {
    "title": "example_string",
    "description": "example_string",
    "watermark": [
      {
        "url": "example_string",
        "x_pos": "example_string",
        "y_pos": "example_string",
        "x_margin": "example_string",
        "y_margin": "example_string",
        "x_align": "left",
        "y_align": "top",
        "width": "example_string",
        "height": "example_string",
        "opacity": "New York"
      }
    ],
    "subtitle": [
      {
        "url": "example_string",
        "name": "John Doe",
        "language_code": "example_string",
        "support_closed_captions": true
      }
    ],
    "tags": [
      "example_string"
    ],
    "metadata": [
      {
        "key": "example_string",
        "value": "example_string"
      }
    ],
    "playback_policy": [
      "public"
    ],
    "mp4_support": true,
    "save_original_copy": true
  }
}'
```

```python
import requests
import json

url = "https://api.videograph.ai/video/services/api/v1/uploads"
headers = {
  "Content-Type": "example_string",
  "Accept": "example_string",
  "Authorization": "Basic YOUR_CREDENTIALS"
}
data = {
  "file_name": "John Doe",
  "timeout": 42,
  "cors_origin": "example_string",
  "content": {
    "title": "example_string",
    "description": "example_string",
    "watermark": [
      {
        "url": "example_string",
        "x_pos": "example_string",
        "y_pos": "example_string",
        "x_margin": "example_string",
        "y_margin": "example_string",
        "x_align": "left",
        "y_align": "top",
        "width": "example_string",
        "height": "example_string",
        "opacity": "New York"
      }
    ],
    "subtitle": [
      {
        "url": "example_string",
        "name": "John Doe",
        "language_code": "example_string",
        "support_closed_captions": true
      }
    ],
    "tags": [
      "example_string"
    ],
    "metadata": [
      {
        "key": "example_string",
        "value": "example_string"
      }
    ],
    "playback_policy": [
      "public"
    ],
    "mp4_support": true,
    "save_original_copy": 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/uploads", {
  method: "POST",
  headers: {
  "Content-Type": "example_string",
  "Accept": "example_string",
  "Authorization": "Basic YOUR_CREDENTIALS"
},
  body: JSON.stringify({
  "file_name": "John Doe",
  "timeout": 42,
  "cors_origin": "example_string",
  "content": {
    "title": "example_string",
    "description": "example_string",
    "watermark": [
      {
        "url": "example_string",
        "x_pos": "example_string",
        "y_pos": "example_string",
        "x_margin": "example_string",
        "y_margin": "example_string",
        "x_align": "left",
        "y_align": "top",
        "width": "example_string",
        "height": "example_string",
        "opacity": "New York"
      }
    ],
    "subtitle": [
      {
        "url": "example_string",
        "name": "John Doe",
        "language_code": "example_string",
        "support_closed_captions": true
      }
    ],
    "tags": [
      "example_string"
    ],
    "metadata": [
      {
        "key": "example_string",
        "value": "example_string"
      }
    ],
    "playback_policy": [
      "public"
    ],
    "mp4_support": true,
    "save_original_copy": true
  }
})
});

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

```go
package main

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

func main() {
    data := []byte(`{
  "file_name": "John Doe",
  "timeout": 42,
  "cors_origin": "example_string",
  "content": {
    "title": "example_string",
    "description": "example_string",
    "watermark": [
      {
        "url": "example_string",
        "x_pos": "example_string",
        "y_pos": "example_string",
        "x_margin": "example_string",
        "y_margin": "example_string",
        "x_align": "left",
        "y_align": "top",
        "width": "example_string",
        "height": "example_string",
        "opacity": "New York"
      }
    ],
    "subtitle": [
      {
        "url": "example_string",
        "name": "John Doe",
        "language_code": "example_string",
        "support_closed_captions": true
      }
    ],
    "tags": [
      "example_string"
    ],
    "metadata": [
      {
        "key": "example_string",
        "value": "example_string"
      }
    ],
    "playback_policy": [
      "public"
    ],
    "mp4_support": true,
    "save_original_copy": true
  }
}`)
    
    req, err := http.NewRequest("POST", "https://api.videograph.ai/video/services/api/v1/uploads", bytes.NewBuffer(data))
    if err != nil {
        panic(err)
    }
    
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Content-Type", "example_string")
    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/uploads')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Content-Type'] = 'example_string'
request['Accept'] = 'example_string'
request['Authorization'] = 'Basic YOUR_CREDENTIALS'
request.body = '{
  "file_name": "John Doe",
  "timeout": 42,
  "cors_origin": "example_string",
  "content": {
    "title": "example_string",
    "description": "example_string",
    "watermark": [
      {
        "url": "example_string",
        "x_pos": "example_string",
        "y_pos": "example_string",
        "x_margin": "example_string",
        "y_margin": "example_string",
        "x_align": "left",
        "y_align": "top",
        "width": "example_string",
        "height": "example_string",
        "opacity": "New York"
      }
    ],
    "subtitle": [
      {
        "url": "example_string",
        "name": "John Doe",
        "language_code": "example_string",
        "support_closed_captions": true
      }
    ],
    "tags": [
      "example_string"
    ],
    "metadata": [
      {
        "key": "example_string",
        "value": "example_string"
      }
    ],
    "playback_policy": [
      "public"
    ],
    "mp4_support": true,
    "save_original_copy": 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
{
  "id": "zd01Pe2bNpYhxbrwYABgFE01twZdtv4M00kts2i02GhbGjc",
  "url": "https://yupptv-metadata.s3.ap-southeast-1.amazonaws.com/phani/config.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20220310T110243Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3599&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20220310%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Signature=4aa631e30076814c2555b2024b8634064df7c185f5aada4a80ee5ce40411f6a1",
  "cors_origin": "https://example.com/",
  "timeout": 3600,
  "status": "Waiting"
}
```

</Response>

