---
title: "PUT /policies/{policyName}"
method: PUT
path: "/policies/{policyName}"
tags: ["Policies"]
---

# PUT /policies/{policyName}

`PUT /policies/{policyName}`

Create a policy with a given policyName.

## Path parameters

- `policyName` string, required

## Query parameters

- `api-version` string, required

## Request body

- Policy — This is an object that exists to provide a common schema definition for the policy response.
  - `id` string — This is typically the same as the name but might be different for different models.
  - `name` string, required — The caller provided unique name for the resource.
  - `displayName` string — The name that can be used for display purposes.
  - `description` string — A human readable description of what the policy should do.
  - `filterName` string, required — Name of the saved filter query to be used to select assets that are to be updated by a given policy.
  - `action` 'addResource' | 'removeResource' | 'setState' | 'setExternalID' | 'removeFromInventory', required — A list of policy actions
  - `updatedAssetsCount` integer — Number of assets in inventory that have been updated by this policy.
  - `user` string — The unique name of the user that created the policy user@gmail.com
  - `createdDate` string, date-time — The date this policy was created, in RFC3339 format.
  - `updatedDate` string, date-time — The date this policy was last updated, in RFC3339 format.
  - `actionParameters` ActionParameters, required — This is an object that exists to provide a common schema definition for the action parameters.
    - `value` string — The value parameter that is used by the policy action. This is action specific, for further information please refer to documentation here: https://learn.microsoft.com/en-us/azure/external-attack-surface-management/policy-engine

## Response `200`

The request has succeeded.

- Policy — This is an object that exists to provide a common schema definition for the policy response.
  - `id` string — This is typically the same as the name but might be different for different models.
  - `name` string, required — The caller provided unique name for the resource.
  - `displayName` string — The name that can be used for display purposes.
  - `description` string — A human readable description of what the policy should do.
  - `filterName` string, required — Name of the saved filter query to be used to select assets that are to be updated by a given policy.
  - `action` 'addResource' | 'removeResource' | 'setState' | 'setExternalID' | 'removeFromInventory', required — A list of policy actions
  - `updatedAssetsCount` integer — Number of assets in inventory that have been updated by this policy.
  - `user` string — The unique name of the user that created the policy user@gmail.com
  - `createdDate` string, date-time — The date this policy was created, in RFC3339 format.
  - `updatedDate` string, date-time — The date this policy was last updated, in RFC3339 format.
  - `actionParameters` ActionParameters, required — This is an object that exists to provide a common schema definition for the action parameters.
    - `value` string — The value parameter that is used by the policy action. This is action specific, for further information please refer to documentation here: https://learn.microsoft.com/en-us/azure/external-attack-surface-management/policy-engine

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.net/azure/apis/riskiq-microsoft-easm.md) · [All operations](https://skmtc.net/azure/apis/riskiq-microsoft-easm/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/riskiq-microsoft-easm/versions/5865b52c51a3/schema)
