Skip to main content

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

note

Field names are taken from the Core handler, which reads exactly these. Types and which of them are required are not yet documented.

FieldTypeRequiredDescription
defaultanyno
entityOwneranyno
htmlanyno
templateNameanyno
visibilityanyno

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

FieldTypeRequiredDescription
templateIdstringyesTemplate 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

note

Field names are taken from the Core handler, which reads exactly these. Types and which of them are required are not yet documented.

FieldTypeRequiredDescription
bookingIdanyno
cssanyno
templateIdanyno

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

NameTypeRequiredDescription
templateIdstringyesThe 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

FieldType
templatesany[]
errorboolean

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

NameTypeRequiredDescription
entityIdstringyesThe entity ID

Example

curl -X GET 'https://core.mtro.app/templates/get/entity/<entityId>' \
-H 'Authorization: Bearer mtro_your_api_key'

Response

FieldType
templatesany[]
errorboolean

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

FieldTypeRequiredDescription
filefileyesUploaded 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

note

Field names are taken from the Core handler, which reads exactly these. Types and which of them are required are not yet documented.

FieldTypeRequiredDescription
cssanyno
htmlanyno
templateIdanyno

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

note

Field names are taken from the Core handler, which reads exactly these. Types and which of them are required are not yet documented.

FieldTypeRequiredDescription
defaultanyno
htmlanyno
templateIdanyno
templateNameanyno
visibilityanyno

Example

curl -X POST 'https://core.mtro.app/templates/update' \
-H 'Authorization: Bearer mtro_your_api_key' \
-H 'Content-Type: application/json' \
-d '{}'