Skip to main content
Pro Feature: The blocklist functionality requires a Pro account. Upgrade now to unlock this feature.

Overview

The blocklist feature allows you to maintain a custom list of domains that should be blocked in your application. This is useful for:
  • Enforcing company-specific email policies
  • Blocking competitors or specific organizations
  • Maintaining a custom deny list beyond disposable email detection
  • Implementing organization-specific compliance rules
Environment-Specific: Blocklists are environment-specific. Domains blocklisted in your test environment will not affect your production environment and vice versa.

List Blocklisted Domains

GET /blocklist
Retrieves a paginated list of all domains in your blocklist.

Query Parameters

per_page
integer
default:"25"
Number of results per page (1-100)

Request Example

curl -X GET "https://api.fraudiant.com/blocklist?per_page=50" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

{
  "status": 200,
  "data": [
    {
      "domain": "example.com",
      "created_at": "2024-01-15T10:30:00Z"
    },
    {
      "domain": "competitor.com",
      "created_at": "2024-01-16T14:22:00Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "per_page": 50,
    "total": 2
  }
}

Add Single Domain

POST /blocklist
Adds a single domain to your blocklist.

Request Body

domain
string
required
The domain to add to the blocklist (e.g., example.com)

Request Example

curl -X POST "https://api.fraudiant.com/blocklist" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain": "example.com"}'

Response Example

{
  "status": 201,
  "domain": "example.com",
  "created_at": "2024-01-15T10:30:00Z"
}

Error Responses

Domain Already Blocklisted (422)
{
  "status": 422,
  "error": "Domain is already in your blocklist"
}

Add Multiple Domains (Bulk)

POST /blocklist/bulk
Adds up to 1,000 domains to your blocklist in a single request. Automatically handles duplicates.

Request Body

domains
array
required
Array of domain strings to add (maximum 1,000 domains per request)

Request Example

curl -X POST "https://api.fraudiant.com/blocklist/bulk" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "domains": ["example1.com", "example2.com", "example3.com"]
  }'

Response Example

{
  "status": 200,
  "succeeded": 2,
  "failed": 1,
  "results": [
    {
      "domain": "example1.com",
      "status": "success",
      "created_at": "2024-01-15T10:30:00Z"
    },
    {
      "domain": "example2.com",
      "status": "success",
      "created_at": "2024-01-15T10:30:01Z"
    },
    {
      "domain": "example3.com",
      "status": "failed",
      "error": "Domain is already in your blocklist"
    }
  ]
}
Bulk operations automatically deduplicate entries. If a domain is already in your blocklist, it will be marked as failed but won’t cause the entire request to fail.

Check Domain Status

GET /blocklist/{domain}
Checks if a specific domain is in your blocklist.

Request Example

curl -X GET "https://api.fraudiant.com/blocklist/example.com" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

{
  "status": 200,
  "domain": "example.com",
  "created_at": "2024-01-15T10:30:00Z",
  "blocklisted": true
}

Error Response (Not Found)

{
  "status": 404,
  "error": "Domain not found in blocklist"
}

Remove Domain

DELETE /blocklist/{domain}
Removes a domain from your blocklist.

Request Example

curl -X DELETE "https://api.fraudiant.com/blocklist/example.com" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

{
  "status": 200,
  "message": "Domain removed from blocklist successfully"
}

Common Error Responses

Unauthorized (401)

{
  "status": 401,
  "error": "Unauthorized. Please provide a valid API key."
}

Pro Feature Required (403)

{
  "status": 403,
  "error": "This feature requires a Pro account."
}

Upgrade to Pro

Unlock blocklist management and other Pro features

Best Practices

Always test blocklist changes in your development environment before applying them to production to avoid accidentally blocking legitimate users.
When adding multiple domains, use the bulk endpoint to reduce API calls and improve performance.
Keep an internal record of why domains are blocklisted to help with future audits and policy reviews.
Periodically audit your blocklist to remove outdated entries and ensure it aligns with current policies.
Use blocklists in addition to disposable email detection for comprehensive fraud prevention.

Integration Example

async function validateEmail(email) {
  const domain = email.split('@')[1];

  // First, check if domain is blocklisted
  const blocklistCheck = await fetch(
    `https://api.fraudiant.com/blocklist/${domain}`,
    {
      headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
    }
  );

  if (blocklistCheck.status === 200) {
    return { allowed: false, reason: 'Domain is blocklisted' };
  }

  // Then validate the full email
  const emailCheck = await fetch(
    `https://api.fraudiant.com/email/${email}`,
    {
      headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
    }
  );

  const data = await emailCheck.json();

  if (data.disposable || data.spam) {
    return { allowed: false, reason: 'Disposable or spam email' };
  }

  return { allowed: true };
}