Create a template
Creates a communication template.
The acting user — the delegate token's own user, or the body userId when authenticating with an API key or partner token — must belong to the company and hold the setup or setup_communication_templates permission.
Only plain templates can be created here — htmlBuilder must be false or omitted.
attachmentIds are resolved against the company's uploaded files, stored on the template as full attachment entries, and tied to it so the detached-upload cleanup leaves them alone — ids that no longer resolve are dropped. A pdf template's subject becomes a file name, so characters that are illegal in one are stripped.
Merge fields
subject and content may contain merge placeholders, which are replaced with the recipient's, board card's or company's own values when the template is sent.
Fetch the available fields from GET /api/board/{boardId}/merge-fields for the board the template is used with. Every item in that response is { label, value } — label is what to show a human, value is what goes inside the braces:
{{firstname}}
{{Locations["Rent"]}}
{{customFields.7Lq2.LoyaltyTier}}
A placeholder may carry a fallback, used when the field is empty or unknown:
{{firstname || fallback: there}} -> "there" when the contact has no first name
{{Locations["Rent"] || fallback: TBD}} -> "TBD" when the card has no rent
{{firstname || fallback: }} -> renders nothing at all
Everything after fallback: up to the closing braces is the fallback text, and an empty one (or _blank) renders nothing.
Placeholders are shape-checked on write — an unclosed {{, an empty field name, or a malformed bracket reference such as Locations["Rent] is rejected with 400. Whether the field exists is not checked: an unknown field is normal (boards differ), and simply renders as its fallback at merge time.
Request
- Base URLhttps://core-api.getaptly.com
- Auth
- API key in header x-token
- or API key in header Authorization
- or HTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Response
Template created.
Changes
No recorded changes to this operation across all 1 revision of this API.