Blocklist Management

Learn how to manage your blocklist of domains, IP addresses, and emails

The blocklist management endpoints allow you to manage your list of blocked items. You can block:

  • Domains (e.g., "example.com")
  • Email addresses (e.g., "spam@example.com")
  • IP addresses (both IPv4 and IPv6)

You have two options to use the blocklist:

  1. Use the dashboard to manage your blocklist items
  2. Use the API to programmatically manage your blocklist

Authentication

Include your API key in the request header or as a query parameter:

x-api-key: your-api-key-here

or

https://veille.io/api/v1/blocklist?x_api_key=your-api-key-here

Endpoints

For more advanced security controls, you can also use our Security Rules to create complex filtering conditions.

List blocklist items

Retrieve your list of blocked items with pagination support.

GET https://veille.io/api/v1/blocklist

Query parameters

ParameterTypeDetails
pagenumberPage number (default: 1)
limitnumberItems per page (default: 10, max: 100)
typestringFilter by type (optional): "domain", "email", or "ip"
valuestringFilter by value (optional): will search for partial matches
activestringFilter by active status (optional): "true" or "false"

Response format

{
    "data": [
        {
            "id": "123e4567-e89b-12d3-a456-426614174000",
            "type": "domain",
            "value": "example.com",
            "active": true,
            "created_at": "2024-03-26T12:00:00Z"
        }
    ],
    "pagination": {
        "currentPage": 1,
        "pageSize": 10,
        "totalItems": 25,
        "totalPages": 3,
        "hasNextPage": true,
        "hasPreviousPage": false
    }
}

Get a specific blocklist item

Retrieve a specific blocklist item by its ID.

GET https://veille.io/api/v1/blocklist/:id

Response format

{
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "type": "domain",
    "value": "example.com",
    "active": true,
    "created_at": "2024-03-26T12:00:00Z"
}

Add item to blocklist

Add a new item to your blocklist.

POST https://veille.io/api/v1/blocklist

Request Body

{
    "type": "domain", // Can be "domain", "email", or "ip"
    "value": "example.com"
}

Response format

{
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "type": "domain",
    "value": "example.com",
    "active": true,
    "created_at": "2024-03-26T12:00:00Z"
}

Update item

Update a blocklist item by its ID.

PUT https://veille.io/api/v1/blocklist/:id

Request Body

{
    "type": "domain", // Optional
    "value": "example.com", // Optional
    "active": false // Optional
}

Response format

{
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "type": "domain",
    "value": "example.com",
    "active": false,
    "created_at": "2024-03-26T12:00:00Z"
}

Remove item from blocklist

Remove an item from your blocklist by its ID.

DELETE https://veille.io/api/v1/blocklist/:id

Response format

{
    "success": true
}

Blocklist Item Types

TypeDescriptionExampleFormat Validation
domainWebsite or email domainexample.comValid domain name
emailComplete email addressuser@example.comValid email format
ipIPv4 or IPv6 address192.168.1.1 or 2001:db8::1Valid IP format

For detailed validation of each type, see:

Code examples

List Blocked Items

cURL

curl -X GET \
  'https://veille.io/api/v1/blocklist?page=1&limit=10&type=domain&active=true' \
  -H 'x-api-key: your-api-key-here'

JavaScript (Fetch)

fetch('https://veille.io/api/v1/blocklist?page=1&limit=10', {
  headers: {
    'x-api-key': 'your-api-key-here'
  }
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));

Get a specific blocklist item

cURL

curl -X GET \
  'https://veille.io/api/v1/blocklist/123e4567-e89b-12d3-a456-426614174000' \
  -H 'x-api-key: your-api-key-here'

JavaScript (Fetch)

fetch('https://veille.io/api/v1/blocklist/123e4567-e89b-12d3-a456-426614174000', {
  headers: {
    'x-api-key': 'your-api-key-here'
  }
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));

Add item to blocklist

cURL

curl -X POST \
  'https://veille.io/api/v1/blocklist' \
  -H 'x-api-key: your-api-key-here' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "domain",
    "value": "example.com"
  }'

JavaScript (Fetch)

fetch('https://veille.io/api/v1/blocklist', {
  method: 'POST',
  headers: {
    'x-api-key': 'your-api-key-here',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    type: 'domain',
    value: 'example.com'
  })
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));

Update item

cURL

curl -X PUT \
  'https://veille.io/api/v1/blocklist/123e4567-e89b-12d3-a456-426614174000' \
  -H 'x-api-key: your-api-key-here' \
  -H 'Content-Type: application/json' \
  -d '{
    "active": false
  }'

JavaScript (Fetch)

fetch('https://veille.io/api/v1/blocklist/123e4567-e89b-12d3-a456-426614174000', {
  method: 'PUT',
  headers: {
    'x-api-key': 'your-api-key-here',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    active: false
  })
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));

Remove item from blocklist

cURL

curl -X DELETE \
  'https://veille.io/api/v1/blocklist/123e4567-e89b-12d3-a456-426614174000' \
  -H 'x-api-key: your-api-key-here'

JavaScript (Fetch)

fetch('https://veille.io/api/v1/blocklist/123e4567-e89b-12d3-a456-426614174000', {
  method: 'DELETE',
  headers: {
    'x-api-key': 'your-api-key-here'
  }
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));

Error handling

For details on error responses and status codes, please refer to the Status Codes & Error Responses documentation.

Note: The validation of domains, emails, and IPs is handled automatically by the database. If you try to insert an invalid format, you will receive a 400 error. For more comprehensive validation, consider using our Multi-factor Validation API.