Delete Departments

Deletes Departments from a Kintone environment.

MethodDELETE
URLhttps://{subdomain}.kintone.com/v1/organizations.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 of Strings Yes An array of department codes of departments that will be deleted.
Up to 100 codes can be specified.

Sample Request

caution
Attention

Deleting Departments may result in unintended consequences, such as also deleting child departments. For more information, read through the Notes section of the following Help article:
Deleting Departments (External link)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
var body = {
  codes: [
    'Bureau of Internet Maintenance',
    'Division of On-Line Code Control'
  ]
};

kintone.api(kintone.api.url('/v1/organizations.json', true), 'DELETE', body, function(resp) {
  // success
  console.log(resp);
}, function(error) {
  // error
  console.log(error);
});

curl Sample

1
2
3
4
5
$ curl -X DELETE \
  https://{subdomain}.kintone.com/v1/organizations.json \
  -H 'Content-Type: application/json' \
  -H 'X-Cybozu-Authorization: a2ludG9uZTpkZXZlbG9wZXI=' \
  -d '{"codes": ["Bureau of Internet Maintenance", "Division of On-Line Code Control"]}'

Sample Response

1
{}