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 the 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.

Embed attachments in UBL and CII documents

The OASIS UBL and UN/CEFACT CII generate actions can embed supporting documents, such as delivery notes, timesheets, or purchase orders, directly inside the XML they produce. Each file is included as a base64 binary object, so the recipient gets the attachments with the invoice and doesn’t have to download them separately. To embed attachments:
1

Upload the files to the silo entry

Upload each file with "category": "attachment", using either of the upload options above. Use desc to give the file a description, which becomes the attachment description in the XML.
cURL
2

Enable the option in the workflow

In the Generate UBL document or Generate CII document step, enable Embed Attachments. In the workflow JSON this is "embed_attachments": true in the step’s config.
When the step runs, every file in the attachment category that has finished uploading (stored is true) is embedded. Keep the following in mind:
  • Linked attachments are replaced, not repeated. If the invoice’s attachments already links to the file, using the silo file ID as the attachment code, the link is replaced by the embedded content. The description from the invoice is kept.
  • Supported file types. EN 16931 (rule BR-CL-24) only accepts PDF, PNG, JPEG, CSV, XLSX and ODS attachments. Other types fail validation.
  • French CTC descriptions. For the Peppol France formats, the description must be one of the codes allowed by BR-FR-17, such as BON_COMMANDE, BON_LIVRAISON or RIB. Any other description is replaced with PJA (additional supporting document). LISIBLE is reserved for the invoice PDF.
  • Chorus Pro. Each attachment is ZIP-compressed and identified by its file name, as Chorus Pro requires. Files over 100 MB are rejected.
  • Failed downloads stop the step. If a file cannot be downloaded, the step fails rather than sending the invoice without it.
The invoice PDF is handled by the separate Attach Invoice PDF option, which embeds the file with key pdf in the format category. Both options can be enabled together.

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.