External insurance

Create an upload session

Reserves a slot for the tenant's proof-of-insurance document and returns the address to upload it to. Send the returned session id as uploadSessionId when you create the external insurance record; nothing is stored until you do.

POST
https://services.magicdoor.com/tenantinsurance/company-portal/insurance/externals/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.

Query parameters

leaseIdstringrequired

The lease the document belongs to. It must belong to the calling company.

example: 1842910736482304512

Body

application/json

fileNamestringrequired

The document's file name, 1 to 250 characters.

fileSizeintegerrequired

The document's size in bytes. Must be at least 1 byte and at most 20 MB (20,971,520 bytes).

contentTypestringrequired

The document's MIME type, 1 to 200 characters. Must be an image type or application/pdf.

Response

200 · Where and how to upload the document.

sessionIdstring

The session's id. Send it as uploadSessionId when creating the external insurance record.

endpointstring

The URL to send the file to. It is issued by the storage backend, so read it from this response rather than hard-coding it.

methodstring

The HTTP method the upload must use, for example PUT or POST.

fieldsobject

Form fields the storage provider requires alongside the file. Send them exactly as given.

expiresstring · date-time

When the session stops accepting the upload.

400 · The file is larger than 20 MB or its content type is neither an image nor a PDF.

401 · The access token is missing, expired, or not a company portal token.

404 · No such lease, or the lease belongs to another company.