Skip to main content
These APIs let you read and write record data from within Kintone customization code. Use them inside event handlers to access or update field values, check permissions, and retrieve process management history.
All record APIs are available on both desktop and mobile unless noted otherwise. Mobile equivalents use the kintone.mobile.app.record namespace.

Record data

Returns the record ID of the record currently displayed on the page.Function
kintone.app.record.getId()
ParametersNone.Return value
TypeDescription
number | nullThe record ID, or null if not available on the current page.
Available pages
  • Record detail
  • Record edit
  • Record print
Example
kintone.events.on('app.record.detail.show', function(event) {
  var recordId = kintone.app.record.getId();
  console.log('Record ID:', recordId);
  return event;
});
Returns the full record object for the record currently displayed on the page, including all field values.Function
kintone.app.record.get()
ParametersNone.Return valueReturns an object with a record property containing field code keys and field value objects.
PropertyTypeDescription
recordobjectAn object whose keys are field codes. Each value is a field object with type and value properties.
Available pages
  • Record detail
  • Record create
  • Record edit
  • Record print
Example
kintone.events.on('app.record.edit.show', function(event) {
  var record = kintone.app.record.get();
  console.log('Title field:', record.record['Title'].value);
  return event;
});
Updates field values on the record currently displayed on the page.Function
kintone.app.record.set(record)
Parameters
ParameterTypeRequiredDescription
recordobjectYesAn object with a record property. The record property is an object whose keys are field codes and values are objects with a value property.
Return valueNone.Available pages
  • Record create
  • Record edit
Example
kintone.events.on('app.record.create.show', function(event) {
  kintone.app.record.set({
    record: {
      'Status': {
        value: 'In Progress'
      }
    }
  });
  return event;
});
Calling kintone.app.record.set() outside of an event handler callback may cause unexpected behavior.
Returns the current user’s permissions for the record displayed on the page.Function
kintone.app.record.getPermissions()
ParametersNone.Return value
PropertyTypeDescription
hasReadPermissionbooleantrue if the user can view the record.
hasEditPermissionbooleantrue if the user can edit the record.
hasDeletePermissionbooleantrue if the user can delete the record.
Available pages
  • Record detail
  • Record edit
  • Record create
Example
kintone.events.on('app.record.detail.show', function(event) {
  var perms = kintone.app.record.getPermissions();
  if (!perms.hasEditPermission) {
    console.log('User cannot edit this record.');
  }
  return event;
});
Returns the current user’s permissions for each field on the record displayed on the page.Function
kintone.app.record.getFieldPermissions()
ParametersNone.Return valueReturns an object whose keys are field codes. Each value is a permissions object.
PropertyTypeDescription
hasReadPermissionbooleantrue if the user can view this field.
hasEditPermissionbooleantrue if the user can edit this field.
Available pages
  • Record detail
  • Record edit
  • Record create
Example
kintone.events.on('app.record.detail.show', function(event) {
  var fieldPerms = kintone.app.record.getFieldPermissions();
  if (!fieldPerms['ConfidentialNotes'].hasReadPermission) {
    console.log('User cannot view the ConfidentialNotes field.');
  }
  return event;
});
Returns the process management status history for the record displayed on the page.Function
kintone.app.record.getStatusHistory()
ParametersNone.Return valueReturns an array of status history entries in chronological order.
PropertyTypeDescription
statusstringThe status name at this point in the history.
assigneeobject | nullThe assignee at this point, or null if unassigned.
timestringThe ISO 8601 timestamp when this status was set.
Available pages
  • Record detail
  • Record edit
This method returns an empty array if process management is not enabled for the app.
Example
kintone.events.on('app.record.detail.show', function(event) {
  var history = kintone.app.record.getStatusHistory();
  history.forEach(function(entry) {
    console.log(entry.status, entry.time);
  });
  return event;
});
Returns the app actions available for the record displayed on the page.Function
kintone.app.record.getActions()
ParametersNone.Return valueReturns an array of action objects.
PropertyTypeDescription
idstringThe action ID.
namestringThe display name of the action.
Available pages
  • Record detail
Example
kintone.events.on('app.record.detail.show', function(event) {
  var actions = kintone.app.record.getActions();
  actions.forEach(function(action) {
    console.log('Action:', action.name, '(id:', action.id + ')');
  });
  return event;
});

Internal API requests

Use these methods to call the Kintone REST API from within customization code without needing to manage authentication headers manually.
Sends a Kintone REST API request. Handles authentication automatically.Function
// Callback style
kintone.api(url, method, params, callback, errback)

