logo
AdminCreate a ban

Create a ban

curl -X POST "https://mail.haltman.io/api/admin/bans" \
  -H "Content-Type: application/json" \
  -H "X-CSRF-Token: YOUR_API_KEY" \
  -d '{
  "ban_type": "email",
  "ban_value": "example_string",
  "reason": "example_string",
  "expires_at": "2024-12-25T10:00:00Z",
  "disable_matching_aliases": true
}'
{
  "ok": true,
  "created": true,
  "updated": true,
  "deleted": true,
  "disabled_aliases": 42,
  "message": "example_string",
  "item": {
    "id": 123,
    "ban_type": "email",
    "ban_value": "example_string",
    "reason": "example_string",
    "created_at": "2024-12-25T10:00:00Z",
    "expires_at": "2024-12-25T10:00:00Z",
    "revoked_at": "2024-12-25T10:00:00Z",
    "revoked_reason": "example_string",
    "active": true
  }
}
POST
/api/admin/bans
POST
API Key (cookie: __Host-access)
__Host-accessstring
Required

Access-session cookie used for user and admin authentication.

Access-session cookie used for user and admin authentication.
API Key (header: X-CSRF-Token)
X-CSRF-Tokenstring
Required

CSRF token derived from the current session family.

CSRF token derived from the current session family.
Content-Typestring
Required

The media type of the request body

Options: application/json
ban_typestring
Required
Options: email, domain, ip, name
expires_atstring
Format: date-time
disable_matching_aliasesboolean

When true, deactivates all matching active aliases for email, domain, and name bans.

Request Preview
Response

Response will appear here after sending the request

Authentication

path
parameterstring
Required

API Key for authentication. Access-session cookie used for user and admin authentication.

header
X-CSRF-Tokenstring
Required

API Key for authentication. CSRF token derived from the current session family.

Body

application/json
ban_typestring
Required
Allowed values:emaildomainipname
disable_matching_aliasesboolean

When true, deactivates all matching active aliases for email, domain, and name bans.

Responses