---
title: Set Permission For Sapm Group
slug: single-connect-api-3-0-3/set-permission-for-sapm-group
description: Learn how to make a POST request using Curl with this code example. Discover the simple steps and syntax to interact with APIs and send data efficiently. Enhance your programming skills and effectively handle data transfers with Curl.
docTags: 
createdAt: 2022-11-10T14:21:49.000Z
---

{
  "id": "9vcON-rMwO_hD6LN9Ph4e",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/sc/sapm/setPermissionForGroup",
    "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": "{\n\t\"dbId\":3640966,\n\t\"newPermission\":[\n        {\n            \"userGroupId\": \"98b592a0-0ff6-40bc-804b-1c0030a5695e\",\n            \"permission\": \"FULL_CONTROL\"\n        },\n        {\n            \"userGroupId\": \"fe9bfde2-9530-4768-868c-6af5d16303a1\",\n            \"permission\": \"FULL_CONTROL\"\n        }\n    ],\n    \"applyType\" : \"ONE_LEVEL\"\n}",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Set Permission For Sapm Group",
        "jsonExample": "SUCCESS"
      }
    ],
    "contentType": "application/json",
    "description": "<p>This API allows you to set SAPM group's permissions of which you sent dbId of. You should send them as user group id :  permission type. applyType can take one of following values: THIS_ONLY, ONE_LEVEL, FULL_TREE</p>",
    "examples": {
      "languages": [
        {
          "id": "Vx0nD0cqKI-1kq8DLIGqf",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/sc/sapm/setPermissionForGroup \\\n     --header 'accept: application/json'"
        },
        {
          "id": "juSHUhqlY3HYBeIGcGveU",
          "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/setPermissionForGroup\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "aYYRxpCUsf8zncV2YJH74",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/sc/sapm/setPermissionForGroup\")\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": "ccRSCFtynwvfTKsHJp30O",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{url}}/aioc-rest-web/rest/sc/sapm/setPermissionForGroup\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "Vx0nD0cqKI-1kq8DLIGqf"
    },
    "results": {
      "languages": [
        {
          "id": "aTcqolkVajNZh5GYcbgCv",
          "language": "200",
          "code": "SUCCESS"
        }
      ],
      "selectedLanguageId": "aTcqolkVajNZh5GYcbgCv"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}