Skip to content
API Now! is currently in closed beta. We are constantly updating these guides as we release updates!

FileURL (Semantic Module)

← Back to Modules Reference

The FileURL semantic module manages binary file attachments and downloadable assets—such as invoice PDFs, spreadsheet exports, legal contracts, and ZIP archives.

Decorating a property with FileURL connects it to API Now’s Two-Phase Upload Architecture. This allows your API to handle large file attachments safely by uploading binary files directly to cloud storage, enforcing maximum file size and MIME type allow lists, and protecting downloads with expiring signed URLs.


AttributeSpecification
ScopeProperty (Applied to a text property)
Data TypeString
Default Max Size10485760 bytes (10 MB)
Default Allowed MIME TypesAll non-executable binary files (or custom allow list)
Delivery MechanismTime-limited Read-Only Signed URLs (15-minute expiration)

Unlike ImageURL (which focuses on visual media and web image optimization), FileURL is tailored for non-image binary files. It supports PDF invoices, Microsoft Office / CSV spreadsheets, compressed archives, and text documents.

To accommodate comprehensive reports and multi-page documents, FileURL defaults to a 10 MB maximum file size limit (compared to 5 MB for images). This limit can be adjusted in the Domain Modeler configuration.

3. MIME Type Allow Lists (allowedMimeTypes)

Section titled “3. MIME Type Allow Lists (allowedMimeTypes)”

You can restrict uploads to specific document formats:

  • For an invoice management system: configure allowedMimeTypes: ['application/pdf'].
  • For a data import feature: configure allowedMimeTypes: ['text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'].
  • When left unconfigured, all safe, non-executable binary file formats are permitted.

Binary data is never transmitted directly through standard CRUD endpoints:

  1. Initiate (POST /.well-known/upload): Client requests an upload for a given filename and MIME type, receiving an expiring upload_url and a file_reference token.
  2. Upload (PUT upload_url): Client streams the binary file directly to storage.
  3. Persist: Client creates or updates the record, passing the file_reference token in the FileURL property.

Learn more about the underlying architecture in the File Uploads Guide.

5. Protected Downloads with Expiring Signed URLs

Section titled “5. Protected Downloads with Expiring Signed URLs”

Files stored via FileURL are not left open on public web buckets. When clients retrieve records (GET /invoices/inv_101), the engine transparently generates a temporary Signed URL valid for 15 minutes, protected by your entity’s role-based access rules.


When configuring the FileURL semantic in the Domain Modeler, you can adjust:

OptionTypeDefaultDescription
maxSizeInBytesnumber10485760 (10 MB)Maximum permitted file size in bytes.
allowedMimeTypesstring[]undefined (all non-executable files)Optional allow list of permitted MIME types.

The client initiates a PDF attachment upload:

POST /api/v1/.well-known/upload
Content-Type: application/json
{
"filename": "annual_report_2026.pdf",
"contentType": "application/pdf"
}

Server Response (200 OK):

{
"data": {
"file_reference": "ref_doc_4f92b710",
"upload_url": "https://storage.googleapis.com/app-bucket/tmp/ref_doc_4f92b710.pdf?GoogleAccessId=..."
}
}

After uploading the binary content to the upload_url, the client creates the invoice:

POST /invoices
Content-Type: application/json
{
"invoiceNumber": "INV-2026-001",
"totalAmount": 1250.00,
"pdfDocument": "ref_doc_4f92b710"
}

Server Response (201 Created):

{
"data": {
"id": "inv_101",
"invoiceNumber": "INV-2026-001",
"totalAmount": 1250.00,
"pdfDocument": "https://storage.googleapis.com/app-bucket/uploads/invoices/inv_101/pdfDocument.pdf?X-Goog-Signature=..."
}
}

Clients receive a fresh, temporary signed download link:

GET /invoices/inv_101

Server Response (200 OK):

{
"data": {
"id": "inv_101",
"invoiceNumber": "INV-2026-001",
"totalAmount": 1250.00,
"pdfDocument": "https://storage.googleapis.com/app-bucket/uploads/invoices/inv_101/pdfDocument.pdf?X-Goog-Signature=..."
}
}

  • FileURL: Document attachments, invoice PDFs, spreadsheets, ZIP archives, downloadable exports.
  • ImageURL: Visual media, user avatars, gallery images (with automatic WebP optimization).
  • URL: Standard external hyperlinks pointing to web pages.

  • Applicable Property Types: Apply to a String property in the Domain Modeler.
  • Length Constraints: String properties default to a Maximum Length of 255 characters, which easily accommodates internal file reference tokens.