// Promise style
kintone.api(url, method, params)
Parameters
ParameterTypeRequiredDescription
urlstringYesThe API endpoint URL. Use kintone.api.url() to build the URL.
methodstringYesHTTP method: "GET", "POST", "PUT", or "DELETE".
paramsobjectYesRequest body or query parameters as a plain object.
callbackfunctionNoCalled with the response object on success. If omitted, returns a Promise.
errbackfunctionNoCalled with the error object on failure.
Return valueReturns a Promise when callback is omitted; otherwise undefined.Example
// Promise style
kintone.api(kintone.api.url('/k/v1/records', true), 'GET', {
  app: kintone.app.getId(),
  query: 'limit 10'
}).then(function(resp) {
  console.log(resp.records);
}).catch(function(err) {
  console.error(err);
});
Builds the full URL for a Kintone REST API endpoint, automatically handling guest space paths.Function
kintone.api.url(path, detectGuestSpace)
Parameters
ParameterTypeRequiredDescription
pathstringYesThe API path, such as "/k/v1/records".
detectGuestSpacebooleanYesSet to true to automatically insert the guest space path segment when the app is inside a guest space.
Return value
TypeDescription
stringThe full URL for the API endpoint.
Example
var url = kintone.api.url('/k/v1/records', true);
// In a guest space: '/k/guest/1/v1/records'
// In a normal space: '/k/v1/records'
Builds a URL with query parameters appended, suitable for GET requests.Function
kintone.api.urlForGet(path, params, detectGuestSpace)
Parameters
ParameterTypeRequiredDescription
pathstringYesThe API path, such as "/k/v1/record".
paramsobjectYesQuery parameters as a plain object.
detectGuestSpacebooleanYesSet to true to automatically insert the guest space path segment when in a guest space.
Return value
TypeDescription
stringThe full URL with query parameters encoded.
Example
var url = kintone.api.urlForGet('/k/v1/record', {
  app: 1,
  id: 100
}, true);
// '/k/v1/record?app=1&id=100'
Returns the CSRF token for the current session. Required when making REST API requests directly with XMLHttpRequest or fetch instead of kintone.api().Function
kintone.getRequestToken()
ParametersNone.Return value
TypeDescription
stringThe CSRF token string.
You do not need this token when using kintone.api(), which adds it automatically.
Example
var token = kintone.getRequestToken();
fetch('/k/v1/records.json', {
  method: 'POST',
  headers: {
    'X-Requested-With': 'XMLHttpRequest',
    'X-Cybozu-RequestToken': token,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ app: 1, record: {} })
});
Returns information about the current API concurrency limit and the number of requests currently running.Function
kintone.api.getConcurrencyLimit()
ParametersNone.Return value
PropertyTypeDescription
limitnumberThe maximum number of concurrent API requests allowed.
runningnumberThe number of API requests currently in progress.
Example
var info = kintone.api.getConcurrencyLimit();
console.log('Limit:', info.limit, '/ Running:', info.running);

Proxy requests

Use these methods to call external APIs from Kintone customization code. Requests are routed through the Kintone server to avoid CORS restrictions.
Proxy APIs require prior configuration in the Kintone admin settings or plug-in proxy settings. Direct external requests from browser code are blocked by CORS.
Sends an HTTP request to an external URL via the Kintone proxy.Function
// Callback style
kintone.proxy(url, method, headers, data, callback, errback)

// Promise style
kintone.proxy(url, method, headers, data)
Parameters
ParameterTypeRequiredDescription
urlstringYesThe external URL to call.
methodstringYesHTTP method: "GET", "POST", "PUT", or "DELETE".
headersobjectYesHTTP headers as a plain object. Pass {} for no custom headers.
datastring | objectYesRequest body. Pass {} for no body.
callbackfunctionNoCalled with (body, status, headers) on success. If omitted, returns a Promise.
errbackfunctionNoCalled with the error object on failure.
Return valueWhen using the Promise style, resolves with an array [body, status, headers].
IndexTypeDescription
0stringThe response body as a string.
1numberThe HTTP status code.
2objectThe response headers as a plain object.
Example
kintone.proxy(
  'https://api.example.com/data',
  'GET',
  { 'Authorization': 'Bearer MY_TOKEN' },
  {}
).then(function(args) {
  var body = args[0];
  var status = args[1];
  console.log('Status:', status);
  console.log('Body:', body);
}).catch(function(err) {
  console.error(err);
});
Uploads a file to an external URL via the Kintone proxy.Function
// Callback style
kintone.proxy.upload(url, method, headers, data, callback, errback)

// Promise style
kintone.proxy.upload(url, method, headers, data)
Parameters
ParameterTypeRequiredDescription
urlstringYesThe external URL to upload to.
methodstringYesHTTP method: "POST" or "PUT".
headersobjectYesHTTP headers as a plain object.
dataobjectYesAn object with contentType (string) and data (string, base64-encoded file content) properties.
callbackfunctionNoCalled with (body, status, headers) on success. If omitted, returns a Promise.
errbackfunctionNoCalled with the error object on failure.
Return valueWhen using the Promise style, resolves with an array [body, status, headers] — same structure as kintone.proxy().Example
kintone.proxy.upload(
  'https://api.example.com/upload',
  'POST',
  { 'Authorization': 'Bearer MY_TOKEN' },
  {
    contentType: 'text/plain',
    data: btoa('Hello, world!')
  }
).then(function(args) {
  console.log('Upload status:', args[1]);
}).catch(function(err) {
  console.error(err);
});

Build docs developers (and LLMs) love