Letter templates

Validate placeholders

Checks a piece of template content against the placeholders a set of channels offers, and names the ones that would be rejected. Nothing is stored — use it to validate an editor as the property manager types.

POST
https://services.magicdoor.com/communications/company-portal/letter-templates/validate-placeholders

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.

Body

application/json

contentstringrequired

The text to check. Pass one field at a time — an email subject, an email body, or a chat message.

communicationChannelsenum<string>[]required

The channels the content will be used for. As with a real template, only the placeholders all of them share are accepted.

tenantownervendorleasemaintenanceRequestworkOrderrentalApplicationpropertyManagercompany

Response

200 · The verdict. A `200` means the check ran, not that the content passed — read `isValid`.

isValidbooleanrequired

true when every placeholder in the content is offered by the named channels.

invalidPlaceholdersstring[]required

The keys that are not offered, each listed once. Empty when the content passes.

401 · The access token is missing, expired, or not a property-manager token.

Two different failures, one response

Content whose Handlebars syntax does not compile — an unclosed {{#each}}, say — also comes back as isValid: false, but with an empty invalidPlaceholders. So an empty list next to isValid: false means the content is malformed rather than using an unknown key; the response does not carry the parser's message.