Lease documents

Preview a merged document

Merges one or more templates against a lease and hands back the resulting PDF inline, base64-encoded, together with the boxes that were placed on it. Nothing is stored — use it to preview before creating a real document.

POST
https://api.portal.magicdoor.com/company-app/lease-documents/merge-from-templates

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

leaseIdstringrequired

The lease whose values fill the templates. A Snowflake id, sent as a decimal string.

refsobject[]required

The templates to merge, in order. At least one.

signerIdsstring[]

Signers to place boxes for.

propertyManagerIdsstring[]

Property managers to place boxes for.

Response

200 · The merged PDF and its boxes.

pdfstring

The merged PDF, base64-encoded. Decode it to get the bytes.

annotationsLeaseDocumentAnnotation[]

The boxes placed on the merged PDF.

400 · The request failed validation. `errors` maps each field name to what was wrong with it.

401 · The access token is missing, expired, or not for this company.

404 · No lease or template matched the id, or it belongs to another company.