Skip to main content
Silo entries can store files as attachments, such as PDF invoices, XML documents, or other supporting files. This guide explains how to upload files to silo entries using the API.

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.
Both endpoints support the same features and parameters. Most applications use 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
To calculate the 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
Use the 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

cURL
cURL
cURL
The response will contain a url field that can be used to upload the file contents.

Response

This is an example response from the file upload endpoints:
View them detailed response fields in our File Upload API Reference.

Fetching files

After uploading a file, you can retrieve it using the Fetch a File endpoint:
cURL
The response will contain the file data with the appropriate Content-Type and Content-Disposition headers set according to the fileโ€™s source.

Best practices

  1. 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.
  2. Provide file metadata โ€” Include key, desc, and category to make files easier to identify and organize.
  3. Verify uploads โ€” Check the stored field in the response to confirm the file was uploaded successfully.
  4. Use appropriate categories โ€” Use format for alternative invoice formats (PDF, XML) and attachment for supporting documents.
  5. Set privacy flags โ€” Use the private flag for sensitive files that shouldnโ€™t be publicly accessible.