> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Or Update Watchlist

Create or update a watchlist and it's items.

<Note>
  External Documentation

  To learn more, visit the [Microsoft Sentinel documentation](https://learn.microsoft.com/en-us/rest/api/securityinsights/watchlists/create-or-update?view=rest-securityinsights-2023-02-01\&tabs=HTTP).
</Note>

## Basic Parameters

<div className="integrations-table">
  | Parameter           | Description                                                                                                                    |
  | ------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
  | Display Name        | The display name of the watchlist.                                                                                             |
  | Item Search Key     | The search key is used to optimize query performance when using watchlists for joins with other data.                          |
  | Provider            | The provider of the watchlist.                                                                                                 |
  | Resource Group Name | The name of the resource group. The name is case insensitive.                                                                  |
  | Source              | The source of the watchlist.                                                                                                   |
  | Subscription ID     | The ID of the target subscription.                                                                                             |
  | Watchlist Alias     | Watchlist alias to upsert. If doesn't exist, creates the watchlist with the given alias and properties. Otherwise, updates it. |
  | Workspace Name      | The name of the workspace.                                                                                                     |
</div>

## Advanced Parameters

<div className="integrations-table">
  | Parameter               | Description                                                                                                                                                                                                                                                  |
  | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
  | Content Type            | The content type of the raw content. <br /><br />**Note:** Only text/csv is valid.                                                                                                                                                                           |
  | Default Duration        | The default duration of a watchlist <br /><br />**Note:** Provide a valid ISO 8601 duration format. <br /><br />For example, `P3Y6M4DT12H30M5S` Represents a duration of three years, six months, four days, twelve hours, thirty minutes, and five seconds. |
  | Description             | A description of the watchlist.                                                                                                                                                                                                                              |
  | Etag                    | The Etag of the azure resource.                                                                                                                                                                                                                              |
  | Number Of Lines To Skip | The number of lines in a `CSV` content to skip before the header.                                                                                                                                                                                            |
  | Raw Content             | The raw content that represents the watchlist items to create.                                                                                                                                                                                               |
  | Tenant ID               | The tenant ID where the watchlist belongs to.                                                                                                                                                                                                                |
  | Upload Status           | The status of the watchlist upload.                                                                                                                                                                                                                          |
  | Watchlist ID            | The ID of the watchlist.                                                                                                                                                                                                                                     |
  | Watchlist Labels        | A comma-separated list of labels relevant to this watchlist.                                                                                                                                                                                                 |
  | Watchlist Type          | The type of the watchlist.                                                                                                                                                                                                                                   |
</div>

## Example Output

```json theme={"dark"}
{
	"id": "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalIinsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/watchlists/highValueAsset",
	"name": "highValueAsset",
	"etag": "\"0300bf09-0000-0000-0000-5c37296e0000\"",
	"type": "Microsoft.SecurityInsights/Watchlists",
	"systemData": {
		"createdAt": "2024-05-28T19:06:07",
		"createdBy": "<string>",
		"createdByType": "<string>",
		"lastModifiedAt": "2021-02-15T20:11:09",
		"lastModifiedBy": "<string>",
		"lastModifiedByType": "<string>"
	},
	"properties": {
		"watchlistId": "76d5a51f-ba1f-4038-9d22-59fda38dc017",
		"displayName": "High Value Assets Watchlist",
		"provider": "Microsoft",
		"source": "Local file",
		"itemsSearchKey": "header1",
		"created": "2020-09-28T00:26:54.7746089+00:00",
		"updated": "2020-09-28T00:26:57+00:00",
		"createdBy": {
			"objectId": "2046feea-040d-4a46-9e2b-91c2941bfa70",
			"email": "john@contoso.com",
			"name": "john doe"
		},
		"updatedBy": {
			"objectId": "2046feea-040d-4a46-9e2b-91c2941bfa70",
			"email": "john@contoso.com",
			"name": "john doe"
		},
		"description": "Watchlist from CSV content",
		"watchlistType": "watchlist",
		"watchlistAlias": "highValueAsset",
		"isDeleted": false,
		"labels": [
			"<string>"
		],
		"defaultDuration": "<string>",
		"tenantId": "f686d426-8d16-42db-81b7-ab578e110ccd",
		"numberOfLinesToSkip": 871
	}
}
```

## Workflow Library Example

[Create or Update Watchlist with Microsoft Sentinel and Send Results Via Email](https://library.blinkops.com/workflows/create-or-update-watchlist-with-microsoft-sentinel-and-send-results-via-email)

<div className="iframe-wrapper">
  <div className="iframe-media">
    <img src="https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max&auto=format&n=ojHYuDeYX5FWuN8a&q=85&s=b8af968e71438a9499c3223c9bd29fb2" alt="Workflow Library" width="16" height="16" data-path="img/Icons/play-box.svg" />

    Preview this Workflow on desktop
  </div>

  <iframe className="iframe" src="https://library.blinkops.com/workflows/create-or-update-watchlist-with-microsoft-sentinel-and-send-results-via-email/canvas" />
</div>
