# POST /document-templates/:template_id/send

**Resource:** [Document Templates](./document-templates.md)  
**MCP tool:** `send_document_template`  
**Scopes:** `documents:write`  
**Write operation:** yes

Render a document template to PDF and email it to a recipient in one call. Costs credits (PDF render). Use render_document_template with preview:true first to validate merge fields — this call resolves tokens strictly and fails on any unresolved {{token}} in the document body or the email subject/message.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `template_id` | path | string | yes |  |
| `deal_id` | body | string | no | Opportunity to resolve {{tokens}} from, and (with recipient_source contact/account) the recipient. Required unless recipient_source is "custom". |
| `recipient_source` | body | string | yes | "contact"/"account" resolve the recipient from deal_id's linked contact/company. "custom" uses recipient_email/recipient_name directly. |
| `recipient_email` | body | string | no | Required when recipient_source is "custom"; used as a fallback otherwise. |
| `recipient_name` | body | string | no |  |
| `email_subject` | body | string | yes | May contain {{tokens}} (e.g. {{deal.name}}). Must fully resolve. |
| `email_message` | body | string | yes | May contain {{tokens}}. Must fully resolve. |
| `intro_html` | body | string | no | Per-call HTML override for the branded email intro — wins over the workspace/per-template default for this send only. |
| `subject_override` | body | string | no | Per-call subject override (plain text, may contain {{tokens}}). |
| `variables` | body | object | no | Extra {{token}} values merged on top of the opportunity data. |
| `document_type` | body | string | no | crm_documents.document_type. Defaults to "Other". |
| `require_approval` | body | boolean | no | Optional. Set true to route this write into the approval queue for human review instead of executing it immediately (returns 202 + an approval_id). Works even when your key/token has permission to execute directly. |

## Request example

```bash
curl -X POST   "https://api.trustpager.com/functions/v1/api/v1/document-templates/:template_id/send"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"deal_id":"...","recipient_source":"...","recipient_email":"..."}'
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`