API reference / Uploads

Create an upload

POST/v1/uploads

fileName must have a supported file extension, or .zip for a project ZIP; its kind's size limit applies (413 too_large). Up to 100 MB: one presigned PUT URL, valid 1 hour. Above 100 MB (up to 8 GB): a multipart upload with a presigned URL per 64 MB part; PUT each part and keep each response's ETag. Multipart uploads stay open 24 hours; part URLs last 1 hour and can be issued again. Each URL accepts exactly its declared number of bytes. Then complete the upload, and use its id once: in an edit, a new project, a ZIP import, or a replacement's file in a render or batch render. A workspace can hold 100 unused uploads; another gets 409 upload_limit. sizeBytes over the plan's project size (limits.maxProjectBytes in the usage) is refused with 403 project_too_large, except for a ZIP, which its import checks.

Request

curl -s -X POST $BLITFRAME/uploads \
  -H "Authorization: Bearer $BLITFRAME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fileName": "background.mp4", "sizeBytes": 48211933}'
import os, requests

response = requests.post(
    f"{os.environ['BLITFRAME']}/uploads",
    headers={"Authorization": f"Bearer {os.environ['BLITFRAME_API_KEY']}"},
    json={"fileName": "background.mp4", "sizeBytes": 48211933},
)
print(response.json())
const response = await fetch(`${process.env.BLITFRAME}/uploads`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.BLITFRAME_API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ fileName: "background.mp4", sizeBytes: 48211933 }),
});
console.log(await response.json());
<?php
$request = curl_init(getenv("BLITFRAME") . "/uploads");
curl_setopt_array($request, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("BLITFRAME_API_KEY"),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => '{"fileName": "background.mp4", "sizeBytes": 48211933}',
]);
$response = curl_exec($request);
echo $response;
require "net/http"

uri = URI(ENV["BLITFRAME"] + '/uploads')
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer " + ENV["BLITFRAME_API_KEY"]
request["Content-Type"] = "application/json"
request.body = '{"fileName": "background.mp4", "sizeBytes": 48211933}'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
puts response.body
package main

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

func main() {
	body := strings.NewReader(`{"fileName": "background.mp4", "sizeBytes": 48211933}`)
	request, err := http.NewRequest("POST", os.Getenv("BLITFRAME")+"/uploads", body)
	if err != nil {
		panic(err)
	}
	request.Header.Set("Authorization", "Bearer "+os.Getenv("BLITFRAME_API_KEY"))
	request.Header.Set("Content-Type", "application/json")
	response, err := http.DefaultClient.Do(request)
	if err != nil {
		panic(err)
	}
	defer response.Body.Close()
	text, _ := io.ReadAll(response.Body)
	fmt.Println(string(text))
}
using System.Net.Http.Headers;
using System.Text;

using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post,
    Environment.GetEnvironmentVariable("BLITFRAME") + "/uploads");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("BLITFRAME_API_KEY"));
request.Content = new StringContent(
    """
    {"fileName": "background.mp4", "sizeBytes": 48211933}
    """, Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
    public static void main(String[] args) throws Exception {
        var request = HttpRequest.newBuilder(URI.create(System.getenv("BLITFRAME") + "/uploads"))
            .header("Authorization", "Bearer " + System.getenv("BLITFRAME_API_KEY"))
            .header("Content-Type", "application/json")
            .method("POST", HttpRequest.BodyPublishers.ofString("""
                {"fileName": "background.mp4", "sizeBytes": 48211933}
                """))
            .build();
        var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}

Headers

  • AuthorizationBearer Blitframe API keyrequired

    API key from the developer console.

Body

application/json · required · CreateUploadRequest

  • fileNamestringrequired
  • sizeBytesinteger (int64)required

Try it

POST/v1/uploads

Used for the requests you send from this page only. It is not saved.

This sends a real request to your workspace: a render spends render seconds, and a delete is final.

Response

Send the request to see the answer here.

Responses

  • 201 Created

application/json · UploadDto

  • idstring (uuid)
  • One of open processing ready failed

  • urlstring or null
  • methodstring or null
  • expiresAtstring (date-time)
  • multipartMultipartDto or null
    MultipartDto fields
    • partSizeinteger (int64)
    • partCountinteger
    • urlsExpireAtstring (date-time)
    • partsarray of UploadPartDto
      UploadPartDto fields
      • partNumberinteger
      • urlstring
  • errorApiError or null
    ApiError fields
    • codestring
    • messagestring

Errors

  • 400 Bad Request
  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not Found
  • 409 Conflict
  • 413 Payload Too Large
  • 429 Too Many Requests

application/json · ErrorResponse

  • ApiError fields
    • codestring
    • messagestring

Errors lists the error codes and says when to retry.