Start a file upload for a maintenance request
Asks for a one-time upload slot for a photo, video or PDF you want to attach to a maintenance request. This endpoint does not take the file — it hands back where to PUT or POST the bytes, and a session id you then pass to Attach files to a maintenance request. Requires the maintenance_requests:write permission.
Authorization
AuthorizationstringrequiredPath parameters
maintenanceRequestIdstringrequiredThe maintenance request to act on. A Snowflake id, sent as a decimal string.
Body
application/json
fileNamestringrequiredThe file's name, kept as the stored name. Between 1 and 250 characters.
fileSizeintegerrequiredSize of the file in bytes. At least 1, and at most 20971520 (20 MB) for a maintenance request file.
contentTypestringrequiredThe file's MIME type. Maintenance request files accept any image/* or video/* type, and application/pdf. Between 1 and 200 characters.
Response
200 · Where to send the bytes.
sessionIdstringrequiredThe upload session. Pass this as uploadSessionId once the bytes are up.
endpointstringrequiredThe URL to send the file to. It is pre-signed and belongs to the storage provider, not to this API.
methodstringrequiredThe HTTP method to use against endpoint, for example PUT or POST.
fieldsobjectrequiredExtra form fields the storage provider needs, as name-to-value pairs. Send them with the file when method is POST; the object is empty when none are needed.
expiresstring · date-timerequiredWhen the slot stops accepting the file, in the company's timezone and without an offset.
400 · The file name, size or content type is missing or outside the allowed range.
401 · The request carried no valid access token.
403 · The token is not a property manager token, or it lacks the `maintenance_requests:write` permission.
404 · No such maintenance request, or it belongs to another company.
- Ask for a slot
Call this endpoint with the file's name, size and type. You get back
sessionIdand anendpoint. - Send the bytes
Send the file to
endpointusing themethodyou were given, including every name and value infields. This goes to the storage provider directly, not to the MagicDoor API. - Attach it
Call Attach files to a maintenance request with the
sessionId. Until you do, the file is not on the request.