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

# Delete Policy

> Delete Policy by ID. <br><h2>Notice</h2>Accessing the Policy Management APIs is through a dedicated domain/URL, according to your PlainID Tenant Location<li><b>United States (US)</b> - `https://api.us1.plainid.io`</li><li><b>Canada (CA)</b> - `https://api.ca1.plainid.io`</li><li><b>Europe (EU)</b> - `https://api.eu1.plainid.io`</li><br>
<h2>Using HTML Encoded Special Characters</h2> <p>Use HTML encoded patterns when working with values that contain special characters like spaces, dashes, etc. Refer to this <a href="https://www.w3schools.com/tags/ref_urlencode.ASP" target="_blank">HTML URL Encoding Reference</a> for a full list.</p> <br><h3>cURL Sample Guidelines</h3><p>In order for the relevant parameters to appear in the cURL sample, you can input the values in the interactive API console on the right in the Try It or Code Sample tabs. You can then copy the cURL sample from the Code Sample tab in the correct format.</p>

## OpenAPI

````json DELETE /api/2.0/policies/{envId}
{
  "openapi": "3.0.3",
  "info": {
    "title": "Management APIs",
    "version": "1.0.0",
    "contact": {
      "name": "PlainID",
      "url": "https://plainid.com",
      "email": "contact@plainid.com"
    },
    "license": {
      "name": "Commercial",
      "url": "https://plainid.com/license"
    },
    "termsOfService": "https://www.plainid.com/terms/",
    "description": "<h3>The PlainID Authorization Platform provides Management capabilities through the APIs below.</h3><h4> To access the Management APIs, make sure to enter your dedicated domain according to your PlainID Tenant Location:<table><thead><tr><th>Region</th><th>Base URL</th></tr></thead><tbody><tr><td>United States (US)</td><td>https://api.us1.plainid.io</td></tr><tr><td>Canada (CA)</td><td>https://api.ca1.plainid.io</td></tr><tr><td>Europe (EU)</td><td>https://api.eu1.plainid.io</td></tr><tr><td>Local PAA</td><td>https://api.plainid.local</td></tr></tbody></table>"
  },
  "servers": [
    {
      "description": "United States",
      "url": "https://api.us1.plainid.io"
    },
    {
      "description": "Europe",
      "url": "https://api.eu1.plainid.io"
    },
    {
      "description": "Canada",
      "url": "https://api.ca1.plainid.io"
    },
    {
      "description": "Local PAA",
      "url": "https://api.plainid.local"
    }
  ],
  "paths": {
    "/api/2.0/policies/{envId}": {
      "delete": {
        "tags": [
          "Policy Management APIs 2.0"
        ],
        "summary": "Delete Policy",
        "description": "Delete Policy by ID. <br><h2>Notice</h2>Accessing the Policy Management APIs is through a dedicated domain/URL, according to your PlainID Tenant Location<li><b>United States (US)</b> - `https://api.us1.plainid.io`</li><li><b>Canada (CA)</b> - `https://api.ca1.plainid.io`</li><li><b>Europe (EU)</b> - `https://api.eu1.plainid.io`</li><br>\n<h2>Using HTML Encoded Special Characters</h2> <p>Use HTML encoded patterns when working with values that contain special characters like spaces, dashes, etc. Refer to this <a href=\"https://www.w3schools.com/tags/ref_urlencode.ASP\" target=\"_blank\">HTML URL Encoding Reference</a> for a full list.</p> <br><h3>cURL Sample Guidelines</h3><p>In order for the relevant parameters to appear in the cURL sample, you can input the values in the interactive API console on the right in the Try It or Code Sample tabs. You can then copy the cURL sample from the Code Sample tab in the correct format.</p>",
        "operationId": "deletePolicy",
        "parameters": [
          {
            "in": "path",
            "name": "envId",
            "required": "true",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The Environment ID can be found under the Details Tab in the Environment Settings."
          },
          {
            "in": "query",
            "name": "filter[authWsId]",
            "description": "Authorization Workspace ID. This can be found in your Authorization Workspace Settings under Workspace ID.",
            "required": "true",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "filter[id]",
            "description": "Policy ID Filter. *Required if `filter[id][in]` is not provided",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filter[id][in]",
            "description": "Filter for multiple Policy IDs. *Required if `filter[id]` is not provided.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "successful operation",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "not found",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                },
                "examples": {
                  "Policy not found": {
                    "value": {
                      "errors": [
                        {
                          "code": "PUA-033",
                          "args": {
                            "0": "a0a455bb-7dc3-4cd3-b0d2-86631ac75379",
                            "1": "ceef5853-1491-4d1c-ae52-2f2a1729b3a4"
                          },
                          "id": "E7WJBB",
                          "status": "404",
                          "name": "PolicyNotFoundError",
                          "message": "Policy Id doesn't exist in the environment"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Failed - Invalid UUID",
            "headers": {
              "x-request-id": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                },
                "examples": {
                  "Invalid ID Format": {
                    "value": {
                      "errors": [
                        {
                          "code": "V-032",
                          "args": {
                            "0": "ed252aa5-9d0c-4193-838-60bf20b13109",
                            "1": "uuid"
                          },
                          "id": "EEJQMA",
                          "status": "422",
                          "name": "UnprocessableEntityError",
                          "message": "$: test is an invalid uuid"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Errors": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "args": {
            "type": "object",
            "properties": {
              "path": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
````

