Leases

Upload a lease file (multipart)

Uploads a file straight to the lease in one multipart request. Kept for older integrations; new work should request an upload session and then attach the file by its session id.

Request an upload session, upload the file there, then attach it with the JSON endpoint.
POST
https://api.portal.magicdoor.com/company-app/leases/{leaseId}/files

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

leaseIdstringrequired

The lease to attach the file to. A Snowflake id, sent as a decimal string.

example: 1830472847398404096

Body

multipart/form-data

filefilerequired

The file itself. Must not be empty.

descriptionstring

Note about the file.

shareTypesenum<string>[]

Who outside the company portal can see the file.

tenantvendorowner

Response

200 · The file attachment that was created.

idstring

Id of the attachment. Use this to update or remove it. A Snowflake id, sent as a decimal string.

fileNamestring

Display name of the attachment.

descriptionstring

Note about the file.

createdstring · date-time

When the file was attached, in the company's timezone.

uploaderNamestring

Name of whoever uploaded it.

uploaderTypestring

What kind of user uploaded it, for example PropertyManager.

shareTypesstring[]

Who outside the company portal can see it.

relationTypeenum<string>

What the file is attached to. Always lease here.

lease
relationIdstring

Id of the thing it is attached to. A Snowflake id, sent as a decimal string.

fileobject

The stored file.

fileIdstringdeprecated

Use file.id.

fileUrlstringdeprecated

Use file.secureUrl.raw.

fileThumbUrlstringdeprecated

Use file.secureUrl.variantTemplate.

fileSizeBytesintegerdeprecated

Use file.size.

propertyIdstringdeprecated

Use relationId with relationType.

leaseIdstringdeprecated

Use relationId with relationType.

400 · No file was sent, or the file was empty.

401 · The access token is missing, expired, or not for this company.

404 · No lease matched the id, or it belongs to another company.