---
title: Add Permission To SAPM Account
slug: single-connect-api-3-2-0/add-permission-to-sapm-account
description: Learn how to make a POST request using the curl command in this code example. Find out how to specify the URL, endpoint, and headers for accepting and sending JSON data. The data is sent as a JSON string in the request body.
docTags: 
createdAt: 2022-11-10T14:24:52.000Z
---

{
  "id": "MyJfUkVQcFQVpsqwEH7w0",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/sc/sapm/addPermissionToAccount",
    "method": "POST",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "name": "X-XSRF-TOKEN",
          "type": "string",
          "example": "{{csrftoken}}",
          "description": ""
        }
      ],
      "bodyDataParameters": [
        {
          "name": "body",
          "type": "string",
          "example": "{\r\n    \"sapmDbId\": 3589891,\r\n    \"newPermission\": [\r\n        {\r\n            \"userGroupId\": \"98b592a0-0ff6-40bc-804b-1c0030a5695e\",\r\n            \"permission\": \"FULL_CONTROL\"\r\n        },\r\n        {\r\n            \"userGroupId\": \"fe9bfde2-9530-4768-868c-6af5d16303a1\",\r\n            \"permission\": \"FULL_CONTROL\"\r\n        }\r\n    ]\r\n}",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Add Permission To SAPM Account",
        "jsonExample": "SUCCESS"
      }
    ],
    "contentType": "application/json",
    "description": "<p>You can add permissions to the SAPM account you send dbId of. You should send new permission as user group id : permission type.</p>",
    "examples": {
      "languages": [
        {
          "id": "annvI2lfAqaBFkxuCOUd9",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/sc/sapm/addPermissionToAccount \\\n     --header 'accept: application/json'"
        },
        {
          "id": "-YB2OYJgAPGNKd_6SXZF7",
          "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/sapm/addPermissionToAccount\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "DaWfJPJfTC2nnsNIJKjoU",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/sc/sapm/addPermissionToAccount\")\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": "SMbrLUqA4AICRv85guZXa",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/sc/sapm/addPermissionToAccount\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "annvI2lfAqaBFkxuCOUd9"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "SUCCESS"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}