Bulk Update Users within Groups

patch

/rest/v19/companies/{companyLoginName}/groups/{groupVarName}/users

This endpoint adds or removes users for a group.

Request

Supported Media Types
Path Parameters
Body ()
Root Schema : Patch Operations
Type: array
Title: Patch Operations
The array of operations.
Show Source
Nested Schema : Group User Operation
Type: object
Title: Group User Operation
Show Source
Nested Schema : User Details
Type: object
Title: User Details
Show Source
Back to Top

Response

Supported Media Types

Default Response

List of users for a group.
Body ()
Root Schema : Users
Type: object
Title: Users
All users of a group
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : User Details
Type: object
Title: User Details
User details of group.
Show Source
Back to Top

Examples

The following example shows how to update users within groups via one web services request by submitting a PATCH request to the REST resource using cURL. For more information about cURL, see Use cURL.

curl -X PATCH -H "Authorization: Bearer <token>" -H "Content-type: application/json" -H "Accept: application/json"
https://sitename.oracle.com/rest/v19/companies/visionServices/groups/midwestTestGroup/users

Request Body Sample

{
  "operations": [{
      "op": "remove",
      "path": "/superuser"
    }, {
      "op": "add",
      "path": "/",
      "value": {
        "login": "msmith"
      }
    }, {
      "op": "add",
      "path": "/",
      "value": {
        "login": "ljones"
      }
    }
  ]
}

Response Body Sample

{
  "items": [{
      "login": "amayor",
      "firstName": "Alex",
      "lastName": "Mayor" 
    }, {
      "login": "msmith",
      "firstName": "Mary",
      "lastName": "Smith"
    }, {
      "login": "ljones",
      "firstName": "Lisa",
      "lastName": "Jones"
    }
  ],
  "links": [{
      "rel": "canonical",
      "href": "https://sitename.oracle.com/rest/v19/companies/_host/groups/midwestTestGroup/users"
    }, {
      "rel": "self",
      "href": "https://sitename.oracle.com/rest/v19/companies/_host/groups/midwestTestGroup/users?offset=0&limit=1000"
    }
  ]
}
Back to Top