# Asset Discovery Custom Discovery Rule Create

POST /easm/discovery/custom-rules: Creates a custom discovery rule.

Source: https://docs.deepinfo.com/reference/easm/asset-discovery-custom-discovery-rule-create/

Last updated: 2026-09-27

---
`POST https://api.deepinfo.com/v1/easm/discovery/custom-rules`

Creates a custom discovery rule. `filters` select which domains in Deepinfo's dataset become candidates; `auto_approval` adds them to your assets directly.

## Authentication

Send your API key in the `apikey` request header.

## Request Body

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | Required | min length `1`; max length `255` |
| `filters` | object | Required | The filters of the rule; see the example request body |
| `tags` | array | Optional | max items `10` |
| `auto_approval` | boolean | Required |  |
| `enabled` | boolean | Required |  |

```json
{
  "name": "Main domains",
  "filters": {
    "must": [
      {
        "name": "webdata.http.final_domain",
        "value": "acme.example",
        "type": "eq"
      }
    ],
    "must_not": [],
    "should": []
  },
  "tags": [],
  "auto_approval": false,
  "enabled": true
}
```

## Response Fields

| Field | Type | Description |
|---|---|---|
| `id` | string |  |
| `name` | string |  |
| `filters` | object |  |
| `tags` | array of string |  |
| `auto_approval` | boolean |  |
| `enabled` | boolean |  |
| `create_date` | string | date-time |
| `last_update_date` | string | date-time |

## Response Schema

_Inferred from examples._ Built from the saved 2xx example response: the fields it contains, with the types seen there. It is not a contract.

| Field | Type |
|---|---|
| `id` | string |
| `name` | string |
| `filters` | object |
| `filters.must` | array<object> |
| `filters.must[].name` | string |
| `filters.must[].value` | string |
| `filters.must[].type` | string |
| `filters.must_not` | array |
| `filters.should` | array |
| `tags` | array |
| `auto_approval` | boolean |
| `enabled` | boolean |
| `create_date` | string |
| `last_update_date` | string |

## Examples

### 201 · Created

```bash
curl -X POST 'https://api.deepinfo.com/v1/easm/discovery/custom-rules' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Main domains",
  "filters": {
    "must": [
      {
        "name": "webdata.http.final_domain",
        "value": "acme.example",
        "type": "eq"
      }
    ],
    "must_not": [],
    "should": []
  },
  "tags": [],
  "auto_approval": false,
  "enabled": true
}'
```

`Content-Type: application/json` · `deepinfo-request-id: 00000000-0000-4000-8000-0000356d0001`

```json
{
  "id": "00000000000000000000000e8e040001",
  "name": "Main domains",
  "filters": {
    "must": [
      {
        "name": "webdata.http.final_domain",
        "value": "acme.example",
        "type": "eq"
      }
    ],
    "must_not": [],
    "should": []
  },
  "tags": [],
  "auto_approval": false,
  "enabled": true,
  "create_date": "2025-06-01T08:00:00Z",
  "last_update_date": "2025-07-01T08:00:00Z"
}
```

### 400 · Validation Error (empty body {})

```bash
curl -X POST 'https://api.deepinfo.com/v1/easm/discovery/custom-rules' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{}'
```

`Content-Type: application/json` · `deepinfo-request-id: 00000000-0000-4000-8000-0000356d0001`

```json
{
  "code": 10400,
  "parameters": [
    {
      "param": "name",
      "details": [
        "This field is required."
      ]
    },
    {
      "param": "filters",
      "details": [
        "This field is required."
      ]
    }
  ],
  "solution": "https://docs.deepinfo.com/reference/"
}
```
