Upload endpoints
You can upload files using either:- POST
/silo/v1/entries/{entry_id}/files
System generates the UUID. - PUT
/silo/v1/entries/{entry_id}/files/{id}
You specify the UUID.
POST and let the system generate UUIDs. However, PUT is useful when you need idempotent operations (safe retries with the same UUID), when integrating with external systems that have their own identifiers, or when you need to reference the file URL before the upload completes.
Upload options
Both endpoints support two upload methods:Inline upload (base64)
Upload the file data directly in the request body as base64-encoded content. This works well for smaller files.cURL
Placeholder with streaming upload
Create a placeholder file first, then upload the actual file contents to the URL provided in the response. This is useful for larger files or when you want to separate metadata creation from file upload.1
Create the placeholder
cURL
sha256 hash and size, use your programming languageโs built-in crypto and file system libraries. In Node.js, use the crypto module with createHash('sha256') and fs.statSync(). In Python, use hashlib.sha256() and os.path.getsize(). In Go, use crypto/sha256 and os.Stat(). Most languages provide similar standard library functions for these operations.2
Upload the file to the URL from the response
Success
url field from the response to upload the file contents. Note stored is false until the file is uploaded.cURL
Request parameters
The file upload endpoints accept the following parameters:Examples
Upload a PDF invoice
Upload a PDF invoice
cURL
Upload an XML file
Upload an XML file
cURL
Create a placeholder for large file upload
Create a placeholder for large file upload
cURL
url field that can be used to upload the file contents.Response
This is an example response from the file upload endpoints:Fetching files
After uploading a file, you can retrieve it using the Fetch a File endpoint:cURL
Content-Type and Content-Disposition headers set according to the fileโs source.
Best practices
- Use placeholders for large files โ For files larger than a few megabytes, create a placeholder first and upload via the streaming URL to avoid timeouts.
-
Provide file metadata โ Include
key,desc, andcategoryto make files easier to identify and organize. -
Verify uploads โ Check the
storedfield in the response to confirm the file was uploaded successfully. -
Use appropriate categories โ Use
formatfor alternative invoice formats (PDF, XML) andattachmentfor supporting documents. -
Set privacy flags โ Use the
privateflag for sensitive files that shouldnโt be publicly accessible.