Skip to main content
POST
/
v1
/
sources
Create a new source upload (video or image)
curl --request POST \
  --url https://api.tella.com/v1/sources \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "duration": 1,
  "height": 123,
  "width": 123
}
'
import requests

url = "https://api.tella.com/v1/sources"

payload = {
"duration": 1,
"height": 123,
"width": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({duration: 1, height: 123, width: 123})
};

fetch('https://api.tella.com/v1/sources', 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.tella.com/v1/sources",
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([
'duration' => 1,
'height' => 123,
'width' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$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.tella.com/v1/sources"

payload := strings.NewReader("{\n \"duration\": 1,\n \"height\": 123,\n \"width\": 123\n}")

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

req.Header.Add("Authorization", "Bearer <token>")
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.tella.com/v1/sources")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"duration\": 1,\n \"height\": 123,\n \"width\": 123\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.tella.com/v1/sources")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"duration\": 1,\n \"height\": 123,\n \"width\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "expiresAt": "2023-11-07T05:31:56Z",
  "sourceId": "<string>",
  "uploadUrl": "<string>"
}
{
"error": {
"code": "bad_request",
"doc_url": "https://tella.tv/docs/api-reference/errors#bad-request",
"message": "The request was malformed or contained invalid parameters."
}
}
{
"error": {
"code": "unauthorized",
"doc_url": "https://tella.tv/docs/api-reference/errors#unauthorized",
"message": "Authentication is required. Provide a valid API key."
}
}
{
"error": {
"code": "forbidden",
"doc_url": "https://tella.tv/docs/api-reference/errors#forbidden",
"message": "You don't have permission to access this resource."
}
}
{
"error": {
"code": "not_found",
"doc_url": "https://tella.tv/docs/api-reference/errors#not-found",
"message": "The requested resource was not found."
}
}
{
"error": {
"code": "unprocessable_entity",
"doc_url": "https://tella.tv/docs/api-reference/errors#unprocessable-entity",
"message": "The request was well-formed but contained semantic errors."
}
}
{
"error": {
"code": "rate_limit_exceeded",
"doc_url": "https://tella.tv/docs/api-reference/errors#rate-limit-exceeded",
"message": "You have exceeded the rate limit. Please slow down."
}
}
{
"error": {
"code": "internal_server_error",
"doc_url": "https://tella.tv/docs/api-reference/errors#internal-server-error",
"message": "An unexpected error occurred on the server."
}
}

Authorizations

Authorization
string
header
required

API key obtained from your Tella account settings

Body

application/json

Create a new source upload (video, audio, or image). Returns a pre-signed S3 URL to PUT the bytes to, plus a sourceId to reference from clips, layouts, overlays, backgrounds, and sound effects.

duration
number

Duration in seconds. Required for video and audio; ignored for image.

Required range: x > 0
height
integer

Height in pixels. Required for video and image; omit for audio.

Required range: x <= 9007199254740991
kind
enum<string>

Source kind: video (default), audio (e.g. sound effects), or image.

Available options:
video,
audio,
image
width
integer

Width in pixels. Required for video and image; omit for audio.

Required range: x <= 9007199254740991

Response

OK

expiresAt
string<date-time>
required

ISO-8601 timestamp at which uploadUrl stops accepting uploads.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
sourceId
string
required

ID of the new source.

uploadUrl
string<uri>
required

Pre-signed S3 URL. PUT the file bytes here (single PUT, max ~5GB). Upload the file as-is: any common container is accepted (MP4, MOV, WebM, MP3, WAV, M4A, …) — the .mp4 in the URL path is just the storage key, not a container requirement.