Skip to main content
POST
/
files
Upload File
curl --request POST \
  --url https://api.tess.im/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file' \
  --form process=false
import requests

url = "https://api.tess.im/files"

files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "process": "false" }
headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.text)
const form = new FormData();
form.append('file', '<string>');
form.append('process', 'false');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

fetch('https://api.tess.im/files', 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.tess.im/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"process\"\r\n\r\nfalse\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);

$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.tess.im/files"

payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"process\"\r\n\r\nfalse\r\n-----011000010111000001101001--")

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

req.Header.Add("Authorization", "Bearer <token>")

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.tess.im/files")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"process\"\r\n\r\nfalse\r\n-----011000010111000001101001--")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.tess.im/files")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"process\"\r\n\r\nfalse\r\n-----011000010111000001101001--"

response = http.request(request)
puts response.read_body
Maximum 32 MB per file on this endpoint. This single-shot POST /files endpoint sends the file body through the API server, which has a hard 32 MB inbound request size limit. Files larger than 32 MB are rejected before they reach the application layer.For files larger than 32 MB, use the v2 signed-upload flow instead. It uploads the file body directly from your client to Google Cloud Storage (the API server is not in the data path) and supports files up to 200 MB.

Supported files

LabelFile Pattern(s)
Text*.txt
Word*.{doc,docx}
Spreadsheet*.csv
PDF*.pdf
Excel*.xls,*.xlsx
Power Point*.{ppt,pptx}
Image*.{jpg,jpeg,png,gif,bmp,svg,tiff,webp}
Video*.{mp4,avi,mov,mkv,wmv,flv}
Audio*.{mp3,wav,aac,ogg,flac,m4a}
Code*.bas, *.bat, *.xml, *.css, *.dart, *.{html,htm}, *.inc, *.js, *.json, *.kt, *.lua, *.pas, *.php, *.pl, *.ps1, *.py, *.r, *.sh, *.vsd, *.sql, *.swift, *.ts, *.vb, *.vba, *.{yml,yaml}, *.md

Limits

  • Maximum file size per upload on this endpoint: 32 MB (platform inbound HTTP request size limit). For files up to 200 MB use the v2 signed-upload flow.
  • This endpoint accepts one file per request (use multiple requests for multiple files).
  • File storage limit: 30 files
  • Some features have different limits:
    • Chat attachments: up to 200 MB per file via the v2 signed-upload flow; up to 5 files per send
    • Audio transcription: up to 10 MB per file

Code Examples

curl --request POST \
  --url 'https://api.tess.im/files' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: multipart/form-data' \
  --form 'file=@/path/to/file' \
  --form 'process=false'
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');

const form = new FormData();
form.append('file', fs.createReadStream('/path/to/file'));
form.append('process', 'false');

const config = {
  method: 'post',
  url: 'https://api.tess.im/files',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    ...form.getHeaders()
  },
  data: form
};

try {
  const response = await axios(config);
  console.log(response.data);
} catch (error) {
  console.error(error);
}
import requests

url = "https://api.tess.im/files"
headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}
files = {
    'file': open('/path/to/file', 'rb')
}
data = {
    'process': 'false'
}

response = requests.post(url, headers=headers, files=files, data=data)
print(response.json())
<?php
$curl = curl_init();

$file = new CURLFile('/path/to/file');

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.tess.im/files",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => [
    'file' => $file,
    'process' => 'false'
  ],
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer YOUR_API_KEY",
    "Content-Type: multipart/form-data"
  ]
]);

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

curl_close($curl);

if ($err) {
  echo "Error: " . $err;
} else {
  echo $response;
}
import java.io.File;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String boundary = "---boundary" + System.currentTimeMillis();
File file = new File("/path/to/file");

HttpClient client = HttpClient.newBuilder().build();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.tess.im/files"))
    .header("Authorization", "Bearer YOUR_API_KEY")
    .header("Content-Type", "multipart/form-data;boundary=" + boundary)
    .POST(HttpRequest.BodyPublishers.ofFile(file.toPath()))
    .build();

HttpResponse<String> response = client.send(request,
    HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
package main

import (
    "bytes"
    "fmt"
    "io"
    "io/ioutil"
    "mime/multipart"
    "net/http"
    "os"
)

func main() {
    file, err := os.Open("/path/to/file")
    if err != nil {
        fmt.Println(err)
        return
    }
    defer file.Close()
    
    body := &bytes.Buffer{}
    writer := multipart.NewWriter(body)
    
    part, err := writer.CreateFormFile("file", "filename")
    if err != nil {
        fmt.Println(err)
        return
    }
    io.Copy(part, file)
    
    
    writer.WriteField("process", "false")
    writer.Close()
    
    client := &http.Client{}
    req, err := http.NewRequest("POST", "https://api.tess.im/files", body)
    if err != nil {
        fmt.Println(err)
        return
    }
    
    req.Header.Add("Authorization", "Bearer YOUR_API_KEY")
    req.Header.Add("Content-Type", writer.FormDataContentType())
    
    resp, err := client.Do(req)
    if err != nil {
        fmt.Println(err)
        return
    }
    defer resp.Body.Close()
    
    respBody, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        fmt.Println(err)
        return
    }
    
    fmt.Println(string(respBody))
}
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        using (var client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");
            
            using (var formData = new MultipartFormDataContent())
            {
                var fileContent = new ByteArrayContent(File.ReadAllBytes("/path/to/file"));
                formData.Add(fileContent, "file", "filename");
                formData.Add(new StringContent("false"), "process");
                
                try
                {
                    var response = await client.PostAsync("https://api.tess.im/files", formData);
                    response.EnsureSuccessStatusCode();
                    string responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine(responseBody);
                }
                catch(HttpRequestException e)
                {
                    Console.WriteLine("\nException Caught!");
                    Console.WriteLine("Message :{0} ",e.Message);
                }
            }
        }
    }
}
require 'uri'
require 'net/http'
require 'json'

uri = URI('https://api.tess.im/files')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer YOUR_API_KEY'

form_data = [
  ['file', File.open('/path/to/file')],
  ['process', 'false']
]
request.set_form form_data, 'multipart/form-data'

response = http.request(request)
puts response.read_body

Response

{
"id": 73325,
"object": "file",
"bytes": 35504128,
"created_at": "2025-01-05T22:26:27+00:00",
"filename": "endpoints.pdf",
"credits": 0,
"status": "waiting"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-workspace-id
integer

ID of the workspace. If not provided, the user's selected workspace will be used.

Body

multipart/form-data
file
file
required

The file to upload. Maximum size: 32 MB (platform inbound request size limit). Use the v2 signed-upload flow for files larger than 32 MB.

process
boolean
default:false

Whether to process the file after upload.

Response

200

File uploaded successfully.