# POST /forms/templates/:template_id/fields

**Resource:** [Forms](./forms.md)  
**MCP tool:** `add_form_field`  
**Scopes:** `forms:write`  
**Write operation:** yes

Add a field to a form template. The content JSON carries per-field config: static min/max on number fields (content.min/max), conditional visibility (content.visibility), and CROSS-FIELD VALIDATION on number/date fields via content.validation = { match: 'all'|'any', rules: [{ operator: 'lte'|'gte'|'lt'|'gt'|'date_after'|'date_before', target: { kind: 'literal', value: <number> } OR { kind: 'field', fieldId: '<other field id>', factor?: <number>, divideBy?: <number> }, message: '<shown when it fails>' }] }. Blocks submission when the value breaks the rule (e.g. IP benefit <= 70% of annual income / 12 => operator 'lte', target { kind:'field', fieldId:'<income field>', factor:0.7, divideBy:12 }); the target can be any other same-type field.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `template_id` | path | string | yes |  |
| `type` | body | string | yes |  |
| `label` | body | string | yes |  |
| `content` | body | object | no | Per-field JSON config: options, crm_variable/crm_variable_mode, min/max, visibility, and validation (cross-field rule set; see the tool description). |

## Request example

```bash
curl -X POST   "https://api.trustpager.com/functions/v1/api/v1/forms/templates/:template_id/fields"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"type":"...","label":"..."}'
```

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