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 (External link) can use this API.

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

Read through the Notes on Deleting Departments (External link) article on the Kintone Help site before deleting Departments.

JavaScript (using Kintone REST API Request)

 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
{}