Update Departments

Updates departments of a Kintone environment.

MethodPUT
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
organizations Array of Objects Yes An array of organizations objects, containing data of Departments to be updated.
organizations[].code String Yes The Department Code of the department to update.
Must be 128 characters or less.
organizations[].name String Optional The new Name of the Department.
Must be 128 characters or less.
Ignoring this parameter will not update the name.
organizations[].localName String Optional The new Localized Name of the Department.
Must be 128 characters or less.
Ignoring this parameter will not update the Localized Name.
organizations[].localNameLocale String Optional The Locale of the Localized Name.
en, ja, zh, or es can be specified.
Ignoring this parameter, setting the value as an empty string, or specifying null will not update the Locale.
organizations[].parentCode String Optional The Department Code of the Parent Department.
Must be 128 characters or less.
Ignoring this parameter will not update the Parent Department.
Specifying an empty string will set the Department to the Root.
organizations[].description String Optional The Description of the Department.
Must be 1000 characters or less.
Ignoring this parameter will not update the Description.

Sample Request

JavaScript (using Kintone REST API Request)

 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
26
var body = {
  'organizations': [
    {
      'code': 'code_and_IT',
      'name': 'Department of Code Troubleshooting',
      'localName': 'Department of Code Troubleshooting',
      'localNameLocale': 'en',
      'description': 'A Department dedicated to troubleshooting your code.'
    },
    {
      'code': 'R_and_D',
      'name': 'Research and Development',
      'localName': 'Research and Development',
      'localNameLocale': 'en',
      'description': 'The Kintone Research and Development team for rapid prototype development.'
    }
  ]
};

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

curl Sample

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
$ curl -X PUT \
  https://{subdomain}.kintone.com/v1/organizations.json \
  -H 'Content-Type: application/json' \
  -H 'X-Cybozu-Authorization: a2ludG9uZTpkZXZlbG9wZXI=' \
  -d '{"organizations":
  [
    {
      "code": "code_and_IT",
      "name": "Department of Code Troubleshooting",
      "localName": "Department of Code Troubleshooting",
      "localNameLocale": "en",
      "description": "A Department dedicated to troubleshooting your code."
    },
    {
      "code": "R_and_D",
      "name": "Research and Development",
      "localName": "Research and Development",
      "localNameLocale": "en",
      "description": "The Kintone Research and Development team for rapid prototype development."
    }
  ]
}'

Sample Response

1
{}

Limitations

  • The Parent Department stated within the parentCode parameter may also exist inside the request parameter array. In this case, the array must include the data of the Parent Department before the Child Department.
  • If the same Department is specified within the request parameter, the Department will be updated with the details of the latter Department data.