# POST /email/send-with-file

**Resource:** [Email](./email.md)  
**MCP tool:** `send_email_with_file`  
**Scopes:** `files:read`, `email:send`  
**Write operation:** yes

Send an email with a workspace CRM file attached. Costs credits. Works on both TrustPager Mail (<=7MB) and Gmail (<=25MB) rails. Pass opportunity_id (canonical) or deal_id (legacy alias) to auto-link the resulting thread to a deal.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `file_id` | body | string | yes |  |
| `to_email` | body | string | yes |  |
| `subject` | body | string | yes |  |
| `html_body` | body | string | yes |  |
| `cc` | body | array | no |  |
| `bcc` | body | array | no |  |
| `contact_id` | body | string | no |  |
| `opportunity_id` | body | string | no | Link to an opportunity UUID. Stamps email_logs.deal_id and registers the thread under the opportunity activity feed. |
| `deal_id` | body | string | no | Legacy alias for opportunity_id. |

## Request example

```bash
curl -X POST   "https://api.trustpager.com/functions/v1/api/v1/email/send-with-file"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"file_id":"...","to_email":"...","subject":"..."}'
```

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