> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tess.im/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload File

> Upload a new file to the system and optionally process it.

> [!WARNING]
>
> **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](https://docs.tess.im/en/upload-file-v2.md) 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**

| **Label** | **File 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](https://docs.tess.im/en/upload-file-v2.md).
* 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**

```http cURL theme={null}
curl --request POST \
  --url 'https://api.tess.im/files' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'x-workspace-id: YOUR_WORKSPACE_ID' \
  --header 'Content-Type: multipart/form-data' \
  --form 'file=@/path/to/file' \
  --form 'process=false'
```

```json Node.js theme={null}
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',
      'x-workspace-id': 'YOUR_WORKSPACE_ID',
    ...form.getHeaders()
  },
  data: form
};

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

```python Python theme={null}
import requests

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

response = requests.post(url, headers=headers, files=files, data=data)
print(response.json())
```

```php PHP theme={null}
<?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",
      "x-workspace-id: YOUR_WORKSPACE_ID",
    "Content-Type: multipart/form-data"
  ]
]);

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

curl_close($curl);

if ($err) {
  echo "Error: " . $err;
} else {
  echo $response;
}
```

```java Java theme={null}
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("x-workspace-id", "YOUR_WORKSPACE_ID")
    .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());
```

```go Go theme={null}
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("x-workspace-id", "YOUR_WORKSPACE_ID")
    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))
}
```

```jsonnet .NET theme={null}
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");
            client.DefaultRequestHeaders.Add("x-workspace-id", "YOUR_WORKSPACE_ID");
            
            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);
                }
            }
        }
    }
}
```

```ruby Ruby theme={null}
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'
request['x-workspace-id'] = 'YOUR_WORKSPACE_ID'

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
```

### **Headers**

**x-workspace-id** `integer` *required*

Workspace ID. **Required as of 2026-09-01.** Until then, if omitted, the user's selected workspace is used (deprecated). After the cutoff, a missing header returns **422**.

### **Response**

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


## OpenAPI

````yaml api-reference/upload-file.openapi.json POST /files
openapi: 3.1.0
info:
  title: Tess API - Upload File
  version: 1.0.0
servers:
  - url: https://api.tess.im
security: []
paths:
  /files:
    post:
      summary: Upload File
      description: >-
        Upload a new file to the system and optionally process it. **Limited to
        32 MB per file by our platform's inbound HTTP request size limit.** For
        files larger than 32 MB, use the v2 signed-upload flow (POST
        /v2/files/sign + browser/SDK PUT to GCS + POST /v2/files/register).
      parameters:
        - name: x-workspace-id
          in: header
          required: true
          description: >-
            Workspace ID. Required as of 2026-09-01. Until then, if omitted, the
            user's selected workspace is used (deprecated). After the cutoff, a
            missing header returns 422.
          schema:
            type: integer
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: >-
                    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:
                  type: boolean
                  default: false
                  description: Whether to process the file after upload.
      responses:
        '200':
          description: File uploaded successfully.
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.