Create a letter document template
Creates a Word-document letter template. Give it an upload session and it starts from the .docx you uploaded; leave the session out and it starts from a blank document. Requires the letter_templates:write permission.
Authorization
AuthorizationstringrequiredBody
application/json
namestringThe name shown to the property manager, and the file name given to the document. Up to 250 characters.
letterTemplateGroupIdstringFile the template under this group. A 64-bit number sent as a string.
uploadSessionIdstringThe sessionId from Start a document file upload, if you are starting from your own .docx. Leave it out and MagicDoor creates an empty Word document for the property manager to write in.
communicationChannelsenum<string>[]requiredThe kinds of recipient this template can be addressed to. Each value decides which placeholders the content may use — a lease template can use {{rent_amount}}, a vendor template cannot. When several are listed, only the placeholders every one of them offers are allowed.
Response
200 · The template that was created, with the URL of its file.
idstringrequiredThe letter document template. A 64-bit number sent as a string.
letterTemplateGroupIdstringThe group this template is filed under. Absent while it is ungrouped.
namestringThe name shown to the property manager. Absent when the template was created without one.
communicationChannelsenum<string>[]requiredThe kinds of recipient this template can be addressed to.
documentIdstringrequiredThe document that holds the Word file behind this template. Pass it to nothing else in this reference — it is the handle the editor uses.
createdstring · date-timerequiredWhen the template was created, in the company's timezone and with no offset.
updatedstring · date-timerequiredWhen the template row was last changed, in the company's timezone and with no offset.
filePublicUrlstringrequiredA URL that serves the template's current .docx file. Fetched fresh on every call, so read it from the response rather than storing it.
400 · `communicationChannels` is missing or empty.
401 · The access token is missing, expired, or not a property-manager token.
403 · The token is valid but the caller does not hold the `letter_templates:write` permission.
404 · `letterTemplateGroupId` names a group that does not exist, or belongs to another company.
422 · The upload session is unknown, expired, already used, or the file was never uploaded to it.
Unlike a letter template, the placeholders inside the .docx are not checked when the template is created. Ask List document placeholder keys for the keys the editor should offer.