Every processing request includes a documents array. Each document must have a type field that determines how Matil receives the content.
URL
Send a direct download link. Matil fetches the file and processes it.
The URL must point directly to the file. Links that require authentication, redirect to a login page, or return HTML instead of the file will fail with a 400 error. For services like Google Drive or Dropbox, use the direct download URL, not the sharing link.
Base64
Send the file content encoded in base64. Always include mime_type so Matil knows how to process the file.
Send only the raw base64 string. Do not include the data:application/pdf;base64, prefix — that is a Data URI format used in browsers, not in API requests.
Encoding a file to base64
Text
Send plain text directly. This is useful for passing additional instructions or context alongside other documents, or for processing text that you already have extracted.
In this example, the first document is the actual file and the second provides extra context that helps Matil extract the data more accurately.
Multiple documents
You can send multiple documents in a single request. Matil processes them together as a single unit.
Each document accepts an optional metadata object for your own tracking: