Letter templates

Update a letter template

Replaces a letter template's name, group, channels and content in one call. Requires the letter_templates:write permission.

PUT
https://services.magicdoor.com/communications/company-portal/letter-templates/{id}

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

idstringrequired

The letter template to update. A 64-bit number sent as a string.

example: 1830472847398404096

Body

application/json

This is a full replacement, not a patch. Every field you leave out is cleared on the stored template — send the values you want to keep, including the ones you are not changing.

namestring

The name shown to the property manager. Up to 250 characters. Leaving it out clears the existing name.

letterTemplateGroupIdstring

File the template under this group. Leaving it out removes the template from whatever group it is in.

communicationChannelsenum<string>[]required

The 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.

tenantownervendorleasemaintenanceRequestworkOrderrentalApplicationpropertyManagercompany
emailSubjectstring

Subject line for the email form of this template. Up to 500 characters.

emailBodystring

The email body, as HTML. No length limit.

chatContentstring

The chat message body, as plain text. Up to 5000 characters.

Response

200 · The template as it now stands.

idstringrequired

The letter template. A 64-bit number sent as a string — do not parse it as a JavaScript number.

letterTemplateGroupIdstring

The group this template is filed under. Absent while the template is ungrouped.

namestring

The name shown to the property manager. Absent when the template was created without one.

communicationChannelsenum<string>[]required

The kinds of recipient this template can be addressed to.

tenantownervendorleasemaintenanceRequestworkOrderrentalApplicationpropertyManagercompany
emailSubjectstring

Subject line used when the template is sent as an email. Absent when the template is chat-only.

emailBodystring

The email body, as HTML, with placeholders still in {{key}} form. Absent when the template is chat-only.

chatContentstring

The chat message body, as plain text, with placeholders still in {{key}} form. Absent when the template is email-only.

sourceFileIdstring

The uploaded Word file this template was imported from. Present only on imported templates, and it is what isImported filters on.

createdstring · date-timerequired

When the template was created, in the company's timezone and with no offset.

updatedstring · date-timerequired

When the template was last changed, in the company's timezone and with no offset.

400 · `communicationChannels` is empty, both `emailBody` and `chatContent` are blank, or the content 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 · No template with that id belongs to the caller's company, or `letterTemplateGroupId` names a group that does not.