Skip to main content
POST
cURL

File Upload Process

The v3 file upload API provides a secure two-step process for uploading files to Tela’s storage:
  1. Request an upload URL - Call the /v3/files endpoint to get a temporary upload URL
  2. Upload your file - Use the returned upload URL to upload your file content directly

Step 1: Get Upload URL

First, request a temporary upload URL by providing the filename:
The response will include:
  • id: The unique identifier for your file
  • uploadUrl: A temporary URL to upload your file content

Step 2: Upload File Content

Use the uploadUrl from the previous step to upload your file content:
The upload URL is temporary and will expire after a short period. Make sure to upload your file promptly after receiving the URL.

Using the File ID

After successfully uploading your file, you can use the UUID returned in Step 1 to reference the file in other API endpoints:

Request Headers

Required Headers

  • Authorization: Bearer token for authentication
  • x-compatibility-date: API version compatibility date (e.g., 2025-07-23)

Content Types

When uploading the file content in Step 2, set the appropriate Content-Type header:
  • text/plain for text files
  • application/json for JSON files
  • image/png, image/jpeg for images
  • application/pdf for PDF files
  • And other standard MIME types as needed
While some HTTP clients may attempt to infer the Content-Type from the file, it’s best practice to explicitly set the Content-Type header to ensure proper file handling. This is especially important for binary files and when the file extension doesn’t match the actual content type.

Complete Example

Here’s a complete example showing the entire file upload process:

Using Uploaded Files in Completions

After uploading files, you can use them in your canvas completions with the vault:// URL scheme:
The vault:// URL scheme provides secure access to your uploaded files. These URLs can only be accessed within your workspace context and are ideal for processing sensitive documents.

Authorizations

Authorization
string
header
required

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

Headers

x-compatibility-date
string<date>
required

API version compatibility date (e.g., 2025-07-23)

Body

application/json
fileName
string
required

The name of the file to upload

Response

Successful creation of upload URL

id
string
required

Unique identifier for the uploaded file

uploadUrl
string
required

Temporary URL to upload the file content