Create a file upload session
Asks for a short-lived presigned upload target for a file you want to attach to a draft architectural request. Requires the hoa_architectural_requests:write permission.
Authorization
AuthorizationstringrequiredPath parameters
boardRequestIdstringrequiredThe architectural request to act on.
Body
application/json
fileNamestringrequiredName to store the file under. Between 1 and 250 characters.
fileSizeintegerrequiredExact size of the file in bytes. At least 1 and at most 20971520 (20 MB).
contentTypestringrequiredMIME type of the file, between 1 and 200 characters. Images, video, audio, PDF, Word and Excel documents, plain text, JSON, XML, ZIP, and 7z are accepted.
Response
200 · Where to upload the file, and until when.
sessionIdstringPass this to the add-files endpoint once the upload has finished.
endpointstringThe presigned URL to upload the bytes to.
methodstringThe HTTP method to use against endpoint, for example PUT or POST.
fieldsobjectExtra form fields the storage provider requires. Send them with the upload; empty for a plain PUT.
expiresstring · date-timeWhen the presigned target stops working, in the company's timezone.
400 · The request is not in `draft`, the file is larger than 20 MB, the content type is not allowed, `fileName`/`contentType` is empty or too long, `fileSize` is below 1, or the calling company is not in HOA business mode.
401 · The bearer token is missing, expired, or not valid.
403 · The token is valid but the caller does not hold the `hoa_architectural_requests:write` permission.
404 · No request with that id belongs to the calling company.
- Ask for an upload session
Call this endpoint with the file's name, exact byte size, and MIME type. You get back a presigned
endpointand asessionId. - Upload the bytes
Send the file to
endpointusing themethodreturned, including every entry infieldsas form data. This call does not go through the MagicDoor API. - Attach it to the request
Call Add files with the
sessionId. Until you do, the file is not on the request and the session eventually expires.
This is legal only while the request is in draft. Once it has been submitted for board voting the request's files are fixed, and you get 400 Bad Request with the detail Files can only be uploaded to draft board requests.
Every architectural request and board member endpoint first checks that the calling company is set up as an HOA. A company in any other business mode gets 400 Bad Request with the detail Company is not in HOA business mode.