Core Features

File Upload

Upload images and documents, generate images with AI, use OCR and image optimization, and link files to FILE Columns.

By the end of this guide, you will be able to upload files to Onttle, link them to FILE Columns in Contents, and take advantage of OCR and image optimization.

Prerequisites: A Project must be created. Uploading files requires a secret API Key (sk-proj_…) or dashboard access; publishable keys cannot upload.


Uploading Files from the Dashboard

  1. Click Files in the Project menu.
  2. Click Upload File or drag and drop files.
  3. For image files, you can select the Image Optimization option.
  4. For PDF or image files, selecting the OCR option automatically extracts text.
  5. After upload, you can view the file URL.

[IMAGE AREA] File upload screen (drag-and-drop area and options UI)


Generating an Image with AI

Instead of uploading a file you can describe an image and have one generated. The image is stored in Files like any other file: thumbnails are created and it can be linked to FILE Columns the same way.

  1. In Files, click Add file and choose Add new file or Add multiple files.
  2. Click Generate AI image.
  3. Describe the image (up to 1,000 characters). The more specific the subject, setting, style and colours, the better the result.
  4. Choose an aspect ratio.
  5. Click Generate. It usually takes 20 to 30 seconds; the image then appears with a preview and an AI badge.
  6. Save it as a file with the form's own button (Create in Add new file, Upload in Add multiple files).
Aspect ratio Size Generative AI tokens (per image)
Square (1:1) 1024 × 1024 about 85,000
Landscape (3:2) 1536 × 1024 about 126,000
Portrait (2:3) 1024 × 1536 about 126,000
  • One image at a time: a form holds one AI image. Remove it from the list to generate another.
  • Format: stored as WebP, usually 1 to 2 MB.
  • When it is charged: AI_GENERATION_TOKENS (generative AI tokens) are charged when you click Generate. Removing the image without saving it does not refund them. Saving it records the file metrics like any upload. See Metric Types for the credit calculation.
  • Checked first: generation does not start when credits are insufficient or file storage is full.
  • Permissions: owners, admins and editors.
  • AI-generated mark: a file made with AI is stored with meta.aiGenerated set to true. The dashboard shows an AI generated badge in the file list and the file details, and the flag is part of meta in API file responses. Replacing the file with another one removes it.
  • Editing a file: when you edit an existing file you can also use Generate AI image to make a new image that replaces it. It does not edit or restyle an existing image.

The same feature is available outside the dashboard forms.

Where How
Ask AI Ask for it ("make an image of a latte on a sunlit café table") and approve the card; the image is saved to Files
MCP server The onttle_generate_file_image tool. The preview shows the estimated credits; call again with the confirm token to save

The REST API (/v1) has no image generation endpoint.


Uploading Files via API

Use multipart/form-data to upload files via the REST API.

curl -X POST https://api.onttle.com/v1/{projectId}/files \
  -H "Authorization: Bearer $ONTTLE_API_KEY" \
  -F "file=@/path/to/image.jpg" \
  -F "isOcr=false"

TypeScript Example

