---
title: Edit Masking Policy
slug: single-connect-api-3-2-0/edit-masking-policy
description: Learn how to update a masking policy by making a POST request using the `curl` command. This comprehensive document provides a code example that guides you through providing the URL, headers (`Accept` and `Content-Type`), and the request body required for
docTags: 
createdAt: 2022-11-10T14:24:52.000Z
---

{
  "id": "fo_1CQmixlhO1e6yfpY3d",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/sc/sqlproxy/updateMaskingPolicy",
    "method": "POST",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "name": "Content-Type",
          "type": "string",
          "example": "application/json",
          "description": ""
        },
        {
          "name": "X-XSRF-TOKEN",
          "type": "string",
          "example": "{{csrftoken}}",
          "description": ""
        }
      ],
      "bodyDataParameters": [
        {
          "name": "body",
          "type": "string",
          "example": "{\r\n    \"dbId\": 578523,\r\n    \"name\": \"new policy\",\r\n    \"description\": \"new masking policy\",\r\n    \"database\": \"new datasource\",\r\n    \"active\": true,\r\n    \"rowLimit\": 40,\r\n    \"schema\": \"SQLPROXY\",\r\n    \"table\": \"EMPLOYEES\",\r\n    \"column\": \"FIRST_NAME\",\r\n    \"methodDbId\": 465450\r\n}",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This method enables user to edit previously saved masking policies.\r\ndbId of the method should be posted correctly. Other properties can be edited.",
    "examples": {
      "languages": [
        {
          "id": "Uu0UK0E3oQN8I7ql4Fcj0",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/sc/sqlproxy/updateMaskingPolicy \\\n     --header 'accept: application/json'"
        },
        {
          "id": "oZnWASb4z6wgN9v3k2gc1",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/sc/sqlproxy/updateMaskingPolicy\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "JTmrGfib3y_91V6lM47o4",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/sc/sqlproxy/updateMaskingPolicy\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "5c_z0WATp2HAUHYmqrpY9",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/sc/sqlproxy/updateMaskingPolicy\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "Uu0UK0E3oQN8I7ql4Fcj0"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": ""
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}