Templates
Lease and document templates, including rendering and generation.
10 endpoints. Every request needs an Authorization: Bearer mtro_... header, and responses follow the envelope described in Errors and conventions.
POST /templates/create
Create a lease template. This writes account data and should require owner confirmation when used by an agent.
Required scope: templates.write
MCP tool: templates_create
Request body
Field names are taken from the Core handler, which reads exactly these. Types and which of them are required are not yet documented.
| Field | Type | Required | Description |
|---|---|---|---|
default | any | no | |
entityOwner | any | no | |
html | any | no | |
templateName | any | no | |
visibility | any | no |
Example
curl -X POST 'https://core.mtro.app/templates/create' \
-H 'Authorization: Bearer mtro_your_api_key' \
-H 'Content-Type: application/json' \
-d '{}'
POST /templates/delete
Delete a lease template. This is destructive and should require owner confirmation when used by an agent.
Required scope: templates.write
MCP tool: templates_delete
Request body
| Field | Type | Required | Description |
|---|---|---|---|
templateId | string | yes | Template ID. |
Example
curl -X POST 'https://core.mtro.app/templates/delete' \
-H 'Authorization: Bearer mtro_your_api_key' \
-H 'Content-Type: application/json' \
-d '{"templateId":"<templateId>"}'
POST /templates/generate-lease
Generate a lease from a booking/template. This may produce guest-facing documents and should require owner confirmation before sending externally.
Required scope: bookings.read
MCP tool: templates_generate_lease
Request body
Field names are taken from the Core handler, which reads exactly these. Types and which of them are required are not yet documented.
| Field | Type | Required | Description |
|---|---|---|---|
bookingId | any | no | |
css | any | no | |
templateId | any | no |
Example
curl -X POST 'https://core.mtro.app/templates/generate-lease' \
-H 'Authorization: Bearer mtro_your_api_key' \
-H 'Content-Type: application/json' \
-d '{}'
GET /templates/get/{templateId}
Get detailed information about a specific lease template, including its pages and merge fields.
Required scope: any valid API key for the entity.
MCP tool: templates_get
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
templateId | string | yes | The template ID |
Example
curl -X GET 'https://core.mtro.app/templates/get/<templateId>' \
-H 'Authorization: Bearer mtro_your_api_key'
GET /templates/get/all
List all lease templates available to you.
Required scope: templates.read
MCP tool: templates_list
Example
curl -X GET 'https://core.mtro.app/templates/get/all' \
-H 'Authorization: Bearer mtro_your_api_key'
Response
| Field | Type |
|---|---|
templates | any[] |
error | boolean |
GET /templates/get/entity/{entityId}
Get all lease templates belonging to a specific entity.
Required scope: templates.read
MCP tool: templates_get_by_entity
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
entityId | string | yes | The entity ID |
Example
curl -X GET 'https://core.mtro.app/templates/get/entity/<entityId>' \
-H 'Authorization: Bearer mtro_your_api_key'
Response
| Field | Type |
|---|---|
templates | any[] |
error | boolean |
GET /templates/get/public
List public lease templates.
Required scope: any valid API key for the entity.
MCP tool: templates_get_public
Example
curl -X GET 'https://core.mtro.app/templates/get/public' \
-H 'Authorization: Bearer mtro_your_api_key'
POST /templates/import-word
Import a Word document as a lease template. This writes account data and should require owner confirmation when used by an agent.
Required scope: templates.write
MCP tool: templates_import_word
Request body — multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
file | file | yes | Uploaded file |
Example
curl -X POST 'https://core.mtro.app/templates/import-word' \
-H 'Authorization: Bearer mtro_your_api_key' \
-F 'file=@/path/to/file'
POST /templates/preview-render
Preview-render a template with merge fields without saving a booking document.
Required scope: templates.write
MCP tool: templates_preview_render
Request body
Field names are taken from the Core handler, which reads exactly these. Types and which of them are required are not yet documented.
| Field | Type | Required | Description |
|---|---|---|---|
css | any | no | |
html | any | no | |
templateId | any | no |
Example
curl -X POST 'https://core.mtro.app/templates/preview-render' \
-H 'Authorization: Bearer mtro_your_api_key' \
-H 'Content-Type: application/json' \
-d '{}'
POST /templates/update
Update a lease template. This writes account data and should require owner confirmation when used by an agent.
Required scope: templates.write
MCP tool: templates_update
Request body
Field names are taken from the Core handler, which reads exactly these. Types and which of them are required are not yet documented.
| Field | Type | Required | Description |
|---|---|---|---|
default | any | no | |
html | any | no | |
templateId | any | no | |
templateName | any | no | |
visibility | any | no |
Example
curl -X POST 'https://core.mtro.app/templates/update' \
-H 'Authorization: Bearer mtro_your_api_key' \
-H 'Content-Type: application/json' \
-d '{}'