Property managers

Create a profile photo upload session

Reserves an upload slot for a property manager's profile photo. Upload the file to the returned target, then attach it with set a profile photo.

POST
https://api.portal.magicdoor.com/company-app/property-managers/{propertyManagerId}/image/upload-sessions

Authorization

Authorizationstringrequired
Bearer token — Send your API token in the Authorization header as Bearer <token>. Requests without a valid token are rejected with 401 Unauthorized.

Path parameters

propertyManagerIdstringrequired

The property manager. A Snowflake id, sent as a decimal string.

example: 1830472847398404098

Body

application/json

Describe the photo you are about to upload. Profile photos must be an image and no larger than 5 MB.

fileNamestringrequired

Name of the file you are about to upload. 1 to 250 characters.

example: perpetua-wren.jpg
fileSizeintegerrequired

Size of the file in bytes. Must be at least 1, and at most 5,242,880 (5 MB).

example: 248192
contentTypestringrequired

MIME type of the file. Must be an image type.

example: image/jpeg

Response

200 · Where and how to upload the photo.

sessionIdstring

Id of the upload session. Send it back in the follow-up call that attaches the file.

endpointstring

Absolute URL to upload the file to.

methodstring

HTTP method to use for the upload, for example POST.

fieldsobject

Form fields the storage provider requires. Send every key and value exactly as given, as multipart/form-data, with the file itself last.

expiresstring · date-time

When the session stops accepting the upload.

401 · The access token is missing, expired, or does not belong to a property manager.

404 · No property manager with that id exists for the calling company. A record that belongs to another company is reported the same way as one that does not exist. The id you asked for is in `entityId`; `detail` names only the kind of record.

  1. Reserve a session

    Call this endpoint with the file's name, size and MIME type. You get back an endpoint, a method, a set of fields and a sessionId.

  2. Upload the file

    Send the file to endpoint using method, as multipart/form-data. Include every key and value from fields unchanged, with the file itself as the last part. The session expires at expires.

  3. Attach it

    Call set a profile photo with the sessionId. Only then does the photo become the property manager's.