---
title: Update a Group's memberships
slug: update-a-groups-memberships
docTags: 
createdAt: 2023-11-07T15:25:31.944Z
---

{
  "id": "IpbQmrEY19BS34NuYkkoC",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "https://example.com/scim/v2/Groups/{urn}",
    "servers": [
      {
        "url": "https://example.com/scim/v2/Groups/{urn}",
        "description": "Jobylon Staging"
      }
    ],
    "name": "Update a Group's memberships",
    "description": "Update a Group's memberships using SCIM Operations \"add\" or \"remove\" to add or remove users. Users are automatically attributed the Group's role in all of the Group's companies.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "urn",
          "type": "string",
          "description": "<p>Group's URN in the \"urn:jobylon:scim:&#x3C;customer_id>:groups:&#x3C;group_id>\" format</p>"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "Add or remove users from a Group",
          "customType": "GroupPatch",
          "schema": [
            {
              "name": "schemas",
              "kind": "optional",
              "type": "array",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "urn:ietf:params:scim:api:messages:2.0:PatchOp"
            },
            {
              "name": "Operations",
              "kind": "optional",
              "type": "array",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "op",
                  "kind": "optional",
                  "type": "string<add | remove>",
                  "description": "Operation to be performed.",
                  "example": ""
                },
                {
                  "name": "path",
                  "kind": "optional",
                  "type": "string",
                  "description": "The JSON path for the field to be updated.",
                  "example": "members"
                },
                {
                  "name": "value",
                  "kind": "optional",
                  "type": "array",
                  "example": "",
                  "itemType": "object",
                  "customType": "object[]",
                  "schema": [
                    {
                      "name": "value",
                      "kind": "optional",
                      "type": "string",
                      "description": "Users to add or remove (URN)",
                      "example": "urn:jobylon:scim:1:users:1"
                    }
                  ]
                }
              ]
            }
          ],
          "modelRef": "#/components/schemas/GroupPatch",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "ihIhtto-mN-4ZKWTjI4iV",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PATCH \\\n     --url https://example.com/scim/v2/Groups/{urn} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "k1cF2dXZxdy1ArVkbtwsI",
          "language": "go",
          "label": "Go",
          "code": "package main\n\nimport (\n   \"fmt\"\n   \"net/http\"\n   \"io/ioutil\"\n)\n\nfunc main() {\n\n   url := \"https://example.com/scim/v2/Groups/{urn}\"\n   method := \"PATCH\"\n\n   client := &http.Client {\n   }\n   req, err := http.NewRequest(method, url, nil)\n\n   if err != nil {\n      fmt.Println(err)\n      return\n   }\n   req.Header.Add(\"accept\", \"application/json\")\n   req.Header.Add(\"content-type\", \"application/json\")\n\n   res, err := client.Do(req)\n   if err != nil {\n      fmt.Println(err)\n      return\n   }\n   defer res.Body.Close()\n\n   body, err := ioutil.ReadAll(res.Body)\n   if err != nil {\n      fmt.Println(err)\n      return\n   }\n   fmt.Println(string(body))\n}"
        },
        {
          "id": "N5QEtbWvLr40dsyQVXPcH",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://example.com/scim/v2/Groups/{urn}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"PATCH\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        },
        {
          "id": "voQMQx2JSFi5dELbJ5pNc",
          "language": "javascript",
          "label": "JavaScript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'PATCH',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://example.com/scim/v2/Groups/{urn}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "v0l4-fbBB9I8UJPLZfNWf",
          "language": "java",
          "label": "Java",
          "code": "OkHttpClient client = new OkHttpClient().newBuilder()\n   .build();\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"\");\nRequest request = new Request.Builder()\n   .url(\"https://example.com/scim/v2/Groups/{urn}\")\n   .method(\"PATCH\", body)\n   .addHeader(\"accept\", \"application/json\")\n   .addHeader(\"content-type\", \"application/json\")\n   .build();\nResponse response = client.newCall(request).execute();"
        }
      ],
      "selectedLanguageId": "ihIhtto-mN-4ZKWTjI4iV"
    },
    "results": {
      "languages": [
        {
          "id": "tey4Vl3Dx72GgVbD5JCX5",
          "language": "200",
          "code": "// OK\n"
        }
      ],
      "selectedLanguageId": "tey4Vl3Dx72GgVbD5JCX5"
    }
  },
  "children": [
    {
      "id": "hwliFy__V99Bfp-jTiQP3",
      "type": "paragraph",
      "children": [
        {
          "text": "Update a Group's memberships using SCIM Operations \"add\" or \"remove\" to add or remove users. Users are automatically attributed the Group's role in all of the Group's companies."
        }
      ]
    }
  ]
}