Pular para o conteúdo principal
POST
/
videos
/
upload
Start an upload
curl --request POST \
  --url https://api.cut.pro/api/v1/videos/upload \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "file_name": "<string>",
  "file_size": 123,
  "content_type": "<string>"
}
'
import requests

url = "https://api.cut.pro/api/v1/videos/upload"

payload = {
"file_name": "<string>",
"file_size": 123,
"content_type": "<string>"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({file_name: '<string>', file_size: 123, content_type: '<string>'})
};

fetch('https://api.cut.pro/api/v1/videos/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cut.pro/api/v1/videos/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file_name' => '<string>',
'file_size' => 123,
'content_type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.cut.pro/api/v1/videos/upload"

payload := strings.NewReader("{\n \"file_name\": \"<string>\",\n \"file_size\": 123,\n \"content_type\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.cut.pro/api/v1/videos/upload")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"file_name\": \"<string>\",\n \"file_size\": 123,\n \"content_type\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.cut.pro/api/v1/videos/upload")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"file_name\": \"<string>\",\n \"file_size\": 123,\n \"content_type\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "video_id": "<string>",
  "upload_url": "<string>",
  "expires_in": 123
}
{
"allowed_extensions": [
"<string>"
],
"max_size": 123
}
{
"code": "PRESIGN_FAILED"
}

Autorizações

X-Api-Key
string
header
obrigatório

Corpo

file_name
string
obrigatório

Original file name. Used to detect the extension and as a fallback title.

file_size
number
obrigatório

Size of the file in bytes. Must be <= 5 GB.

content_type
string

MIME type — defaults to video/mp4. Must match the bytes you PUT.

Resposta

Response for status 200

video_id
string
obrigatório

Generated video ID. Pass it to POST /videos/upload/complete after the PUT.

upload_url
string
obrigatório

Presigned PUT URL — upload the raw bytes here.

expires_in
number
obrigatório

Seconds until upload_url expires.

Última modificação em 7 de julho de 2026