Start a property photo upload
Starts an upload for the property's main photo and returns where to send the bytes. Nothing is attached to the property until you call set-photo with the session id.
Authorization
AuthorizationstringrequiredPath parameters
propertyIdstringrequiredSnowflake id of the property, as a decimal string.
Body
application/json
Describe the file you are about to upload. MagicDoor checks it against the rules for a property photo and hands back somewhere to POST the bytes to.
fileNamestringrequiredThe file's name including its extension, 1 to 250 characters. MagicDoor uses the extension when it decides whether the file is allowed.
fileSizeintegerrequiredSize of the file in bytes. Must be at least 1.
contentTypestringrequiredMIME type of the file, 1 to 200 characters, for example "image/jpeg".
Response
200 · An upload session. Nothing has been attached yet.
sessionIdstringSnowflake id of the session. Pass it back as uploadSessionId when you set the property's photo.
endpointstringThe absolute URL to send the file to. It belongs to the storage provider, not to MagicDoor, so do not add the MagicDoor bearer token to that request.
methodstringThe HTTP method to use against endpoint, for example "POST".
fieldsobjectExtra form fields the storage provider requires with the upload, as a map of field name to value. Send them alongside the file. It can be empty when the provider needs none.
expiresstring · date-timeWhen the session stops accepting the upload. A wall clock in the company's timezone, with no offset.
400 · `fileName`, `fileSize` or `contentType` is missing, blank, or outside its length limits, or `fileSize` is below 1. The response carries an `errors` member mapping each rejected field name to its message.
422 · The file storage service refused the session — usually a content type or size that is not allowed for a property photo.
401 · The access token is missing, expired, or not for this company.
404 · No property with that id, or it belongs to another company.
- Ask for a session
Call this endpoint with the file's name, size and content type.
- Upload the bytes
Send the file to the
endpointthe response gives you, using itsmethod, and include every entry offieldswith it. That request goes to the storage provider, so it does not carry your MagicDoor token. - Attach it
Call Set a property's photo on the same property, passing this session's id as
uploadSessionId. Or pass it asimageSessionIdwhen creating or updating the property.