# Update domain

> Changes tracking and TLS settings. Applies to emails sent after the change.

Source: https://mailvina.com/docs/api-reference/domains/update-domain · Base URL: https://api.mailvina.com · Guide: https://mailvina.com/docs/domains

`PATCH /domains/:id`

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | The domain ID. |

**Body parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `open_tracking` | `boolean` | no | Add the open-tracking pixel. |
| `click_tracking` | `boolean` | no | Rewrite links through the click-tracking redirect. |
| `tls` | `'opportunistic' \| 'enforced'` | no | `enforced` bounces mail to servers without TLS. |
| `receiving` | `boolean` | no | Accept mail for this domain. Then publish the MX record returned in `receiving.record`. |

**Request**

```bash
curl -X PATCH 'https://api.mailvina.com/domains/:id' \
  -H 'Authorization: Bearer mv_xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
  "open_tracking": false,
  "click_tracking": true,
  "tls": "enforced"
}'
```

```js
const res = await fetch('https://api.mailvina.com/domains/:id', {
  method: 'PATCH',
  headers: {
    Authorization: `Bearer ${process.env.MAILVINA_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "open_tracking": false,
    "click_tracking": true,
    "tls": "enforced"
  }),
});
const data = await res.json();
```

```python
import os, requests

res = requests.patch(
    "https://api.mailvina.com/domains/:id",
    headers={"Authorization": f"Bearer {os.environ['MAILVINA_API_KEY']}"},
    json={
        "open_tracking": False,
        "click_tracking": True,
        "tls": "enforced"
    },
)
print(res.json())
```

**Response**

```json
{
  "object": "domain",
  "id": "4dd369bc-aa82-4ff3-97de-514ae3000ee0",
  "name": "mail.acme.com",
  "status": "verified",
  "created_at": "2026-11-14T10:00:00.000Z",
  "open_tracking": false,
  "click_tracking": true,
  "tls": "enforced",
  "tracking_domain": {
    "name": "links.mail.acme.com",
    "status": "active",
    "record": {
      "type": "CNAME",
      "name": "links.mail.acme.com",
      "value": "track.mailvina.com"
    }
  },
  "records": [
    {
      "record": "DKIM",
      "type": "TXT",
      "name": "mailvina._domainkey.mail.acme.com",
      "value": "p=MIIBIjANBgkqh…",
      "status": "verified",
      "optional": false
    },
    {
      "record": "SPF",
      "type": "TXT",
      "name": "send.mail.acme.com",
      "value": "v=spf1 include:spf.mailvina.com ~all",
      "status": "verified",
      "optional": false
    },
    {
      "record": "MX",
      "type": "MX",
      "name": "send.mail.acme.com",
      "value": "feedback-smtp.mailvina.com",
      "priority": 10,
      "status": "verified",
      "optional": false
    },
    {
      "record": "DMARC",
      "type": "TXT",
      "name": "_dmarc.mail.acme.com",
      "value": "v=DMARC1; p=none; rua=mailto:dmarc@mail.acme.com",
      "status": "not_started",
      "optional": true
    }
  ]
}
```

### The domain object

A sending domain and the DNS records it needs.

**Fields**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | `string` | no | Always `domain`. |
| `id` | `string` | no | Unique ID of the domain. |
| `name` | `string` | no | The domain, e.g. `mail.acme.com`. |
| `status` | `string` | no | `pending` (records not found yet), `partially_verified`, `verified` or `failed`. |
| `created_at` | `string` | no | When it was created (ISO 8601, UTC). |
| `open_tracking` | `boolean` | no | Whether opens are tracked with a pixel. |
| `click_tracking` | `boolean` | no | Whether links are rewritten to track clicks. |
| `tls` | `string` | no | `opportunistic` (use TLS when the receiving server supports it) or `enforced` (bounce otherwise). |
| `receiving` | `object` | no | Receiving mail on this domain. |
| `receiving.enabled` | `boolean` | no | Whether mail to this domain is accepted. |
| `receiving.status` | `string` | no | `disabled`, `pending` (MX record not found yet) or `verified`. |
| `receiving.record` | `object` | no | The MX record to publish. |
| `receiving.record.type` | `string` | no | DNS record type: `TXT`, `MX` or `CNAME`. |
| `receiving.record.name` | `string` | no | Host name to publish the record at. |
| `receiving.record.value` | `string` | no | The record’s value. |
| `receiving.record.priority` | `number` | no | Priority, for MX records only. |
| `tracking_domain` | `object \| null` | no | Your own subdomain for tracking links, if set. |
| `tracking_domain.name` | `string` | no | e.g. `links.mail.acme.com`. |
| `tracking_domain.status` | `string` | no | `pending`, `provisioning`, `active` or `failed`. |
| `tracking_domain.record` | `object` | no | The CNAME record to publish. |
| `tracking_domain.record.type` | `string` | no | DNS record type: `TXT`, `MX` or `CNAME`. |
| `tracking_domain.record.name` | `string` | no | Host name to publish the record at. |
| `tracking_domain.record.value` | `string` | no | The record’s value. |
| `tracking_domain.record.priority` | `number` | no | Priority, for MX records only. |
| `records` | `object[]` | no | Every DNS record the domain needs. |
| `records[].record` | `string` | no | What it’s for: `DKIM`, `SPF`, `MX` or `DMARC`. |
| `records[].type` | `string` | no | DNS record type: `TXT`, `MX` or `CNAME`. |
| `records[].name` | `string` | no | Host name to publish the record at. |
| `records[].value` | `string` | no | The record’s value. |
| `records[].priority` | `number` | no | Priority, for MX records only. |
| `records[].status` | `string` | no | `verified` or `not_started`. |
| `records[].optional` | `boolean` | no | `true` for recommended records (DMARC) that sending doesn’t need. |
