Import a letter template
Turns an uploaded Word document into a letter template: the .docx is converted to HTML and stored as the email body. Requires the letter_templates:write permission.
Authorization
AuthorizationstringrequiredBody
application/json
uploadSessionId must name a session you have already uploaded a .docx to. The file is claimed by the new template, so a session can only be imported once.
uploadSessionIdstringrequiredThe sessionId from Start a template file upload. A 64-bit number sent as a string.
namestringThe name shown to the property manager. Up to 250 characters. Leave it out and the file's name without its extension is used.
letterTemplateGroupIdstringFile the template under this group. A 64-bit number sent as a string.
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.
emailSubjectstringSubject line for the email form of this template. Up to 500 characters. Leave it out and the file's name without its extension is used.
chatContentstringA chat message body to store alongside the imported email body. Up to 5000 characters. There is no way to supply emailBody here — it comes from the document.
Response
200 · The template that was created. `emailBody` is the converted document and `sourceFileId` points at the file it came from.
idstringrequiredThe letter template. A 64-bit number sent as a string — do not parse it as a JavaScript number.
letterTemplateGroupIdstringThe group this template is filed under. Absent while the template 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.
emailSubjectstringSubject line used when the template is sent as an email. Absent when the template is chat-only.
emailBodystringThe email body, as HTML, with placeholders still in {{key}} form. Absent when the template is chat-only.
chatContentstringThe chat message body, as plain text, with placeholders still in {{key}} form. Absent when the template is email-only.
sourceFileIdstringThe uploaded Word file this template was imported from. Present only on imported templates, and it is what isImported filters on.
createdstring · date-timerequiredWhen the template was created, in the company's timezone and with no offset.
updatedstring · date-timerequiredWhen the template was last changed, in the company's timezone and with no offset.
400 · The uploaded file is not a .docx, the document could not be converted, `communicationChannels` is empty, or the converted body uses a placeholder the named channels do not offer.
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.
Placeholders survive the conversion, so write {{first_name}} into the Word document and it stays a placeholder in the imported template. They are validated against communicationChannels after conversion, and one the channels do not offer fails the whole import.