Was this helpful?

Use the DELETE method to delete a user from the specified group.

Request URI

DELETE /{org_id}/{app_id}/groups/{uuid|groupname}/users/{uuid|username}

Parameters

Parameter Description
arg uuid|string org_id Organization UUID or organization name
arg uuid|string app_id Application UUID or application name
arg uuid|string groupname UUID or name of the group
arg uuid|string username UUID or username of user to be deleted

cURL Example - Request

curl -X DELETE "https://api.usergrid.com//my-org/my-app/groups/mynewgroup/users/john.doe"

The example assumes use of the JavaScript (HTML5) SDK.

var options = {
    method:'DELETE',
    endpoint:'groups/mynewgroup/users/john.doe'
};
client.request(options, function (err, data) {
    if (err) {
        //error
    } else {
        //success - data will contain raw results from API call
    }
});

The example assumes use of the Ruby SDK.

app = Usergrid::Application.new 'https://api.usergrid.com/my-org/my-app/'
app['groups/mynewgroup/users/john.doe'].delete

The example assumes use of the Node.js module.

var options = {
    method:'DELETE',
    endpoint:'groups/mynewgroup/users/john.doe'
};
client.request(options, function (err, data) {
    if (err) {
        //error
    } else {
        //success - data will contain raw results from API call
    }
});

Example - Response

{
"action": "delete",
"application": "7fb8d891-477d-11e1-b2bd-22000a1c4e22",
"params": {
      "_": [
        "1331066118009"
      ]
},
"path": "/groups/a668717b-67cb-11e1-8223-12313d14bde7/users",
"uri": "https://api.usergrid.com/22000a1c4e22-7fb8d891-477d-11e1-b2bd/7fb8d891-477d-11e1-b2bd-22000a1c4e22/groups/a668717b-67cb-11e1-8223-12313d14bde7/users",
"entities": [
      {
        "uuid": "6fbc8157-4786-11e1-b2bd-22000a1c4e22",
        "type": "user",
        "name": "John Doe",
        "created": 1327517852364015,
        "modified": 1327517852364015,
        "activated": true,
        "email": "john.doe@mail.com",
        "metadata": {
          "connecting": {
            "owners": "/groups/a668717b-67cb-11e1-8223-12313d14bde7/users/6fbc8157-4786-11e1-b2bd-22000a1c4e22/connecting/owners"
          },
          "path": "/groups/a668717b-67cb-11e1-8223-12313d14bde7/users/6fbc8157-4786-11e1-b2bd-22000a1c4e22",
          "sets": {
            "rolenames": "/groups/a668717b-67cb-11e1-8223-12313d14bde7/users/6fbc8157-4786-11e1-b2bd-22000a1c4e22/rolenames",
            "permissions": "/groups/a668717b-67cb-11e1-8223-12313d14bde7/users/6fbc8157-4786-11e1-b2bd-22000a1c4e22/permissions"
          },
          "collections": {
            "activities": "/groups/a668717b-67cb-11e1-8223-12313d14bde7/users/6fbc8157-4786-11e1-b2bd-22000a1c4e22/activities",
            "devices": "/groups/a668717b-67cb-11e1-8223-12313d14bde7/users/6fbc8157-4786-11e1-b2bd-22000a1c4e22/devices",
            "feed": "/groups/a668717b-67cb-11e1-8223-12313d14bde7/users/6fbc8157-4786-11e1-b2bd-22000a1c4e22/feed",
            "groups": "/groups/a668717b-67cb-11e1-8223-12313d14bde7/users/6fbc8157-4786-11e1-b2bd-22000a1c4e22/groups",
            "roles": "/groups/a668717b-67cb-11e1-8223-12313d14bde7/users/6fbc8157-4786-11e1-b2bd-22000a1c4e22/roles",
            "following": "/groups/a668717b-67cb-11e1-8223-12313d14bde7/users/6fbc8157-4786-11e1-b2bd-22000a1c4e22/following",
            "followers": "/groups/a668717b-67cb-11e1-8223-12313d14bde7/users/6fbc8157-4786-11e1-b2bd-22000a1c4e22/followers"
          }
        },
        "picture": "https://www.gravatar.com/avatar/90f823ba15655b8cc8e3b4d63377576f",
        "username": "john.doe"
      }
],
"timestamp": 1331066118193,
"duration": 236,
"organization" : "my-org",
"applicationName": "my-app"
}

Add new comment

Provide your email address if you wish to be contacted offline about your comment.
We will not display your email address as part of your comment.

We'd love your feedback and perspective! Please be as specific as possible.
Type the characters you see in this picture. (verify using audio)

Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.