Start a template file upload
Asks for a one-time upload slot for a Word document you want to import as a letter template. You upload the file to storage yourself, then hand the session id to Import.
Authorization
AuthorizationstringrequiredBody
application/json
Describe the file you are about to upload. Only Word .docx files are accepted, up to 20 MB — anything else is refused when you commit.
fileNamestringrequiredThe file's name, 1 to 250 characters. Its extension should be .docx.
fileSizeintegerrequiredThe exact size of the file in bytes. Must be at least 1 and no more than 20971520 (20 MB).
contentTypestringrequiredThe file's media type, 1 to 200 characters. Only application/vnd.openxmlformats-officedocument.wordprocessingml.document is accepted.
Response
200 · Where to send the file, and what to send with it.
sessionIdstringrequiredIdentifies the upload once it has finished. This is the value you send back as uploadSessionId.
endpointstringrequiredThe storage URL to send the file to. It is not a MagicDoor host and it does not take your bearer token.
methodstringrequiredThe HTTP method to use against endpoint.
fieldsobjectrequiredForm fields that must be sent with the file, exactly as given, before the file part. The set varies by upload, so send back whatever comes down rather than a fixed list.
expiresstring · date-timerequiredWhen the session stops accepting the upload, in the company's timezone and with no offset.
400 · `fileName`, `fileSize` or `contentType` is missing or outside its allowed range.
401 · The access token is missing, expired, or not a property-manager token.
422 · The file service refused the session — most often because the media type is not .docx or the size is over 20 MB.
- Ask for a session
Call this endpoint with the file's name, size and media type. You get back a storage URL, an HTTP method, and a set of form fields.
- Upload the file to storage
Send a multipart form to
endpointusingmethod. Put every entry offieldsin the form first, then the file itself as the last part. Do not send your MagicDoor bearer token to that URL — the signed fields are the authorisation. - Hand the session back to MagicDoor
Call Import a letter template with
uploadSessionIdset to thesessionIdfrom step 1. Until you do, nothing has been created.