Start a document upload
Opens an upload session for a document on this application and returns where and how to send the bytes. Uploading is a three-step flow: start the session here, PUT or POST the file to the returned endpoint, then commit it. Requires the rental_applications:write permission.
Authorization
AuthorizationstringrequiredPath parameters
applicationIdstringrequiredThe rental application to work with. A Snowflake id, sent as a decimal string.
Body
application/json
fileNamestringrequiredThe file name to store, including its extension. Between 1 and 255 characters.
Response
200 · The upload session. Send the file to `endpoint` using `method`, including every entry in `fields` as form data, then commit the session.
idstringThe upload session. Pass this id to the commit call.
companyIdstringThe company the session belongs to.
categorystringWhat the file is being stored for. Always rentalApplication for these uploads.
fileNamestringThe file name you asked for.
statusenum<string>Where the session is. prepared on creation, uploaded once the bytes arrive, committed once the file is attached.
allowedTypesstring[]MIME types this session accepts. Fixed for rental-application documents at image/jpeg, image/png and application/pdf.
minSizeintegerSmallest accepted file size in bytes. 1 for rental-application documents.
maxSizeintegerLargest accepted file size in bytes. 10485760 — 10 MB — for rental-application documents.
endpointstringAbsolute URL to send the file to. This is the storage provider, not the MagicDoor API, and the host differs between environments — always use the value returned here.
methodstringHTTP method to use for the upload, for example "POST".
fieldsobjectForm fields the storage provider requires alongside the file. Send every one of them, unchanged.
expiresstring · date-timeWhen the session stops accepting an upload, in the company's timezone.
storageKeystringThe provider's object key for the upload.
referencestringWhat the session is bound to, as rental-application:{applicationId}. It is checked again on commit.
createdstring · date-timeWhen the session was created, in the company's timezone.
updatedstring · date-timeWhen the session last changed, in the company's timezone.
401 · The access token is missing, expired, or not valid.
403 · The caller is authenticated but does not hold the `rental_applications:write` permission.
404 · No rental application with this id exists, or it belongs to another company. Both cases look identical so that ids cannot be probed across companies.
This is not gated on the application's status — it works on a draft, on a submitted application, and on a retracted one. Only the applicant-facing portal locks an application once it is submitted.
- Start the session
Call this endpoint with the file name. Keep the
idand theendpoint,methodandfieldsit returns. - Send the bytes
Post the file to
endpointwithmethod, including every entry infieldsas form data and the file itself last. This request goes to the storage provider, not to MagicDoor, and does not carry your access token. - Commit the session
Call Attach an uploaded document with the session id to attach the file to the application.
Send the bytes and commit before expires. A session that lapses cannot be reopened — start a new one.