# POST /referrals/:id/convert

**Resource:** [Referrals](./referrals.md)  
**Scopes:** `referrals:write`  
**Write operation:** yes

Mark a referral as converted (referred deal closed Won) AND send the branded thank-you email to the referrer. Stamps converted_at. Prefer this over PATCH /referrals/:id when transitioning to converted -- it triggers the email side-effect. Response includes thank_you_sent boolean.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `id` | path | string | yes | Referral UUID. |

## Request example

```bash
curl -X POST "https://ucqwijexmjctglmrxlej.supabase.co/functions/v1/api/v1/referrals/f2788884-aaaa-bbbb-cccc-111111111111/convert" \
  -H "Authorization: Bearer tp_live_..."
```

## Response example

```json
{
  "data": {
    "id": "f2788884-aaaa-bbbb-cccc-111111111111",
    "status": "converted",
    "converted_at": "2026-05-16T11:00:00.000Z",
    "thank_you_sent": true,
    "thank_you_error": null
  },
  "meta": { "credits_remaining": 4497 }
}
```

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