# Blocked Email Domains endpoints (Admin API)

> 6 FeatherPanel Admin API endpoints from admin/blocked-email-domains.php: methods, paths, auth, permissions, rate limits, parameters and responses.

Source: https://featherpanel.com/docs/api/reference/admin/blocked-email-domains/

Defined in [`backend/app/routes/admin/blocked-email-domains.php`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/blocked-email-domains.php). Authentication used here: **Admin**. Read [Authentication](https://featherpanel.com/docs/api/authentication/) for how to send credentials and [Rate limits and errors](https://featherpanel.com/docs/api/rate-limits-and-errors/) for the response envelope.

Paths, methods, permissions and rate limits come from the route file. Summaries, parameters and response codes come from the OpenAPI annotations on the controllers; endpoints without annotations show only what the route file declares.

## Endpoints

### GET `/api/admin/blocked-email-domains`

- Auth: Admin
- Permission: `admin.settings.view`
- Route name: `admin-blocked-email-domains`
- Controller: [`BlockedEmailDomainsController::index`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/BlockedEmailDomainsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/blocked-email-domains.php#L26)

**List blocked email domains**

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `page` | query | integer | no |  |
| `limit` | query | integer | no |  |
| `search` | query | string | no |  |

```bash
curl -X GET "$PANEL_URL/api/admin/blocked-email-domains" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` OK · `401` Unauthorized

### PUT `/api/admin/blocked-email-domains`

- Auth: Admin
- Permission: `admin.settings.edit`
- Route name: `admin-blocked-email-domains-create`
- Controller: [`BlockedEmailDomainsController::create`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/BlockedEmailDomainsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/blocked-email-domains.php#L37)

**Add a blocked domain**

| Body field | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | string | yes | example.com or user@example.com |

```bash
curl -X PUT "$PANEL_URL/api/admin/blocked-email-domains" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"domain":""}'
```

Responses: `201` Created · `400` Validation error · `409` Duplicate

### POST `/api/admin/blocked-email-domains/import-preset`

- Auth: Admin
- Permission: `admin.settings.edit`
- Route name: `admin-blocked-email-domains-import-preset`
- Controller: [`BlockedEmailDomainsController::importPreset`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/BlockedEmailDomainsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/blocked-email-domains.php#L48)

**Import bundled disposable-domain list into the database**

```bash
curl -X POST "$PANEL_URL/api/admin/blocked-email-domains/import-preset" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Import finished · `500` Preset file missing or import failed

### POST `/api/admin/blocked-email-domains/import-url`

- Auth: Admin
- Permission: `admin.settings.edit`
- Route name: `admin-blocked-email-domains-import-url`
- Controller: [`BlockedEmailDomainsController::importFromUrl`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/BlockedEmailDomainsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/blocked-email-domains.php#L59)

**Import blocked domains from a plain-text URL (one domain per line)**

| Body field | Type | Required | Description |
| --- | --- | --- | --- |
| `url` | string (uri) | yes |  |

```bash
curl -X POST "$PANEL_URL/api/admin/blocked-email-domains/import-url" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"url":""}'
```

Responses: `200` Import finished · `400` Invalid URL · `502` Fetch failed

### POST `/api/admin/blocked-email-domains/import-text`

- Auth: Admin
- Permission: `admin.settings.edit`
- Route name: `admin-blocked-email-domains-import-text`
- Controller: [`BlockedEmailDomainsController::importFromText`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/BlockedEmailDomainsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/blocked-email-domains.php#L70)

**Import blocked domains from pasted plain text (one domain per line)**

| Body field | Type | Required | Description |
| --- | --- | --- | --- |
| `text` | string | yes |  |

```bash
curl -X POST "$PANEL_URL/api/admin/blocked-email-domains/import-text" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"text":""}'
```

Responses: `200` Import finished · `400` Body too large or invalid

### DELETE `/api/admin/blocked-email-domains/{id}`

- Auth: Admin
- Permission: `admin.settings.edit`
- Route name: `admin-blocked-email-domains-delete`
- Controller: [`BlockedEmailDomainsController::delete`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/BlockedEmailDomainsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/blocked-email-domains.php#L81)

**Remove a blocked domain**

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | \- | yes |  |

```bash
curl -X DELETE "$PANEL_URL/api/admin/blocked-email-domains/$ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Removed · `404` Not found
