:::endpoint POST /v1/me/mail/blocked-senders

A sender typed in by hand. To block the sender of a message somebody is
reading, [block from a message](/docs/api/mail/block) instead.

## Request

```bash
curl -X POST https://api.proppertrading.com/v1/me/mail/blocked-senders \
  -H "Authorization: Bearer ptat_9f2c1a44_3b8e7d2f5c9a1b4e6d8f0a2c4e6b8d1f" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 5b7d9f1a-3c5e-4a7b-9d1f-2e4a6c8e0b1d" \
  -d '{ "pattern": "amexp.com" }'
```

| Field     | Description                                                                                |
| --------- | ------------------------------------------------------------------------------------------ |
| `pattern` | An address, or a domain as `amexp.com`, `@amexp.com` or `*.amexp.com`. All three mean the domain |

A domain covers its subdomains too, so `amexp.com` also refuses
`news.amexp.com`. A bare top level domain such as `com` is not accepted.

## Response

`201` with the new entry. A sender that was already blocked answers `200` with
the entry that was there: what was asked for is true either way.

```json
{
    "data": {
    "id": "blk_5ws77sgyjhhkqb66",
    "object": "mail_blocked_sender",
    "kind": "domain",
    "pattern": "amexp.com",
    "author": "Mick Schmidt",
    "created_at": "2026-09-25T10:14:02.000000Z",
    "hits": 3,
    "last_hit_at": "2026-09-25T16:40:51.000000Z"
},
    "meta": { "request_id": "req_01kz4bkr1aj1gv63d8fv3133ey" }
}
```

## Errors

| Status | Code                      | Meaning                                                                                  |
| ------ | ------------------------- | ---------------------------------------------------------------------------------------- |
| 400    | `missing_idempotency_key` | Every POST needs one                                                                     |
| 400    | `invalid_sender`          | Not an address or a domain that can be blocked                                           |
| 400    | `own_sender`              | One of this environment's own addresses or domains. Forgeries of those are refused already |
| 403    | `insufficient_scope`      | This device does not hold `mail:write`                                                   |
| 403    | `forbidden`               | The account does not hold `manage_mailbox`                                               |
| 422    | `validation_failed`       | `pattern` missing                                                                        |