---
title: Creating New Vault Account with File
slug: kron-pam-api-collection-381-patch3/creating-new-vault-account-with-file
docTags: 
createdAt: 2026-10-21T06:07:16.182Z
---

{
  "id": "_-Xz5Kz7rYy0tMWV1Co3h",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "{{url}}/aioc-rest-web/rest/sc/sapm/addSapmAccountWithFile?configId=-2000004&accountName=TestAccount3&groupId=bb4f95ef-c302-4229-8383-c8e0edcde66b",
    "name": "",
    "description": "<h3>Request Overview</h3>\n<p>To create a Vault Account with file upload, use the <code>List Vault Groups</code> request to obtain the id of the Vault Group you want to upload to. Then, enter the name you've given to the Vault Account in the accountName field. The configId parameter needs to be -2000004.</p>\n<p>If you're using Postman, upload one file in the form-data type body as shown below.</p>\n<p>The type of file you can upload depends on the config parameters in your Vault Account (initially only pdf, png, pfx are allowed). In React, go to Secrets > Configuration and edit the file upload config there. From this section, you can add the file types you want and change the upload size as needed.</p>",
    "contentType": "application/json",
    "request": {
      "headerParameters": [
        {
          "name": "X-XSRF-TOKEN",
          "description": "",
          "default": "{{csrftoken}}",
          "value": "{{csrftoken}}",
          "type": "string"
        }
      ],
      "queryParameters": [
        {
          "name": "configId",
          "description": "",
          "default": "-2000004",
          "value": "-2000004",
          "type": "string"
        },
        {
          "name": "accountName",
          "description": "",
          "default": "TestAccount3",
          "value": "TestAccount3",
          "type": "string"
        },
        {
          "name": "groupId",
          "description": "",
          "default": "bb4f95ef-c302-4229-8383-c8e0edcde66b",
          "value": "bb4f95ef-c302-4229-8383-c8e0edcde66b",
          "type": "string"
        }
      ],
      "pathParameters": [
        {
          "name": "url",
          "description": "",
          "default": "url",
          "value": "url",
          "type": "string"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [
        {
          "name": "file",
          "description": "",
          "default": "",
          "value": "",
          "type": "file"
        }
      ],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Creating new Vault Account with File",
        "jsonExample": "{\n    \"dbId\": 974563,\n    \"device\": null,\n    \"secretName\": \"TestAccount2\",\n    \"config\": {\n        \"configId\": -2000004,\n        \"name\": \"File Upload\",\n        \"description\": \"File Upload\",\n        \"strategy\": \"STATIC\",\n        \"staticSecretType\": \"FILE\",\n        \"properties\": {\n            \"static.secret.type\": \"FILE\",\n            \"file.upload.max.size\": \"2000\",\n            \"file.upload.file.type\": \"png,pfx,pdf\"\n        },\n        \"exactMatch4Search\": false,\n        \"recordLimit4Search\": null,\n        \"duplicatedConfigId\": null\n    },\n    \"changePeriod\": null,\n    \"username\": null,\n    \"description\": null,\n    \"secretNotes\": null,\n    \"additionalInfo\": null,\n    \"lastChangeTime\": 1710506573643,\n    \"nextChangeTime\": null,\n    \"passwordSeenStatus\": \"UNSEEN\",\n    \"validationStatus\": \"UNKNOWN\",\n    \"masterAccountId\": null,\n    \"accountLevelProperties\": {},\n    \"accountTags\": {},\n    \"permissions\": [],\n    \"identicalSapmAccounts\": [],\n    \"parentSapmGroup\": {\n        \"dbId\": 974490,\n        \"id\": \"bb4f95ef-c302-4229-8383-c8e0edcde66b\",\n        \"name\": \"sapm\",\n        \"description\": null\n    },\n    \"secretType\": \"STATIC\",\n    \"owner\": {\n        \"id\": \"25e53f47-ce66-4df2-9abc-6961dc668264\",\n        \"eid\": \"admin\"\n    },\n    \"createdAt\": 1710506573647,\n    \"updatedAt\": 1710506573647,\n    \"managers\": [],\n    \"userPermissionLevel\": -2147483648,\n    \"privateType\": \"YES\",\n    \"approvalStatus\": null,\n    \"escalatedManagers\": [],\n    \"groupFullPath\": null,\n    \"approvedBy\": null,\n    \"approvedDate\": null,\n    \"approvalRequired\": false\n}"
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "9uQ2trgIaSJWccQftRXPf",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url '{{url}}/aioc-rest-web/rest/sc/sapm/addSapmAccountWithFile?configId=-2000004&accountName=TestAccount3&groupId=bb4f95ef-c302-4229-8383-c8e0edcde66b&configId=-2000004&accountName=TestAccount3&groupId=bb4f95ef-c302-4229-8383-c8e0edcde66b' \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --header 'x-xsrf-token: {{csrftoken}}' \\\n     --form 'file=\"file\"'"
        },
        {
          "id": "Mf_628MgE0jN4U1WG36K5",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-xsrf-token\", \"{{csrftoken}}\");\n\nvar formdata = new FormData();\nformdata.append(\"file\", \"file\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: formdata,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/sc/sapm/addSapmAccountWithFile?configId=-2000004&accountName=TestAccount3&groupId=bb4f95ef-c302-4229-8383-c8e0edcde66b&configId=-2000004&accountName=TestAccount3&groupId=bb4f95ef-c302-4229-8383-c8e0edcde66b\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "Xae1DT4Wow2XI7ReWMXes",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/sc/sapm/addSapmAccountWithFile?configId=-2000004&accountName=TestAccount3&groupId=bb4f95ef-c302-4229-8383-c8e0edcde66b&configId=-2000004&accountName=TestAccount3&groupId=bb4f95ef-c302-4229-8383-c8e0edcde66b\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-xsrf-token\"] = \"{{csrftoken}}\"\nform_data = [['file', File.open('undefined')]]\nrequest.set_form form_data, 'multipart/form-data'\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "pazAdoCS2uu-AInp85tnA",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/sc/sapm/addSapmAccountWithFile?configId=-2000004&accountName=TestAccount3&groupId=bb4f95ef-c302-4229-8383-c8e0edcde66b&configId=-2000004&accountName=TestAccount3&groupId=bb4f95ef-c302-4229-8383-c8e0edcde66b\"\n\npayload = {}\nfiles=[\n\n]\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-xsrf-token': '{{csrftoken}}'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload, files=files)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "9uQ2trgIaSJWccQftRXPf"
    },
    "results": {
      "languages": [
        {
          "id": "uKti0sfS1JhBct74eTCqR",
          "language": "200",
          "code": "{\n    \"dbId\": 974563,\n    \"device\": null,\n    \"secretName\": \"TestAccount2\",\n    \"config\": {\n        \"configId\": -2000004,\n        \"name\": \"File Upload\",\n        \"description\": \"File Upload\",\n        \"strategy\": \"STATIC\",\n        \"staticSecretType\": \"FILE\",\n        \"properties\": {\n            \"static.secret.type\": \"FILE\",\n            \"file.upload.max.size\": \"2000\",\n            \"file.upload.file.type\": \"png,pfx,pdf\"\n        },\n        \"exactMatch4Search\": false,\n        \"recordLimit4Search\": null,\n        \"duplicatedConfigId\": null\n    },\n    \"changePeriod\": null,\n    \"username\": null,\n    \"description\": null,\n    \"secretNotes\": null,\n    \"additionalInfo\": null,\n    \"lastChangeTime\": 1710506573643,\n    \"nextChangeTime\": null,\n    \"passwordSeenStatus\": \"UNSEEN\",\n    \"validationStatus\": \"UNKNOWN\",\n    \"masterAccountId\": null,\n    \"accountLevelProperties\": {},\n    \"accountTags\": {},\n    \"permissions\": [],\n    \"identicalSapmAccounts\": [],\n    \"parentSapmGroup\": {\n        \"dbId\": 974490,\n        \"id\": \"bb4f95ef-c302-4229-8383-c8e0edcde66b\",\n        \"name\": \"sapm\",\n        \"description\": null\n    },\n    \"secretType\": \"STATIC\",\n    \"owner\": {\n        \"id\": \"25e53f47-ce66-4df2-9abc-6961dc668264\",\n        \"eid\": \"admin\"\n    },\n    \"createdAt\": 1710506573647,\n    \"updatedAt\": 1710506573647,\n    \"managers\": [],\n    \"userPermissionLevel\": -2147483648,\n    \"privateType\": \"YES\",\n    \"approvalStatus\": null,\n    \"escalatedManagers\": [],\n    \"groupFullPath\": null,\n    \"approvedBy\": null,\n    \"approvedDate\": null,\n    \"approvalRequired\": false\n}"
        }
      ],
      "selectedLanguageId": "uKti0sfS1JhBct74eTCqR"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}