Uploads
Manages file attachments within the app. Files are stored in AWS S3 under /files/{company_id}/{model}/{filename}. Photo uploads also generate a thumbnail prefixed with t_.
There are two ways to upload a file:
Direct to S3 (preferred)
Sign Upload → PUT → Complete Upload
2 GB
Bytes go straight to storage; no proxy limit
Through the API (legacy)
Create Upload (+ Confirm Upload)
100 MB
Single request; still fully supported
Access control
Any authenticated user may create an upload by either path. Uploads are scoped to the caller's company, which the server reads from the session — it is never taken from the request, so a client cannot write into another company's storage. Complete Upload additionally requires the caller to be the same user who signed the upload. No user_group_id restriction and no plan gate applies to creating uploads; the exception for External Auditors on listing is documented under List Uploads.
List Uploads
GET /uploads/index/{model}/{foreignKey}.json
List active uploads for a given model record. Scoped to the authenticated user's company. Results are paginated.
Callers with user_group_id 250 (External Auditor) requesting model = UserCertificate get every row's url (and thumb_url) omitted — they can see that a file exists but cannot fetch it. This exception is specific to UserCertificate; every other model is unaffected.
Path Parameters
model
string
Model name (e.g. Aircraft, Flight)
foreignKey
string
ID of the related record
Pagination Headers
X-Total-Posts
Total number of uploads
X-Actual-Page
Current page
X-Paging-recs
Records on current page
X-Paging-limit
Page size limit (default 50)
X-Paging-Prev-Page
Whether a previous page exists
X-Paging-Next-Page
Whether a next page exists
X-Number-Pages
Total number of pages
Response
View Upload
GET /uploads/view/{id}.json
Retrieve full details of a single upload, including EXIF data if available.
Path Parameters
id
string
Upload UUID
Response
Download Upload
GET /uploads/download/{id}.json
Redirects to the file's AWS S3 URL for direct download. Scoped to the authenticated user's company.
Path Parameters
id
string
Upload UUID
Sign Upload
POST /uploads/sign.json
Start a direct-to-S3 upload. Returns a short-lived presigned URL that the client PUTs the file bytes to, without the file passing through the API server.
Prefer this over Create Upload for anything large: the bytes never traverse the origin, so the 100 MB proxy limit that applies to create.json does not apply here. The maximum file size on this path is 2 GB.
The flow is three steps:
POST /uploads/sign.json— returnsurlandupload_id.PUTthe raw file bytes tourl. Send noAuthorizationheader and no extra headers — the URL carries its own credentials, and additional headers break the signature.POST /uploads/complete/{upload_id}.json— verifies and activates the upload.
The presigned URL is valid for 15 minutes. An upload that is signed but never completed is deleted automatically after 24 hours.
Request Body
filename
string
Yes
Original file name; used for the extension and display
mime
string
Yes
MIME type, validated against the supported types below
size
integer
Yes
File size in bytes; must be ≤ 2 GB
model
string
Yes
Model name to associate (e.g. Aircraft)
foreign_key
string
Yes
Foreign key of the related record
Response
Errors
400
Missing parameters, unsupported MIME type, invalid size, or size above 2 GB
404
No authenticated user
Complete Upload
POST /uploads/complete/{id}.json
Verify and activate an upload that was signed with Sign Upload and PUT to S3. No request body.
The server confirms the object exists, takes its real size from storage (the size declared at sign time is only a hint), and inspects the file's leading bytes to check they are consistent with the declared MIME type. A file that fails verification is deleted from storage and its record removed.
For images, this call also extracts EXIF data and pixel dimensions and generates the thumbnail.
Idempotent — calling it again on an already-active upload returns the same record without reprocessing.
Path Parameters
id
string
Upload UUID returned as upload_id by Sign Upload
Response
Identical in shape to Create Upload:
Errors
400
Object missing from storage, empty, above 2 GB, or its content does not match the declared type
404
Upload not found, or it belongs to another user
405
Not a POST request
Create Upload
POST /uploads/create.json
Upload a new file through the API server. Accepts multipart/form-data. File is saved to a temporary location and marked active: false until confirmed. If active, model, and id are provided, the upload is confirmed immediately.
This endpoint remains fully supported. Note that requests are subject to a 100 MB limit imposed by the CDN proxy in front of the API — use Sign Upload for larger files.
Supported MIME Types
photo
image/*
video
video/*
document
PDF, Office, etc.
sound
audio/*
other
Other allowed types
Request Body (multipart/form-data)
file
file
Yes
File to upload
active
boolean
No
If true, confirm immediately (requires model and id)
model
string
No
Model name to associate (e.g. Aircraft)
id
string
No
Foreign key of the related record
acl
string
No
S3 ACL override
Response
Confirm Upload
POST /uploads/confirm/{id}.json
Confirm a previously uploaded file: moves it to its final S3 path and sets active: true. The upload must belong to the authenticated user.
Path Parameters
id
string
Upload UUID to confirm
Request Body
model
string
Yes
Model name to associate (e.g. Flight)
foreign_key
string
Yes
ID of the related record
Response
Set Upload Expiration
POST /uploads/expiration/{id}.json
Set or clear the expiration date of an upload. Admins (user_group_id ≤ 170) can update any upload in the company; regular users can only update their own.
Path Parameters
id
string
Upload UUID
Request Body
expiration
string|timestamp
Yes
Date string or Unix timestamp. Send empty to clear.
Response
Delete Upload
GET /uploads/delete/{id}.json
Delete an upload record and remove the file from AWS S3. Admins (user_group_id ≤ 170) can delete any upload in the company; regular users can only delete their own.
Path Parameters
id
string
Upload UUID
Response
Last updated