Was this helpful?

See all application entities

You can delete users from your application by using cURL or one of the SDKs.

Use the DELETE method to delete the specified user given the UUID or username.

Returns the contents of the deleted user.

Request URI

DELETE /<org_id>/<app_id>/users/<uuid | username>

Parameters

Parameter Description
uuid | org_id Organization UUID or organization name
uuid | app_id Application UUID or application name
uuid | username User UUID or username. The alias /users/me can be used in place of the current user’s uuid or username. Note: The /users/me endpoint is accessible only if you provide an access token with the request (see Authenticating users and application clients). If you make an anonymous ("guest") call, the system will not be able to determine which user to return as /users/me.
request body One or more sets of user properties

Example - Request

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

Example - Response

{
    "action": "delete",
    "application": "438a1ca1-cf9b-11e0-bcc1-12313f0204bb",
    "params": {
        "_": [
        "1329432186755" ]
    },
    "path": "/users",
    "uri": "https://api.usergrid.com/12313f0204bb-438a1ca1-cf9b-11e0-bcc1/438a1ca1-cf9b-11e0-bcc1-12313f0204bb/users",
    "entities": [
         {
        "uuid": "78c54a82-da71-11e0-b93d-12313f0204bb",
        "type": "user",
        "name": "John Doe",
        "created": 1315524171347008,
        "modified": 1315524526405008,
        "activated": true,
        "city": "san francisco",
        "email": "john.doe@gmail.com",
        "metadata": {
            "path": "/users/78c54a82-da71-11e0-b93d-12313f0204bb",
            "sets": {
                "rolenames": "/users/78c54a82-da71-11e0-b93d-12313f0204bb/rolenames",
                "permissions": "/users/78c54a82-da71-11e0-b93d-12313f0204bb/permissions"
            },
            "collections": {
                "activities": "/users/78c54a82-da71-11e0-b93d-12313f0204bb/activities",
               "devices": "/users/78c54a82-da71-11e0-b93d-12313f0204bb/devices",
                "feed": "/users/78c54a82-da71-11e0-b93d-12313f0204bb/feed",
                "groups": "/users/78c54a82-da71-11e0-b93d-12313f0204bb/groups",
                "messages": "/users/78c54a82-da71-11e0-b93d-12313f0204bb/messages",
                "queue": "/users/78c54a82-da71-11e0-b93d-12313f0204bb/queue",
                "roles": "/users/78c54a82-da71-11e0-b93d-12313f0204bb/roles",
                "following": "/users/78c54a82-da71-11e0-b93d-12313f0204bb/following",
                "followers": "/users/78c54a82-da71-11e0-b93d-12313f0204bb/followers"
        },

        "username": "john.doe"
    }
],
"timestamp": 1315524526343,
"duration": 84,
"organization": "my-org",
"applicationName": "my-app"
}

Delete a user from your application as you would delete another entity generically. For more information, see Deleting Data Entities.

Delete a user from your application as you would delete another entity generically. For more information, see Deleting Data Entities.

Delete a user from your application as you would delete another entity generically. For more information, see Deleting Data Entities.

The example assumes use of the Ruby SDK.

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

The example assumes use of the Node.js module.

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

 

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.