---
title: "Message templates, lease templates and the clause library"
method: GET
path: "/api/v1/templates"
tags: ["Account"]
---

# Message templates, lease templates and the clause library

`GET /api/v1/templates`

## Request

- Base URL: `http://localhost:5180`
- URL: `http://localhost:5180/api/v1/templates`
- Auth: API key in cookie `better-auth.session_token`

Bodies are keyed by language code, because tenant correspondence always goes out in the tenant’s own language, and merge fields are left as `{{placeholders}}`. A template flagged `hasLegalBoilerplate` carries fixed wording the AI must not paraphrase.

## Response `200`

Every template and clause on file.

- object
  - `ok` unknown, required
  - `data` object, required
    - `templates` object[], required: Message templates, per channel, with a body per language.
      - `id` string, required: Stable record id, e.g. `lse_012`.
      - `key` string, required
      - `name` string, required
      - `category` 'rent' | 'arrears' | 'lease' | 'maintenance' | 'compliance' | 'guest' | 'general' | 'report', required
      - `channel` 'email' | 'sms' | 'whatsapp' | 'phone' | 'portal' | 'post', required
      - `subject` object
      - `body` object, required: The body per language, keyed by ISO 639-1 code. The four the product ships wording in are always here; a language the owner added may not be, so read it through a fallback.
      - `variables` string[], required: The merge fields this template expects to be given.
      - `isSystem` boolean, required
      - `tone` 'formal' | 'neutral' | 'friendly', required
      - `hasLegalBoilerplate` boolean, required: True when the wording is legally fixed and must not be paraphrased by the AI.
      - `usageCount` number, required
      - `lastEditedAt` string: ISO 8601 timestamp.
    - `leaseTemplates` object[], required: The instruments an owner can issue, each pinned to a jurisdiction.
      - `id` string, required: Stable record id, e.g. `lse_012`.
      - `name` string, required
      - `leaseType` string, required
      - `jurisdictionId` string, required: Stable record id, e.g. `lse_012`.
      - `language` 'en' | 'nl' | 'fr' | 'de', required: One of the four the product itself authors wording in: the clause library, the seeded messages, the words on a notice.
      - `clauseIds` string[], required
      - `isSystem` boolean, required: True for a template the product ships, false for one the owner made.
      - `basedOnId` string: The system template this was forked from, if any.
      - `lastUsedAt` string: ISO 8601 timestamp.
      - `usageCount` number, required
      - `createdAt` string, required: ISO 8601 timestamp.
      - `documentKind` string: Which instrument it produces. Absent means a lease.
      - `bodySource` 'assembled' | 'written': Absent means assembled from clauses.
      - `body` object: The literal text, read only when bodySource is `written`.
      - `baselineBody` object: What the body was frozen from at fork time, so an edit can be compared to its origin.
      - `lastEditedAt` string: ISO 8601 timestamp.
    - `leaseClauses` object[], required: The clause library a lease template is assembled from, carrying where each clause is required and where it is void.
      - `id` string, required: Stable record id, e.g. `lse_012`.
      - `key` string, required
      - `title` string, required
      - `category` 'core' | 'payment' | 'maintenance' | 'use' | 'termination' | 'compliance' | 'optional', required
      - `body` object, required: The clause text per language, with {{merge_fields}} left intact.
      - `requiredIn` string[], required: Jurisdiction pack ids that legally require this clause.
      - `forbiddenIn` string[], required: Jurisdiction pack ids where the clause is void, surfaced as a warning.
      - `appliesTo` string[], required
      - `defaultOn` boolean, required
      - `explainer` string
  - `meta` object, required
    - `requestId` string, required: Echoed in the x-request-id header. Quote it in a bug report.

---

[API](https://skmtc.dev/dardaris/apis/dardaris-api.md) · [All operations](https://skmtc.dev/dardaris/apis/dardaris-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dardaris/apis/dardaris-api/revisions/4aff33835c73?raw)
