---
title: Update Element Type
slug: single-connect-api-3-2-0/update-element-type
description: Learn how to use curl to effortlessly save element types with this helpful code example. Streamline your development process and enhance productivity today.
docTags: 
createdAt: 2022-11-10T14:24:52.000Z
---

{
  "id": "LCVH3OtM8aJrb7IHIDR_z",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/elementType/saveElementType",
    "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\": \"8643\",                                                   \r\n      \"elementTypeId\": \"acme\",                                \r\n        \"elementTypeName\": \"ACME\",                       \r\n        \"vendor\": {\r\n            \"dbId\": 57,\r\n            \"name\": \"Acme\"\r\n        },\r\n        \"category\": {\r\n            \"dbId\": 54,\r\n            \"name\": \"Other\"\r\n        },\r\n        \"elementTypeProperties\": [{\r\n                \"dbId\": 20474,\r\n                \"elementTypePropertyValue\": \".*(?i)user(name)?.*\",\r\n                \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.exc_last_line_patterns\",\r\n                \"elementTypePropertyType\": {\r\n                    \"displayName\": \"enforcer.terminal.behaviour.exc_last_line_patterns\",\r\n                    \"allowMultipleValues\": true,\r\n                    \"valuesPredefined\": false,\r\n                    \"elementTypePropertyValues\": null,\r\n                    \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.exc_last_line_patterns\",\r\n                    \"valueType\": \"REGEX\",\r\n                    \"encryption\": false\r\n                }\r\n            },\r\n            {\r\n                \"dbId\": 130,\r\n                \"elementTypePropertyValue\": \".*(?i)password.*[:|&gt].*\",\r\n                \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.exc_last_line_patterns\",\r\n                \"elementTypePropertyType\": {\r\n                    \"displayName\": \"enforcer.terminal.behaviour.exc_last_line_patterns\",\r\n                    \"allowMultipleValues\": true,\r\n                    \"valuesPredefined\": false,\r\n                    \"elementTypePropertyValues\": null,\r\n                    \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.exc_last_line_patterns\",\r\n                    \"valueType\": \"REGEX\",\r\n                    \"encryption\": false\r\n                }\r\n            }]\r\n    }\r\n",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "500",
        "description": "updateElementType",
        "jsonExample": "Element Type Id already exists."
      }
    ],
    "contentType": "application/json",
    "description": "<p>This method updates an existing element type.\r\nMandatory Fields:\r\n\"elementTypeId\", \"elementTypeName\" and \"dbId\" info should be added to request body.</p>",
    "examples": {
      "languages": [
        {
          "id": "pLxcOHyi1vChDqrWLUXkQ",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/elementType/saveElementType \\\n     --header 'accept: application/json'"
        },
        {
          "id": "LgCXsE92_THS-EmfcbW0_",
          "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/elementType/saveElementType\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "j7ttmoHXMBZSbi3mMQOP3",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/elementType/saveElementType\")\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": "7VzTWL_cDDmMvxAg3lwuP",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/elementType/saveElementType\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "pLxcOHyi1vChDqrWLUXkQ"
    },
    "results": {
      "languages": [
        {
          "id": "Hiv1QWhVqIXlwUaRh8rUU",
          "language": "500",
          "code": "Element Type Id already exists."
        }
      ],
      "selectedLanguageId": "Hiv1QWhVqIXlwUaRh8rUU"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}