Delete Users

Deletes users from a Kintone environment.

MethodDELETE
URLhttps://{subdomain}.kintone.com/v1/users.json
Authentication Password Authentication, Session Authentication
Content-Typeapplication/json

Contents

Permissions

Only Administrators can use this API.

For more information on Administrators, refer to the following article:
Types of Administrators (External link)

Request Parameters

Parameter Value Required Description
codes Array Yes An array of user codes of users to be deleted.
Up to 100 codes can be specified.

Sample Request

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
var body = {
  'codes': [
    'user1',
    'user2',
    'user3'
  ]
};
kintone.api(kintone.api.url('/v1/users.json', true), 'DELETE', body, function(resp) {
  // success
  console.log(resp);
}, function(error) {
  // error
  console.log(error);
});

XMLHttpRequest

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var body = {
  'codes': [
    'user1',
    'user2',
    'user3'
  ],
  // CSRF TOKEN: Needs to be set when using API (POST, PUT, DELETE) from Kintone
  '__REQUEST_TOKEN__': kintone.getRequestToken()
};

var url = 'https://{subdomain}.kintone.com/v1/users.json';
var xhr = new XMLHttpRequest();
xhr.open('DELETE', url);
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onload = function() {
  if (xhr.status === 200) {
    // success
    console.log(JSON.parse(xhr.responseText));
  } else {
    // error
    console.log(JSON.parse(xhr.responseText));
  }
};
xhr.send(JSON.stringify(body));

Response Parameters

An empty JSON object will be returned.

Sample Response

1
{}

Limitations

  • It is not recommended run this API while performing the following operations on the Users & System Administration page:
    • Updates to users on the Departments & Users page
      For more information on Departments & Users, refer to the following article:
      Managing Users (External link)
    • Importing from a file