> This page is for API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.eon.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.eon.io/_mcp/server.

# Create Finding Exclusion

POST https://%7Baccount-domain%7D.console.eon.io/api/v1/projects/{projectId}/finding-exclusions
Content-Type: application/json

Excludes matching files, tables, or databases from threat detection.

The exclusion can be scoped either to a single resource or to all resources in the Eon account.
Creating an exclusion has no effect on in-progress scans.


Reference: https://docs.eon.io/api/api-reference/threat-detection/finding-exclusions/create-finding-exclusion

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `projectId` (string, required) — ID of the project the finding exclusion is in. You can get your project ID from the [API Credentials](https://console.eon.io/global-management/api-credentials) page in your global management console.

### Body (application/json)

This endpoint expects a CreateFindingExclusionRequest.

- `scope` (enum, required) — Whether the exclusion applies to a single resource or to all resources in the Eon account. If set to `RESOURCE`, a resource ID must be set in `providerResourceId`.
  - Allowed values: `RESOURCE`, `ACCOUNT`
- `value` (string, required) — Matching value to exclude. The value set in this field depends on the specified `type`. - `PATH`: Matches files whose path starts with the specified value, case-sensitive. For example, `/data/tmp` matches `/data/tmp2/report.csv`. Linux paths are case-sensitive. Windows paths are case-insensitive, normalize for the file separator, and start with the drive letter. For example, `C:\Users\App\Cache` matches `c:/users/app/cache`. - `TABLE`: Exact table name. - `DATABASE`: Exact database name. - `KMS_KEY`: Either a KMS key ARN, or an AWS account ID to trust all keys in the account. Available for the ransomware detector only.
- `type` (enum, required) — Whether the finding is set to a file path, a database table, a whole database, or objects encrypted with a trusted KMS key. Used in combination with `value`.
  - Allowed values: `PATH`, `TABLE`, `DATABASE`, `KMS_KEY`
- `detector` (enum, required) — Detector type the exclusion applies to. If set to `MALWARE`, only paths can be excluded.
  - Allowed values: `RANSOMWARE_BEHAVIOR`, `DATA_ANOMALY`, `MALWARE`
- `providerResourceId` (string, optional) — Cloud-provider-assigned ID of the resource to apply the exclusion to. Required for `RESOURCE` scope. Must be omitted for `ACCOUNT` scope.

## Response

### 201

Finding exclusion created.

- `findingExclusion` (FindingExclusion, required) — Exclusion that stops a detector from reporting findings for matching files, tables, or databases. Can be scoped either to a single resource or to all resources in your inventory.

## Errors

### 400 Bad Request Error

Invalid request.

- `error` (string, optional)

### 404 Not Found Error

The resource wasn't found.

- `error` (string, optional)

### 409 Conflict Error

More than one resource in the account has this provider resource ID.

- `error` (string, optional)

## Types

### FindingExclusion

Exclusion that stops a detector from reporting findings for matching files, tables, or databases. Can be scoped either to a single resource or to all resources in your inventory.

- `id` (string, required) — ID of the finding exclusion.
- `scope` (enum, required) — Whether the exclusion applies to a single resource or to all resources in the Eon account. If set to `RESOURCE`, a resource ID must be set in `providerResourceId`.
  - Allowed values: `RESOURCE`, `ACCOUNT`
- `value` (string, required) — Matching value to exclude. The value set in this field depends on the specified `type`. - `PATH`: Matches files whose path starts with the specified value, case-sensitive. For example, `/data/tmp` matches `/data/tmp2/report.csv`. Linux paths are case-sensitive. Windows paths are case-insensitive, normalize for the file separator, and start with the drive letter. For example, `C:\Users\App\Cache` matches `c:/users/app/cache`. - `TABLE`: Exact table name. - `DATABASE`: Exact database name. - `KMS_KEY`: Either a KMS key ARN, or an AWS account ID to trust all keys in the account. Available for the ransomware detector only.
- `type` (enum, required) — Whether the finding is set to a file path, a database table, a whole database, or objects encrypted with a trusted KMS key. Used in combination with `value`.
  - Allowed values: `PATH`, `TABLE`, `DATABASE`, `KMS_KEY`
- `detector` (enum, required) — Detector type the exclusion applies to. If set to `MALWARE`, only paths can be excluded.
  - Allowed values: `RANSOMWARE_BEHAVIOR`, `DATA_ANOMALY`, `MALWARE`
- `updatedAt` (datetime, required) — Date and time the exclusion was updated.
- `providerResourceId` (string, optional) — Cloud-provider-assigned ID of the resource the exclusion applies to. Set when scope is `RESOURCE`.

## Examples

**Request**

```json
{
  "scope": "RESOURCE",
  "value": "/var/cache",
  "type": "PATH",
  "detector": "RANSOMWARE_BEHAVIOR"
}
```

**Response**

```json
{
  "findingExclusion": {
    "id": "4c1f3b0e-8d9a-4f55-9b1e-2d6f3a7c8e10",
    "scope": "RESOURCE",
    "value": "/var/cache",
    "type": "PATH",
    "detector": "RANSOMWARE_BEHAVIOR",
    "updatedAt": "2024-01-15T09:30:00Z",
    "providerResourceId": "i-0abc123def4567890"
  }
}
```

**SDK Code**

```python
import requests

url = "https://{account-domain}.console.eon.io/api/v1/projects/733888d8-2573-5f9a-b81d-21f051d24fda/finding-exclusions"

payload = {
    "scope": "RESOURCE",
    "value": "/var/cache",
    "type": "PATH",
    "detector": "RANSOMWARE_BEHAVIOR"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://{account-domain}.console.eon.io/api/v1/projects/733888d8-2573-5f9a-b81d-21f051d24fda/finding-exclusions';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"scope":"RESOURCE","value":"/var/cache","type":"PATH","detector":"RANSOMWARE_BEHAVIOR"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://{account-domain}.console.eon.io/api/v1/projects/733888d8-2573-5f9a-b81d-21f051d24fda/finding-exclusions")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"scope\": \"RESOURCE\",\n  \"value\": \"/var/cache\",\n  \"type\": \"PATH\",\n  \"detector\": \"RANSOMWARE_BEHAVIOR\"\n}")
  .asString();
```