async function uploadFile(file: File): Promise<string> {
  const formData = new FormData()
  formData.append('file', file)
  formData.append('isOcr', 'false')

  const res = await fetch(
    `https://api.onttle.com/v1/${process.env.ONTTLE_PROJECT_ID}/files`,
    {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.ONTTLE_API_KEY}`,
      },
      body: formData,
    },
  )

  if (!res.ok) {
    throw new Error(`Upload failed: ${res.status}`)
  }

  const data = await res.json()
  return data.id // ID of the uploaded file (uuid)
}

Response Example

{
  "id": "3f2a1c8e-9b6d-4a11-8f3a-2d7c5e0b1a4f",
  "name": "image.jpg",
  "description": null,
  "meta": {
    "name": "image.jpg",
    "extension": "jpg",
    "lastModified": 1735500000000,
    "size": 204800,
    "type": "image/jpeg",
    "width": 1920,
    "height": 1080,
    "exif": null
  },
  "s3_path": "https://file.onttle.com/uploads/original/2026/11/12/image.jpg",
  "presigned_url": "https://file.onttle.com/uploads/original/2026/11/12/image.jpg?expires=1794470400&signature=…",
  "thumbnails": [],
  "text_vision": null,
  "description_generated": null,
  "keywords": []
}

The file id is a uuid-formatted string.


Linking Files to a FILE Column

Link an uploaded file to a FILE Column in a Contents item.

  1. When editing Contents in the dashboard, click the Select File button on a FILE-type Column.
  2. Choose from the already-uploaded file list or upload a new file.

When creating or updating Contents via the API, use the file ID.

// Use the file ID received after upload when creating Contents
const res = await fetch(
  `https://api.onttle.com/v1/{projectId}/tables/posts`,
  {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.ONTTLE_API_KEY}`,
      'Content-Type': 'application/json',
    },
    // Column names are top-level keys of the body (do not wrap them in `data`)
    body: JSON.stringify({
      title: 'New Post',
      thumbnail: '3f2a1c8e-9b6d-4a11-8f3a-2d7c5e0b1a4f', // Uploaded file ID (uuid)
    }),
  },
)

Image Optimization

You can configure thumbnails directly from the Files → Image thumbnail settings button. Define presets with a display name and pixel size, and any image file uploaded afterward will automatically generate thumbnails at the specified sizes.

  • Preset changes apply only to files uploaded after the change; existing thumbnails are not affected.
  • Thumbnails larger than the original image are never generated.
  • The generated thumbnails can be viewed in the thumbnails field of the file response.

OCR (Text Extraction)

Enabling the OCR option when uploading image (JPG, PNG, etc.) or PDF files causes a Vision model to automatically extract text and metadata.

  • The extracted text is stored in the text_vision field of the file response.
  • The automatically generated description and keywords are stored in the description_generated and keywords fields, respectively.
  • This information is also used later for Vector embedding generation.
  • OCR usage is recorded under the FILE.OCR.CALLS metric.
  • Files already uploaded: if you did not select it at upload, run it from the dashboard's edit-file form. A file without extracted text shows Extract OCR text; a file without a description and keywords shows Generate keywords and description with AI. Tick one and save: the file stays as it is, only that information is added, and the same metrics are recorded as at upload.
# Upload with OCR enabled
curl -X POST https://api.onttle.com/v1/{projectId}/files \
  -H "Authorization: Bearer $ONTTLE_API_KEY" \
  -F "file=@/path/to/document.pdf" \
  -F "isOcr=true"

EXIF Tags

When an image file is uploaded, its EXIF metadata (capture device, capture date, GPS coordinates, etc.), if present, is automatically extracted and stored in the meta.exif field of the file response.

  • You can view the extracted EXIF tags and their count in the file edit screen of the dashboard.
  • For images without EXIF information, meta.exif is null.

Replacing and Deleting Files

Replacing a File

To replace an existing file with a new one, send a PUT /files/{fileId} request including the new file. FILE.UPLOAD.CALLS and FILE.UPLOAD.BYTES are recorded again for the replacement.

Deleting a File

curl -X DELETE https://api.onttle.com/v1/{projectId}/files/{fileId} \
  -H "Authorization: Bearer $ONTTLE_API_KEY"

After deletion, the file link is removed from any Contents that referenced it.

A deleted file moves to the Trash, and on the Pro plan and above it can be restored within the retention period. Restoring does not reconnect the removed file links, so set the file again on the Contents that need it.

History

In the dashboard file list, open History in the item menu (the more menu or a right-click) to see, for each version, the file's name, file info (file name, type, size, resolution), OCR text, summary and keywords, with who changed them and when. Changed items are marked with • next to their label. Uploads, file replacements, deletions and restores are recorded too.


Error Handling

Error Cause Resolution
400 Bad Request Unsupported file format Check the allowed MIME types
413 Payload Too Large File size exceeded Reduce file size or use image optimization before retrying
401 Unauthorized Missing or invalid API Key Verify the Authorization header

Next Steps

  • Usage & Billing - Metric Types — Understand how file-related metrics are recorded.
  • Ask AI (Assistant) — Search files, get download links and usage, extract text from images and PDFs, and generate images from a description through the assistant.