# Automate Data Store Monitor Activities

**Data Store Monitors** scan databases to produce [Datasets](/content/docs/data-mapping/reference/monitor-api/index.html) that are labeled with the [Fideslang](/content/docs/data-mapping/guides/data-mapping-annotations#fideslang-data-categories/index.html) data privacy taxonomy.

## Monitor Management  
These API calls are for managing the monitor metadata; this is useful for updating scan schedules and classification parameters.

### Retrieve Monitors  
```
GET /api/v1/plus/discovery-monitor
GET /api/v1/plus/discovery-monitor/{{monitor_config_key}}
```

### Update a Monitor (Upsert)  
```
PUT /api/v1/plus/discovery-monitor

{
 "name": "Monitor Name",
 "key": "Monitor_Name",
 "connection_config_key": "integration-key",
 "classify_params": {
    "possible_targets": [
        "user.financial.account_number",
        "user.payment.financial_account_number",
        "user.credentials.biometric_credentials"
    ],
    "num_samples": 25,
    "context_weight": 0.95,
    "content_weight": 0.05,
    "excluded_categories": [],
    "context_regex_pattern_mapping": [
        [ ".*dob", "user.demographic.date_of_birth" ],
        [ ".*full_name", "user.name" ]
    ]
  },
  "datasource_params": {},
  "databases": [],
  "execution_start_date": "2025-06-19T15:06:00Z",
  "execution_frequency": "Daily",
  "excluded_databases": [],
  "enabled": true,
  "shared_config_id": null,
  "last_monitored": "2025-08-04T15:08:14.368665Z"
}
```

⚠️  
This endpoint is a PUT - make sure to call GET /api/v1/plus/discovery-monitor/{{monitor_config_key}} and pass the entire body of that response with any desired updates, to avoid losing your configuration!

## Staged Resources & Results  
The `/results` endpoint is used to retrieve **staged resources**; this is used to traverse the staged resource hierarchy.

A **staged resource** is specified by the _staged_resource_urn_ query parameter. If a _staged_resource_urn_ is not provided, then the top-level **staged resources** are returned.

The API can recursively traverse the staged resource hierarchy; the API response object contains child _urn_ fields, which can then be provided as the _staged_resource_urn_ parameter in a subsequent API call to see that resource's children, and so on.

### Retrieve Results  
```
GET /api/v1/plus/discovery-monitor/results
GET /api/v1/plus/discovery-monitor/results?staged_resource_urn={{staged_resource_urn}}&page=1&size=50
```

## Detection Actions  
These API calls designate which assets in your data architecture are included in your Fides pipeline.

### Confirm  
Any confirmed asset will be monitored and listed in Discovery.

When you confirm a resource the endpoint will return a `monitor_task_id`. You will want to save this for a later step in this guide.

```
POST /api/v1/plus/discovery-monitor/{{monitor_config_key}}/{{staged_resource_urn}}/confirm
```

💡  
If you'd like to 're-classify' already monitored resources, use the query param: ?classify_monitored_resources=true

### Mute  
Any _muted_ asset will not be moved to the Discovery step. Muted assets will no longer be detected in scans. If you wish to include it again unmute it.

```
POST /api/v1/plus/discovery-monitor/mute
```

```
["staged_resource_urn1", "staged_resource_urn2"]
```

### Unmute  
Unmuted assets will be detected in scans. An unmuted asset will still need to be confirmed in order to be moved to the Discovery step.

```
POST /api/v1/plus/discovery-monitor/un-mute
```

```
["staged_resource_urn1", "staged_resource_urn2"]
```

## Discovery Actions  
### Update Data Categories for Staged Resources  
```
PATCH /api/v1/plus/discovery-monitor/{{monitor_config_key}}/results
```

```
[
  {
    "urn": "staged_resource_urn1",
    "user_assigned_data_categories": [
      "user.name"
    ],
    "user_assigned_data_uses": [
      "marketing.third_party"
    ],
    "user_assigned_system_key": "system_key"
  }
]
```

### Promote Staged Resources to Dataset  
```
POST /api/v1/plus/discovery-monitor/promote
```

```
["staged_resource_urn1", "staged_resource_urn2"]
```

## Dataset Queries  
The resources have now been promoted to a [Dataset](/content/docs/data-mapping/reference/monitor-api/index.html). To validate the output, retrieve data through the dataset endpoint.

```
GET /api/v1/dataset/{fides_key}
```

## Task Management  
The task management APIs are used to track the [Fides worker](/content/docs/cli-reference/task/cmd-worker/index.html) processing status.

💡  
The previously saved _monitor_task_id_ from the call to Confirm the resource is the ID used in the Discovery Monitor Task API.

```
GET /api/v1/plus/discovery-monitor/tasks?status=in_processing&action_type=classification
GET /api/v1/plus/discovery-monitor/tasks/{{monitor_task_id}}
```
