The File Object

A file is a document, an image or a video stored in a workspace and attached to a check. Files
are written and read through two distinct identifiers: an upload_ref on the way in, a file id
on the way out.

Uploading

POST /v1/files/upload accepts one file as multipart/form-data, in a form field named file,
and returns a reference.

curl -X POST https://api.dotfile.com/v1/files/upload \
  -H "X-DOTFILE-API-KEY: $DOTFILE_API_KEY" \
  -F "file=@registration_certificate.pdf"
{
  "upload_ref": "dG1wL3Rlc3QtMTY3NDE0MjAzMjMxNy5wZGYsYXBwbGljYXRpb24vcGRmLHRlc3QucGRm",
  "expired_at": "2026-08-12T09:41:07.000Z"
}
ConstraintValue
Maximum size20 MB. Providers apply lower limits: see ID Document
Validityapproximately one day, returned as expired_at
Accepted formatsimage, office, text and archive formats. The complete list, with extensions and MIME types, is generated from the code on Upload a file
ResponseCondition
400the file is missing or empty
413the file exceeds 20 MB
415the format is not accepted

An uploaded file is not attached to anything until a check references it.

Attaching to a check

Two check types accept an upload_ref, at creation or on an existing check.

Check typeFieldConstraint
documentdata.files[].upload_refmaximum 10 files
id_documentdata.front_upload_ref, data.back_upload_refback_upload_ref is optional and null for a passport
curl -X POST https://api.dotfile.com/v1/checks/document \
  -H "X-DOTFILE-API-KEY: $DOTFILE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "company_id": "a7402197-0314-4c8f-8146-15ec0fa02193",
    "settings": {"document_type_key": "financial_statements"},
    "data": {"files": [{"upload_ref": "'$UPLOAD_REF'"}]}
  }'

A reference that has expired, or that no longer resolves to a stored file, is rejected with 400
and the check is not created. Add files and
Add files accept the same fields on an existing check.

Downloading

GET /v1/files/{id} returns the file content as binary/octet-stream. There is no metadata
endpoint: the file name and MIME type are not returned by this call.

curl https://api.dotfile.com/v1/files/$FILE_ID \
  -H "X-DOTFILE-API-KEY: $DOTFILE_API_KEY" \
  -o registration_certificate.pdf

File identifiers are returned on the object that carries the file:

SourceField
document checkdata.document_file_ids
id_document checkdata.information.front_file_id, back_file_id
id_verification checkdata.information.front_file_id, back_file_id, face_file_id, video_file_id, signature_file_id, and data.vendor.report_file_id
electronic_signature checkdata.information.file_id, signed_file_id
Case documentsfile_ids, from Retrieve case's documents
Document orderfile_id, once the order is completed

In a browser, request the file as a blob so that the API key stays in a header rather than in a
navigated URL:

import { saveAs } from 'file-saver';
import axios from 'axios';

const res = await axios.get(`https://api.dotfile.com/v1/files/${fileId}`, {
  responseType: 'blob',
  headers: { 'X-DOTFILE-API-KEY': process.env.DOTFILE_API_KEY },
});

saveAs(res.data, 'report.pdf');

There is no endpoint to list or to delete files. A file is reachable only through the object
that carries its identifier.

Endpoints